CUDA seems not to be supported

35 ビュー (過去 30 日間)
Theron FARRELL
Theron FARRELL 2024 年 11 月 2 日
コメント済み: Theron FARRELL 2024 年 12 月 30 日 5:29
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.

回答 (2 件)

Joss Knight
Joss Knight 2024 年 11 月 4 日
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 2024 年 11 月 2 日
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 )
  6 件のコメント
Joss Knight
Joss Knight 2024 年 12 月 1 日
編集済み: Joss Knight 2024 年 12 月 1 日
This is not my area of expertise, so I'm not sure what those files are for. I doubt there's any harm in including them (I doubt they take up much space, and they will be stripped if you are using static linking) or excluding them (you'll get a build error if you need them).
Your libraries built using CUDA 12.2 should work perfectly fine with the rest of your project. The question is whether the other-way-round will work, namely, trying to build an executable mex function using CUDA 12.2 which links against libraries built using CUDA 12.6. I think that will work, as in nvcc won't compain, although there is a small risk of runtime errors because minor versions promise to be backwards compatibly not forwards compatible (they are supposed to be binary compatible across all the 12.x libraries, but there's nothing to stop someone using a new 12.6 API in a library that isn't available at runtime because the version of, say, cublas loaded at runtime is the one MATLAB loads, the 12.2 one, which maybe doesn't have that API). Still, if you're having issues I'd just rebuild the rest of your project using CUDA 12.2.
If you want to change the behaviour of mex you can use mexcuda -v to find your options file, copy it, edit it to remove checks for CUDA 12.2, and then use the -f option to target the modified options file. But this is advanced. And regardless, you do incur some risk forcing libraries built against the CUDA 12.6 runtime to run alongside libraries built with the CUDA 12.2 runtime (i.e. MATLAB's libraries), so if you can just rebuild against 12.2 across the board your life is going to be simpler.
Theron FARRELL
Theron FARRELL 2024 年 12 月 30 日 5:29
Hi Joss, cheers a lot for your expounding everything. which is helpful and nice. Merry X'mas and Have a Happy 2025!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by