Nvidia GPU GeForce 5060-5090

344 次查看(过去 30 天)
Are the Nvidia GeForce RTX 5060, 5070, 5080 and 5090 compatibile with Matlab R2025a?
Matlab website (see https://www.mathworks.com/help/parallel-computing/gpu-computing-requirements.html) says that Matlab supports Nvidia GPU with compute capability from 5.0 to 9.x
This is quite unfortunate, because it seems that Matlab R2025a does not work with the latest nvidia gpu, which were however realeased on Jan 2025. Given that R2025a was realeased six months after that, one would assume that the compatibility issues were solved. Does Mathworks commit to make RTX 5090 compatible with R2025b?
I read about the possibility of forward compatibility (with enable CUDA forward compatibility) here https://www.mathworks.com/matlabcentral/answers/2173867-can-i-use-my-nvidia-blackwell-architecture-gpu-with-matlab-for-gpu-computing
but I didn't find the post very clear.
Any feedback is greatly appreciated, thanks!

采纳的回答

Walter Roberson
Walter Roberson 2025-7-22
Are the Nvidia GeForce RTX 5060, 5070, 5080 and 5090 compatibile with Matlab R2025a?
NO.
Given that R2025a was realeased six months after that, one would assume that the compatibility issues were solved.
R2025a became available for Pre-Release around Christmas time -- before the RTX 50x0 devices were released. Once a release has entered pre-release, no new features are added to it (only bug fixes, and trial features are sometimes taken away and not made into the official release.)
Official RTX 50x0 support will not be put into R2025a.
In the meantime, if you enable forward compatiability using
parallel.gpu.enableCUDAForwardCompatibility(true)
then it wil do byte compilation. WIth byte compilation, there is the possibility of misfunctioning.
  3 个评论
Alessandro
Alessandro 2025-9-20,17:43

I can confirm it. Let's hope mathworks extends supoort to RTX 50x0 soon!

请先登录,再进行评论。

更多回答(2 个)

Joss Knight
Joss Knight 2025-7-23
编辑:Joss Knight 2025-7-23
Hello! Walter has the 'raw' answer. The practical answer is that I haven't yet seen any problems with MATLAB R2024b and R2025a running on Blackwell in forward compatibility mode.
I'd be very interested to know what it is about the Knowledge Article and the documentation page are difficult to follow, so we can improve them and others don't have the same experience. I realise that perhaps the article goes into more detail than you need? This is to help explain some of the behaviour you will likely experience.
It may also be worth clarifying that MathWorks' quality assurance program is second-to-none, and that means we would not usually do something as invasive and risky as upgrading our CUDA libraries to support a new architecture less than six months before release. This protects our valuable users from the bugs, inconsistencies and incompatibilities that plague less rigorously developed and tested software.
  4 个评论
Xinwen
Xinwen 2025-10-9,21:57
When will Matlab support compute capability of 12X?

请先登录,再进行评论。


jorge
jorge 2025-9-17,3:10
编辑:Walter Roberson 2025-9-17,3:35
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');

类别

Help CenterFile Exchange 中查找有关 Get Started with GPU Coder 的更多信息

产品


版本

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by