Unable to find available GPU device on matlab
Mostra commenti meno recenti
Hi everyone,
I am trying to use GPU on my matlab, when I type gpuDevice, an error persistently occurs as:
Encountered unexpected error during CUDA execution. The CUDA error was:
CUDA-capable device(s) is/are busy or unavailable. I can find information when I type gpuDeviceTable, as shown in the attached figure.
I am using Matlab R2023b on Windows 11, NVIDIA RTX 6000 Ada and I have installed the correponding driver and CUDA version, their information can be found in the attached figure.
Such a GPU with compute capability of 8.9 should be supported by matlab.
Can everyone tell me some advice to fix this?
Thank you very much.

Best,
Jinghua
Risposte (1)
T.Nikhil kumar
il 28 Nov 2023
Hello Jinghua,
I understand that you are facing an error on using the ‘gpuDevice’ function. You could follow the below suggestions which may help resolve the error:
- Ensure that no other process is using the GPU. Close any other applications that might be using the GPU resources.
- If you have a display GPU then you could try making the display GPU invisible using the following command:
setenv('CUDA_VISIBLE_DEVICES','0')
3. Try using the ‘reset’ function to reset the GPU device and clear its memory and then use the ‘gpuDevice’ function.
4. Virtual Machine support for MATLAB is not explicitly present. If you are using a virtual machine, you could face this error. NVIDIA provides the vGPU software which provides virtual machines the access to NVIDIA GPUs. Check out Virtual GPU Software documentation from NVIDIA to resolve the error.
5. Use the ‘coder.checkGpuInstall’ command to verify GPU environment. This can direct you to the root cause of the error by giving ‘FAILED’ status to that check. Try the suggestions that follow for each ‘FAILED’ check.
For more information on ‘coder.checkGpuInstall’ and the ‘reset’ methods, refer to the following MathWorks documentations:
- https://www.mathworks.com/help/gpucoder/ref/coder.checkgpuinstall.html
- https://www.mathworks.com/help/parallel-computing/parallel.gpu.gpudevice.reset.html
Hope this helps!
1 Commento
景华
il 28 Nov 2023
Categorie
Scopri di più su Get Started with GPU Coder in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!