Matlab Does not recognise NVIDIA GPU Card in the PC

23 views (last 30 days)
I am trying to use GPU NVIDIA Quadro 2000 with matlab 2017a but every time I am using gpuDeviceCount the answer is 0.
I have tried to update the driver of the gpu but the version was the latest one.
wish to solve my problem Thanks
  3 Comments
Mammo Image
Mammo Image on 6 Oct 2017
Is there any wrong in the question? I feel there is something misunderstood!!
Walter Roberson
Walter Roberson on 6 Oct 2017
Questions here are answered by volunteers. There are currently over 140 new questions being asked every day, and activity on about another 100 older questions, so there is activity on over 225 questions every day. Sometimes volunteers overlook questions; sometimes they just do not have time to look at over 225 questions every day -- a lot of the volunteers also have paid jobs that they have to attend to.
And... not all of the volunteers know everything about every topic, so whether you get a response or not can depend on whether the right volunteer happens to read your Question.
I have personally worked on over 65 different Questions within the last 24 hours. Your Question came in while I was sleeping, as did your reminder prompt about 2 hours later; when I woke up, I had a responsibility to deal first with the Questions I was already working on. With all the new Questions coming in, I did not see your Question until now.

Sign in to comment.

Answers (3)

Walter Roberson
Walter Roberson on 6 Oct 2017
Is that:
  • Quadro P2000 (CUDA capability 6.1)
  • Quadro M2000 (CUDA capability 5.3)
  • Quadro K2000 (CUDA capability 3.0)
What operating system are you using, and which distribution / release are you using? Which CUDA did you install?
If you just recently installed CUDA then you would have downloaded CUDA 9.0, which was not supported by MATLAB R2017a. MATLAB R2017a supported CUDA 8.0; you can download that from https://developer.nvidia.com/cuda-80-ga2-download-archive

Edric Ellis
Edric Ellis on 9 Oct 2017
Edited: Edric Ellis on 9 Oct 2017
Further to Walter's pertinent questions, I'd like to add: it's important to distinguish the CUDA driver from the CUDA toolkit.
CUDA Driver:
  • The CUDA driver allows the computer to access the GPU device for computation
  • All users must install a CUDA driver
  • It is always advisable to use the latest CUDA driver (NVIDIA ensure backwards-compatibility for CUDA drivers which mean that newer drivers are intended to work completely correctly with older applications)
CUDA Toolkit:
  • The CUDA toolkit provides support for compiling CUDA sources
  • Most users don't actually need to install the CUDA toolkit
  • The CUDA toolkit is needed only for compiling CUDA sources (e.g. for use with mexcuda or CUDAKernel)
  • If you do install the CUDA toolkit, ensure that the version matches the version used by MATLAB. The version used by MATLAB is described in the Parallel Computing Toolbox release notes
If after installing the latest CUDA driver, MATLAB cannot recognise the GPU device, then contact MathWorks support who are able to take you through additional debugging steps.
  7 Comments
pb
pb on 7 Dec 2023
Hi @Edric Ellis, thanks very much for your quick response, I was traveling so missed to acknowledge it earlier. I did update the driver and it was detected in MATLAB. I had not messed with the driver because the person who installed the Graphics Card had installed that driver.
As per your suggetsion I will also look for another graphics card, is there any main specs I should look out for?
Finally, if you get a moment, would you be able to take a look at my comment on here, from 25 Nov 2023, and if you could shed any light on it that would be great. The documentation for GPU usage states that all inputs must be moved onto GPU in order to compute on the GPU, however, I am trying to figure out what the nature of the inputs are (i.e. a computing tool such as a classifier, versus a simple variable that may be altered)
Edric Ellis
Edric Ellis on 7 Dec 2023
GPU specs depend on the workload you're intending to use. Standard MATLAB-style numerics require good double-precision performance. These devices can be very expensive. Other applications use integer or single-precision floating point numbers far more, and can run well on somewhat less expensive devices.
Regarding your comment - in general you need to move data to the GPU to have operations performed there - but this only applies to numeric/logical data and ordinary numeric operations. Deep learning isn't something I know much about, but perhaps this page will help: https://uk.mathworks.com/help/deeplearning/ug/scale-up-deep-learning-in-parallel-on-gpus-and-in-the-cloud.html

Sign in to comment.


jorge
jorge on 17 Sep 2025
Edited: Walter Roberson on 17 Sep 2025
I solved the issue where MATLAB R2024b failed to recognize my NVIDIA RTX 5060 Laptop GPU (Compute Capability 12.0). The problem was that this GPU is newer than the CUDA libraries bundled with R2024b, so validateGPU reported:
Device supported … FAILED: GPU device is not supported because it has a higher compute capability than is natively supported.
Fix
Enable CUDA Forward Compatibility inside MATLAB so it can run on GPUs newer than its built-in CUDA stack:
parallel.gpu.enableCUDAForwardCompatibility(true);
gpuDevice()
On the first run, MATLAB recompiles GPU libraries (it may take longer), but afterwards the GPU works normally for gpuArray, deep learning, and other GPU-accelerated functions.Notes
  • Use the NVIDIA Studio Driver for best stability.
  • Make sure MATLAB.exe is set to use the High performance NVIDIA GPU in Windows Graphics Settings.
  • To avoid typing this every session, add the command to startup.m.
With this setup, MATLAB R2024b can fully use the RTX 5060 (Compute Capability 12.0) despite not having native support yet.
%% ============================================================
% Enable GPU in MATLAB R2024b with CUDA Forward Compatibility
% Author: [Jorge R Parra Michel]
%
% SYMPTOMS
% - MATLAB detects the GPU physically (it appears in nvidia-smi) but
% `validateGPU` reports:
% "Device supported .... FAILED: GPU device is not supported because
% it has a higher compute capability (...) than is natively supported"
% - `gpuDeviceCount("available")` returns 0 or `gpuDevice` throws an error.
% - This occurs on newer GPUs (e.g. RTX 50 series, Compute Capability 12.0)
% with recent NVIDIA drivers (e.g. 581.xx) in MATLAB R2024b.
%
% FIX
% - Enable MATLAB's "CUDA Forward Compatibility" mode:
% parallel.gpu.enableCUDAForwardCompatibility(true)
% This allows GPUs newer than the shipped CUDA libraries to run by
% recompiling kernels on first use.
%
% TECHNICAL EXPLANATION
% - R2024b ships with CUDA support for older compute capabilities (≤11.x).
% GPUs like RTX 5060/5070 use Compute Capability 12.0, which is newer.
% - Forward compatibility recompiles GPU libraries JIT on first call.
% The first operation may take much longer, then kernels are cached and
% subsequent runs are fast. On Windows (WDDM), performance can also be
% affected if the GPU is heavily used for graphics.
% - Using the NVIDIA Studio Driver is recommended for stability.
%
% NOTES
% - To automate, add to your `startup.m`:
% parallel.gpu.enableCUDAForwardCompatibility(true);
% - On Windows, make sure MATLAB.exe is set to run on the "High performance
% NVIDIA GPU" under Settings → System → Display → Graphics.
% - This script does not “enable” the GPU globally; it only enables forward
% compatibility and validates the device inside MATLAB.
% ============================================================
fprintf('\n=== GPU Forward-Compatibility enablement (R2024b) ===\n');
% 1) Enable forward compatibility for newer CUDA devices
try
parallel.gpu.enableCUDAForwardCompatibility(true);
fprintf('Forward Compatibility: ENABLED\n');
catch ME
fprintf(2,'[ERROR] Could not enable Forward Compatibility: %s\n', ME.message);
return;
end
% 2) Check how many CUDA devices MATLAB can see
try
n = gpuDeviceCount("available");
fprintf('CUDA devices detected by MATLAB: %d\n', n);
catch ME
fprintf(2,'[ERROR] gpuDeviceCount() failed: %s\n', ME.message);
return;
end
if n < 1
fprintf(2,['[WARN] MATLAB sees no available CUDA devices.\n' ...
' Check NVIDIA driver (Studio), nvidia-smi, and GPU preference for MATLAB.exe.\n']);
return;
end
% 3) Select and report device info
try
dev = gpuDevice(1);
fprintf('Selected GPU: %s | ComputeCapability=%s | DriverModel=%s\n', ...
dev.Name, dev.ComputeCapability, dev.DriverModel);
fprintf('TotalMemory: %.2f GB | AvailableMemory: %.2f GB\n', ...
dev.TotalMemory/2^30, dev.AvailableMemory/2^30);
catch ME
fprintf(2,'[ERROR] gpuDevice(1) failed: %s\n', ME.message);
return;
end
% 4) Warm-up and simple benchmark
try
sz = 3000; % matrix size
fprintf('\nWarm-up and benchmark (GEMM %dx%d, single precision)\n', sz, sz);
% First call: warm-up (may trigger JIT compilation)
A = gpuArray.rand(sz,'single');
B = A*A; %#ok<NASGU>
wait(dev);
% Second call: should be much faster
f = @() A*A;
tGPU = gputimeit(f);
fprintf('GPU time (second run): %.3f s\n', tGPU);
% CPU comparison
xCPU = rand(sz,'single'); %#ok<NASGU>
tCPU = timeit(@() xCPU'*xCPU);
fprintf('CPU time: %.3f s | speedup ~ x%.2f\n', tCPU, tCPU/max(tGPU,eps));
catch ME
fprintf(2,'[WARN] Benchmark failed (non-critical): %s\n', ME.message);
end
fprintf('\nFinal status: GPU ready with Forward Compatibility enabled.\n');
fprintf('Tip: add the command to startup.m to automate in future sessions.\n');

Tags

Products

Community Treasure Hunt

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

Start Hunting!