When Ubuntu publishes a long-term support (LTS) release, I usually wait for a while before upgrading, mainly because I’m waiting for CUDA and cuDNN support for the new release. This time, it only took me three months to migrate from Ubuntu 18.04 to Ubuntu 20.04 — well, technically an Ubuntu-based distro, i.e. Regolith Linux. My decision to do so was simply because I upgraded my SSD from 120GB to 1TB, and so I migrated to a different OS as well— albeit just an Ubuntu derivative.
As I expected, it took me a while to work things out in my new system. Fortunately, I saw some helpful answers online, and now I’m expanding on their answers by adding a bit more explanations. So, this post is actually based on the answers given by meetnick and singrium in this related question posted in Ask Ubuntu.
The installation of TensorFlow GPU in Ubuntu 20.04 can be summarized in the following points,
nvidia-cuda-toolkit
.First, ensure that you are using the NVIDIA proprietary driver by going to “Additional Drivers”, and then choosing the appropriate driver, i.e. for CUDA 10.1, the required driver version is ≥ 418.39. We use the proprietary version over the open source one since CUDA can only operate with the proprietary driver.
We are installing CUDA 10.1 because it is the compatible version with TensorFlow GPU.
Image by the author. Choose the appropriate proprietary driver version for CUDA 10.1, i.e. ≥ 418.39.
At the time of this writing, there is no available CUDA 10.1 for Ubuntu 20.04, but as meetnick points out in the referenced Ask Ubuntu post, installing nvidia-cuda-toolkit
also installs CUDA 10.1.
For the sake of being verbose, do not try to use 18.10 or 18.04 CUDA 10.1 for Ubuntu 20.04. I learned that the hard way, lol!
So, you can install CUDA 10.1 in Ubuntu 20.04 by running,
$ sudo apt install nvidia-cuda-toolkit
After installing CUDA 10.1, run nvcc -V
. Then you will get an output similar to the following to verify if you had a successful installation,
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
#deep learning