I upgraded gpu from nvidia 4080super to 5090, and now using matlab 2024b to train a resnet18 for image classification (transfer learning). I note that GPU is not working. As I understand from a previous comment, it is too early for native support of 5090 on date 2025/06/07.
(1) Is the support enabled in 2025a?
(2) I saw a comment with a solution. As I understood, I just add this code before my own code
(3) However, I read "Enabling forward compatibility can result in wrong answers and unexpected behavior during GPU computations." Not sure what this exactly means, will the matlab-gpu make "mistakes" during the deep learning computation and/or network performance will be degradated? If this is the case, then better reinstall 4080super?
Thank you very much for your understanding and help.

2 Comments

MANUEL
MANUEL on 11 Jul 2025

I installed Matlab R2025a today and my RTX 5090 is not working. Parallel indicates that this GPU is not supported. I will switch to my RTX 4070 ti.

Make sure you do
parallel.gpu.enableCUDAForwardCompatibility(1)

Sign in to comment.

Answers (1)

Joss Knight
Joss Knight on 6 Jun 2025

2 votes

We don't test MATLAB under forward compatibility, in the past it has had missing features in some NVIDIA libraries, and by its nature it is guaranteed to be less well optimized (you can't optimize for future hardware). So what we're saying is, use at your own risk.

That said, we have run some tests and everything seems to work, and basic performance tests have given reasonable results. This is a result of some extra effort from NVIDIA in CUDA 12 so well done them.

In answer to your question, if your Blackwell cards are not faster I'd say wait for R2025b.

3 Comments

Thank you for the reply.
I added the codes as instructed in the matlab webpage previous to the one of CNNs and gpu worked. During the test cuda was at 50% and desktop at 400 watt, so I understand it was working.
Since no hurry, I may wait for 2025b.
I am grateful to matlab to make easy environment so you can get the work done.
Joss Knight
Joss Knight on 6 Jun 2025
Edited: Joss Knight on 6 Jun 2025

By the way, your code doesn't look right, you need parallel.gpu.enableCUDAForwardCompatibility(true)

Still, looks like whatever you did it worked.

tf = parallel.gpu.enableCUDAForwardCompatibility()
parallel.gpu.enableCUDAForwardCompatibility(1)
tf = parallel.gpu.enableCUDAForwardCompatibility()
gpuDeviceCount("available")
gpuDeviceTable
gpuDevice(1);
A = ones(100,'gpuArray');

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!