After uninstalling CUDA toolkit still MATLAB responds for gpuDevice() !!
3 views (last 30 days)
Show older comments
Hi
Accidently I installed CUDA 10 in ubuntu 16.04.
So i unistalled CUDA from ubuntu. But still it responds to gpuDevice.
I am raising this issue because I am worried if I install CUDA 9.1, MATLAB may not be able to detect new CUDA.
Is there any environment variable or something, I have to change.
![Screenshot from 2018-11-27 18-50-39.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197173/Screenshot%20from%202018-11-27%2018-50-39.png)
0 Comments
Answers (1)
Edric Ellis
on 28 Nov 2018
Edited: Edric Ellis
on 28 Nov 2018
MATLAB and Parallel Computing Toolbox need the CUDA driver to be installed on your system, not the CUDA toolkit.
I admit it is very easy to get confused about the distinction between these two components, let me try to explain.
The CUDA driver is a frequently-updated low-level library that connects your GPU hardware into the rest of your computer. It provides the lowest-level support for your GPU - for example, it provides the ability to allocate memory on the GPU, and to launch kernels. However, the driver does not contain any specific algorithms - for example, it does not contain an FFT implementation.
Any given CUDA driver supports all CUDA versions up to and including the version current at the time of release of that driver. It is almost always the right thing to do to install the latest available CUDA driver from NVIDIA, since newer drivers are compatibile with older applications that use CUDA. (There are rare exceptions when this compatibility is inadvertently broken)
The CUDA toolkit comprises a CUDA compiler (nvcc), and support libraries for FFT and BLAS (MTIMES etc.). Any given CUDA application (such as MATLAB) is built using a specific version of the CUDA toolkit. In the case of MATLAB, we ship with MATLAB the portions of the CUDA toolkit that are needed for execution of gpuArray code. For example, we ship the cufft and cublas libraries. You can see these in the <matlab>/bin/<arch> directory.
Putting all this together - for most usage of gpuArray, you do not need to install any version of the CUDA toolkit, since MATLAB already brings along the pieces it needs. However, we cannot bring along the CUDA driver, so you must install that - and the only requirement there is that the driver is at least as recent as the version of the toolkit shipping in the version of MATLAB you're using.
The time you need to install your own CUDA toolkit is when you want to build CUDA sources to use within MATLAB, either using parallel.gpu.CUDAKernel or mexcuda. In that case, to ensure correct binary compatibility, it is important that you install precisely the same version of the CUDA toolkit as is being used by MATLAB. You can see this version information by looking at the ToolkitVersion property of the gpuDevice object. (The DriverVersion of your gpuDevice tells you the latest version of the CUDA toolkit supported by the CUDA driver installed on your machine.)
One final note: NVIDIA have a page about compatilibity of drivers and toolkits here.
5 Comments
Joss Knight
on 30 Nov 2018
Linux drivers are distributed (on that page that Edric linked) as a runfile (that you just run from the command line) if you select "Linux 64 bit", and as a .deb or other if you select a specific Linux distribution.
See Also
Categories
Find more on GPU Computing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!