CUDA seems not to be supported

73 views (last 30 days)
Theron FARRELL
Theron FARRELL on 2 Nov 2024 at 8:19
Commented: Joss Knight on 11 Nov 2024 at 15:51
My GPU is NVIDA GTX 1660, and I succeeded in updating my CUDA toolkit to 12.6, as confrimed by nvcc --version
C:\Users\Administrator>nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Sep_12_02:55:00_Pacific_Daylight_Time_2024
Cuda compilation tools, release 12.6, V12.6.77
Build cuda_12.6.r12.6/compiler.34841621_0
Yet in MATLAB 2024a
>> gpuDevice
ans =
CUDADevice with properties:
Name: 'NVIDIA GeForce GTX 1660 Ti'
Index: 1
ComputeCapability: '7.5'
SupportsDouble: 1
GraphicsDriverVersion: '560.94'
DriverModel: 'WDDM'
ToolkitVersion: 12.199999999999999
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152 (49.15 KB)
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.147483647000000e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 6442123264 (6.44 GB)
AvailableMemory: 5378138112 (5.38 GB)
CachePolicy: 'balanced'
MultiprocessorCount: 24
ClockRateKHz: 1770000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceAvailable: 1
DeviceSelected: 1
ToolkitVersion: 12.199999999999999 remains so. Is there anything I can do for MATLAB to recognise and use the latest toolkit? Cheers.

Answers (2)

Joss Knight
Joss Knight on 4 Nov 2024 at 9:13
MATLAB does not use the toolkit that you download, it installs its own version. You cannot change it by downloading the toolkit. What is it you are trying to do?

Walter Roberson
Walter Roberson on 2 Nov 2024 at 16:19
There is a difference between the toolkit version and the nvcc version. The toolkit version is essentially the driver version that is used all the time; the nvcc version is used only when you specifically ask to compile (for example you use mexcuda )
  3 Comments
Theron FARRELL
Theron FARRELL on 5 Nov 2024 at 5:53
Thanks for your demysification, Joss. My status quo is that I am going to generate GPU code for my neural network built and trained in MATLAB 2024a. It will then be integrated into my VC2022IDE to build a C++ executable. Other code in my VC2022 utilises CUDA 12.6 toolkit, hence will I have to change and specify MATLAB's toolkit version via MW_NVCC_PATH to CUDA 12.6 as well? If needed, how to do it? Cheers a lot.
Joss Knight
Joss Knight on 11 Nov 2024 at 15:51
It sounds like you are mixing a GPU Coder code generation strategy with a PCT mexcuda build strategy? That no doubt makes things a bit muddled. Do you actually need to do it this way? Typically, generating code is not necessary within a MATLAB workflow; it is targeted at deployment to an embedded device. Any verification within MATLAB via MEX would typically be done through Coder apps and commands rather than through mexcuda (see for instance https://uk.mathworks.com/help/gpucoder/gs/gpucoder-verification.html)
If you need to use GPU Coder, perhaps because you are enhancing a C++ AI model with your own extensions in C++, then a number of options are available to you. But first - can you not recompile your existing code with CUDA 12.2?
To change your toolkit path to an unsupported version of the toolkit, you need to do some advanced things, so let's try something else first.

Sign in to comment.

Categories

Find more on Get Started with GPU Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!