how to install supported CUDA Toolkit 10.2 on Ubuntu 20.04 LTS Linux

496 views (last 30 days)
As you can see here, the CUDA Toolkit currently suported by R2020b is 10.2. But, as you can see here , the only supported version of Ubuntu Linux by CUDA Toolkit 10.2 is Ubuntu 16.04 and 18.04, not 20.04.
How can I install supported version of CUDA toolkit 10.2 on clean installation of Ubuntu 20.04? What is the official install procedure for Ubuntu 20.04 Linux??? Where can I find detailed description of CUDA toolkit 10.2 installation procedure for already officially supported Ubuntu 20.04?
The situatiion is even worst, because different versions of CUDA Toolkit requires different versions of GCC compilers, which are not officially supported by current version of MATLAB, see here. CUDA Toolkit 10.2 requires GCC 7, but GCC version supported GPU (CUDA) for R2020b is GCC 8.
So, I think that this situation is, at least, a bit confusing. But the fact is, that is absolutely not clear how to install currently supported CUDA toolkit (version 10.2) on currently supported linux distribution (Ubuntu 20.04), which is really strange?!
Matt J
Matt J on 11 Dec 2020
Edited: Matt J on 11 Dec 2020
So, on Ubuntu 20.04 is not possible to operate Cuda kernel objects and GPU coder at all, even in a case when Ubuntu 20.04 officially supports these Matlab functionalities?
I didn't quite understand that. Surely it is not Ubuntu developers that claim to support Matlab functionality. If anything it is the Mathworks, as the reseller, that claims to accomodate Ubuntu 20.04 users. It is a fair question how the Mathworks can claim to simultaneously accomodate Ubuntu 20.04 with CUDA Toolkit 10.2 if NVIDIA documentation says they are incompatiable, but surely the incompatibility is not something that Mathworks, as the reseller, could solve. It would require NVIDIA, as the OEM, to support Ubuntu 20.04 officially.

Sign in to comment.

Accepted Answer

Michal on 10 Dec 2020
After thorough discussion with Matlab support and several relevant forums (Ubuntu, NVIDIA, ...) the final result is as follows:
  1. Installation of NVIDIA CUDA Toolkit 10.x (only supported by recent version of MATLAB) on Ubuntu 20.04.x is very problematic or totally impossible task (depends on your Linux skills). Better forget it ... !!!
  2. The only possible way how to reliable install NVIDIA CUDA Toolkit 10.x together with recent Matlab on Ubuntu OS is downgrade to the Ubuntu 18.04 version
  3. Forthcoming Matlab version R2021a will be support NVIDIA CUDA Toolkit 11.0 (compatible with Ubuntu 20.04) which is probably good news, but so far not possible to verify it
So finally, if you're working on Ubuntu 20.04 LTS and want to use CUDA kernel objects or a GPU coder, you're out of the game.
Happy computing!!!

More Answers (2)

Andrea Picciau
Andrea Picciau on 9 Dec 2020
Edited: Andrea Picciau on 9 Dec 2020
Hi Michal,
Parallel Computing Toolbox (and GPU coder from what I know) comes with its own version of the toolkit, so you shouldn't have to install anything. Are you seeing any problems with MATLAB on Ubuntu 20.04?
Michal on 9 Dec 2020
I already did, but the only response of TMW support so far is: forthcoming version R2021a support Cuda toolkit 11.0.
I am not sure if this answer is acceptable for any customer!?

Sign in to comment.

Curt Corum
Curt Corum on 27 Oct 2021
Dear All,
If needed the following can be done...
Install gcc-8 on Ubuntu 20.04 according to instructions at:
Temporarily set gcc-8 as compiler version for gcc using:
(base) curt@asimov:~/ngfn_recon_uiowa_clean/matlab/gpuNUFFT/CUDA$ sudo update-alternatives --config gcc
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).
Selection Path Priority Status
* 0 /usr/bin/gcc-9 90 auto mode
1 /usr/bin/gcc-8 80 manual mode
2 /usr/bin/gcc-9 90 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/gcc-8 to provide /usr/bin/gcc (gcc) in manual mode
Use script install of CUDA 10.2 from:
which will work on Ubuntu 20.04 even though not recommended.
Make sure to do your mex build with the above alternative gcc-8 setting and switch back when done.
I have used this to build gpuNUFFT mex binaries on Ubuntu 20.04, since gpuNUFFT does nor perform well with later toolkit versions.
Hope this helps...




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by