Why do I receive the error "Unable to find the 'CUDA_PATH' environment variable" when using the GPU Coder function "coder.checkGpuInstall"?

I followed all instructions in the following documentation pages in order.
I also restarted my Windows 10 OS in order to be able to start using the new environment variables which I had set with the above instructions.
However I get the following errors when using "coder.checkGpuInstall":
CUDA Environment : FAILED (Unable to find the 'CUDA_PATH' environment variable. Set 'CUDA_PATH' to point to the root directory of an installed CUDA SDK.)
cuDNN Environment : FAILED (Unable to find the 'NVIDIA_CUDNN' environment variable. Set 'NVIDIA_CUDNN' to point to the root directory of a NVIDIA cuDNN installation.)
Why are these errors appearing, and how can I avoid them?

 Respuesta aceptada

GPU Coder uses environment variables to locate the necessary tools, compilers, and libraries required for code generation. If you have a non-standard installation of the required third-party products, ensure that the required environment variables are set. 
Based on the reported error message, it is expected that the empty result will be confirmed when checking the environment variable setting with the following command:
>> getenv('CUDA_PATH')
>> getenv('NVIDIA_CUDNN')
Please register and check using the setenv command in MATLAB as in the example command below.
>> setenv('CUDA_PATH','C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2')
>> setenv('NVIDIA_CUDNN','C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\cuDNN')
Note: For CUDNN installation, refer to the NVIDIA install instructions and check whether it is installed properly. Please refer to the GPU Coder toolchain setup documentation to set "NVIDIA_CUDNN" to point to the root directory of a NVIDIA cuDNN installation.

Más respuestas (0)

Categorías

Más información sobre Get Started with GPU Coder en Centro de ayuda y File Exchange.

Productos

Versión

R2019b

Preguntada:

el 8 de Abr. de 2026 a las 0:00

Respondida:

el 8 de Abr. de 2026 a las 17:27

Community Treasure Hunt

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

Start Hunting!

Translated by