CUDA 10 supported with MATLAB 2017b

Hi,
I am using MATLAB 2017b and have Cuda driver v10 installed in my machine. While running MATLAB when I use the command "gpuDeviceCount" it returns 0 and "gpuDevice" just throws and Exception lke the following
Error using gpuDevice (line 26) An unexpected error occurred during CUDA execution. The CUDA error was: CUDA_ERROR_UNKNOWN
I am trying to find out if there are some additional steps I need to do to enable my MATLAB to use the cuda driver. Also I am using Windows 10.

Answers (2)

Joss Knight
Joss Knight on 6 Nov 2018
Edited: Joss Knight on 6 Nov 2018
There are a number of possible explanations for this.
One is that you are using a Volta or Turing card with an older MATLAB version that does not support it natively. You should make sure you have the latest Update for R2017b, take a look at this Answer for some other advice, and at this bug report.
A second is that your driver was improperly installed. Try checking the output of nvidia-smi to see if it's behaving correctly.
cd('C:\Program Files\NVIDIA Corporation\NVSMI');
!nvidia-smi
There are some other things we can try if this doesn't work.
Ranadeep Deb
Ranadeep Deb on 6 Nov 2018
Turns out I had to use Cuda v8 with VS 2015 and cudnn 5.1 with MATLAB 2017b for everything to work.
I am not sure if there are other configurations that will work too but this one worked for me

5 Comments

Joss Knight
Joss Knight on 7 Nov 2018
Edited: Joss Knight on 7 Nov 2018
Installing your own copy of cudnn 5.1 can't make any difference, MATLAB ships those libraries. Unless you are writing your own MEX functions that use cuDNN?
I have a CUDA 10 driver installed on my Windows machine and I can run MATLAB R2017b on it fine and see my two GPU devices. All of our Windows testing uses CUDA 10 drivers.
I tried with CUDA 10 and while I was able to see my GPU from command prompt, from MATLAB R2017b I was not able to do the same.
Joss Knight
Joss Knight on 7 Nov 2018
Edited: Joss Knight on 7 Nov 2018
Okay. If you would like to pursue this further then reply with the output from nvidia-smi. If you are happy with your solution then never mind. I just wanted it to be clear to readers that when the driver is not backwards compatible then it is a fault with the driver (or possibly a MATLAB bug), and not any kind system requirement on the driver version.
Or instead of an outright fault, it might be that the card is not supported in newer versions. Kepler, Maxwell, and Pascal GPUs were the only ones on mainstream support as of March 2018; I suppose Volta has been added since then. (Hmmm, Volta already existed at the time that article was written, so it is odd that they did not mention it.)
Joss Knight
Joss Knight on 7 Nov 2018
Edited: Joss Knight on 7 Nov 2018
Well, you might indeed have hit upon it there Walter. Perhaps this user has a Fermi card, which would indeed not be supported by a CUDA 10 driver. Or a CUDA 9 one. Perhaps nvidia-smi is able to query the card via the kernel driver, but the CUDA driver cannot be used. I fully accept that this is a spin on the backwards compatibility story I'd forgotten about (i.e. drivers are not backwards compatibile to architectures for which NVIDIA has dropped support).

Sign in to comment.

Categories

Find more on Get Started with GPU Coder in Help Center and File Exchange

Products

Release

R2017b

Asked:

on 3 Nov 2018

Edited:

on 8 Nov 2018

Community Treasure Hunt

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

Start Hunting!