If you don’t need tensorflow-gpu
but just tensorflow
, you may safely ignore this post.
If you need tensorflow-gpu
, according to its software requirement, you need the following:
- NVIDIA proprietary driver, also includes CUPTI
- CUDA Toolkit 10.0
- cuDNN
- (Optional) TensorRT 5.0
The last two are easy to install and this post focus on NVIDIA driver and CUDA toolkit.
First, CUDA 10.0 requires NVIDIA driver version >= 410.48, according to this.
Then, depending on whether you need CUDA simply as a runtime dependency for tensorflow and other softwares, or you need it as a build-time dependency for your own development, go to one of the two sections below.
CUDA for Runtime Dependency
- Install the latest NVIDIA driver, without setting
no-modprobe
during installation. Otherwise tensorflow may fail to detect your CUDA device. - Download CUDA 10.0, which is a run file, containing an old version of NVIDIA driver, the CUDA toolkit, and other component. You can extract it and get the CUDA Toolkit itself. Then install it.
Note: During installation of CUDA, you need to tell it to skip building CUDA examples.
CUDA for Built-time Dependency
According to Installation guide of CUDA 10.0, you need kernel <=4 and gcc <=7. Fortunately this is outdated.
The guide of CUDA 10.1 shows that, it works on kernel =5 and gcc <=7. Previously I had verified that 10.0 also works with this configuration.
LTS kernel
If you are on the LTS kernel, your kernel version is 4 and you can install CUDA without any hassle.
Native kernel
If you are on native kernel, which has version 5.3.7 now, you have to install gcc7
, which is available in c-extras-gcc7
bundle. Then follow the same steps mentioned above.