How can the answer be improved? This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04. ### steps ####. # verify the system has a cuda-capable gpu.
Ubuntu 18.04 Tutorial : How to install Nvidia driver + CUDA + CUDNN + build tensorflow for gpu step by step command line
Thoses steps allowed me to build tensorflow for gpu with a comptute capabilities of 3.0 on a laptop with a GeForce 740m and Ubuntu 18.04.
Install neccesary library :
If libcurl3-dev package is not found use:
Add graphics drivers to your source list :
Check what driver will be installed :
Auto install latest driver (it will do everything blacklist drivers nouveau , create nvidia daemon , ect ...) :
Then reboot your machine :
If you boot without any kernel crash you're ok but you can check the correct install of the driver :
or
Download cuda_your_cuda_version.run on https://developer.nvidia.com/cuda-toolkit and install it:
If everything is ok you should see a cuda folder in /usr/local/ .
Download linux cudnn_your_version on https://developer.nvidia.com/cudnn and install it:
Check if you have correctly copied cudnn in /usr/local/cuda/lib64/.
Now you must add some path to your /.bashrc :
Add those line at the end of your /.bashrc :
Now reload your terminal config :
Check if the path are correctly installed :
Install gcc 4.8 (only version of gcc that can currently compile tensorflow) :
If gcc-4.8 package is not found you can try to add :
Install bazel :
Download tensorflow and choose what branch you want :
Create configuration file for tensorflow build :
Say no to most query just specify the python version you want , yes to jemalloc and specify correct path to gcc-4.8.
Build tensorflow with bazel :
Create .whl for pip install :
Let me know if you find some quicker way to build tensorflow or if you found some mistakes.