MATLAB Answers

installed CUDA but unable to run gpuarrays

37 views (last 30 days)
HIMANSHU RATHORE
HIMANSHU RATHORE on 22 Jan 2020
Commented: Jason Ross on 22 Jan 2020
i WISH TO USE THE PARALLEL COMPUTING TOOLBOX IN MY CODE. SPECIFICALLY "gpuarrays". MY MATLAB VERSION IS MATLAB R2019B. I have installed CUDA 10.1 from NVIDIA ALREADY. BUT STILL WHEN TRY EXECUTING THE CODE THE FOLLOWING ERROR IS SHOWN:
Unable to load CUDA driver. The library name used was nvcuda.dll. The error was:
The specified module could not be found.
Update or reinstall your GPU driver. For more information on GPU support, see GPU Support by Release.
DONT KNOW WHAT TO DO! HELP PLEASE.

  0 Comments

Sign in to comment.

Answers (1)

Jason Ross
Jason Ross on 22 Jan 2020
Did you install the CUDA toolkit only? You also need to install the driver.
To see if the driver is loaded properly run "nvidia-smi" on Linux or C:\Program Files\Nvidia corporation\nvsmi\nvidia-smi.exe on Windows. You run these commands in a command shell. If the driver and GPU are installed you should see something like the following. If the command isn't found or doesn't show something similar to below, it sounds like your driver isn't installed properly.
On a side note, the use of all caps is considered shouting/yelling.
Wed Jan 22 10:47:58 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.40.04 Driver Version: 418.40.04 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla K40m Off | 00000000:84:00.0 Off | 0 |
| N/A 29C P0 64W / 235W | 0MiB / 11441MiB | 80% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+

  2 Comments

HIMANSHU RATHORE
HIMANSHU RATHORE on 22 Jan 2020
I profusely apologise for using CAPS for my query draft. I was not aware of its connotations.
I have downloaded (cuda_10.1.105_418.96_win10) application from the NVIDIA website and installed (recommended) as per instructions.
NVIDIA has gotten placed in two folders in C:\Program Files\
Pathname: C:\Program Files\ NVidia Corporation
C:\Program Files\ NVidia GPU Computing Toolkit
There is a folder by the name of CUDA in 'NVidia GPU Computing Toolkit'. It consists of v10.1 folder. Please see the attached relevant files for perusal. I think it suggests that drivers are inherently installed with the CUDA computing kit.
I tried doing what you suggested i.e. running C:\Program Files\Nvidia corporation\nvsmi\nvidia-smi.exe on Windows but that didnt work. there is no 'nvsmi' in either of the above mentioned folders.
I found nvml, nvvm, src, tools, libnvvp, lib, jre, include, extras, doc, bin folders in 'NVidia GPU Computing Toolkit'.
Guide me as to how can i download this specific driver (nvsmi) afresh if that can solve the purpose.
I have to run a MATLAB code. My MATLAB license is active. I need to use 'gpuarrays'.
P.S. Refer attached files for more info regarding installation.
Jason Ross
Jason Ross on 22 Jan 2020
Go to nvidia.com and download/install the latest driver for your GPU. This should have ideally happened when you installed your GPU -- Windows should have recognized the card and automatically installed the driver when the machine booted (unless you have that disabled, in which case you need to download/install it manually). The installation procedure is performed by running the driver .exe and clicking Next.
The driver is the only thing that needs to be installed for MATLAB to recognize the GPU, if you want to do a custom install and not install nVidia's extra stuff that comes with the driver.
After installation, nvidia-smi.exe should be in the folder I mentioned before and MATLAB should find it.
The Toolkit and SDK are not required to be installed on your host to use MATLAB with a GPU. Only the driver is required.
Another thing to check is the Device Manager to see if the GPU is found and functioning normally. I have had cases where I didn't seat the GPU properly in the PCI slot, or where the external power connection(s) were not fully seated on the GPU or motherboard. In some of these cases the Device Manager would show it with a warning triangle, or the GPU itself might report that it doesn't have enough power to operate.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by