Effacer les filtres
Effacer les filtres

Unrecognized function or variable 'nvcc'. with Matlab R2022a

18 vues (au cours des 30 derniers jours)
Felix Wellschmied
Felix Wellschmied le 1 Sep 2022
Commenté : Ayaz ul Hassan le 22 Mar 2024
I am running Matlab R2022a with CUDA 11.2 on Windows (Visual Studio Community 2019). I have a add_kernel.cu file in my folder but fail to compile it:
nvcc -ptx add_kernel.cu
Unrecognized function or variable 'nvcc'.
Matlab seems to recognize my CUDA version:
system('nvcc --version')
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Nov_30_19:15:10_Pacific_Standard_Time_2020
Cuda compilation tools, release 11.2, V11.2.67
Build cuda_11.2.r11.2/compiler.29373293_0
ans =
I have looked around and people suggested to explicitly add the pathes of the ncc file and the VS execution which I already tried:
addpath(genpath('C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64'))
addpath(genpath('C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin'))
I think it is irrelavent but Matlab also finds my GPU:
CUDADevice with properties:
Name: 'NVIDIA GeForce RTX 3060'
Index: 1
ComputeCapability: '8.6'
SupportsDouble: 1
DriverVersion: 11.7000
ToolkitVersion: 11.2000
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 1.2884e+10
AvailableMemory: 1.1646e+10
MultiprocessorCount: 28
ClockRateKHz: 1777000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceAvailable: 1
DeviceSelected: 1
I would be glad about any suggestions.

Réponse acceptée

Raymond Norris
Raymond Norris le 1 Sep 2022
nvcc is a NVIDIA compiler, not a MATLAB function. I suspect what you want is mexcuda.
  7 commentaires
Raymond Norris
Raymond Norris le 21 Mar 2024
@Ayaz ul Hassan Khan please contact MathWorks Technical Support. They'll get this quickly resolved for you.
Ayaz ul Hassan
Ayaz ul Hassan le 22 Mar 2024
Thanks, contacted support. Hope to get quick resolution.

Connectez-vous pour commenter.

Plus de réponses (0)


En savoir plus sur GPU Computing dans Help Center et File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by