How to set up CUDA and cuDNN to resolve "Compatible GPU" errors when using "coder.checkGpuInstall" in MATLAB R2023a?

I am trying to generate code with GPU Coder R2023a. I am using an NVIDIA RTX 3080TI graphics card with NVIDIA Driver Version v520.56.06, CUDA Version v11.8, and cuDNN Version v8.7.
 
I performed the following setup steps:
1) Set up the environmental variables:
>> setenv("NVIDIA_CUDNN","/usr/local/cuda");
>> setenv("LD_LIBRARY_PATH","/usr/local/cuda");
2) Execute the code:
>> envCfg = coder.gpuEnvConfig('host');
>> envCfg.DeepLibTarget = 'cudnn';
>> envCfg.DeepCodegen = 1;
>> envCfg.Quiet = 1;
>> coder.checkGpuInstall(envCfg);
The following error is returned by "coder.checkGpuInstall":
"Compatible GPU: (There is a problem with the graphics drive or with this GPU. Be sure that you have a supported GPU and latest driver. Code execution will not be available.)"
How can I fix this issue?

 Respuesta aceptada

The error is caused by an incorrect configuration of the CUDA environment. The “LD_LIBRARY_PATH” environmental variable was set as:
>> setenv("LD_LIBRARY_PATH","/usr/local/cuda");
However, according to the documentation, “LD_LIBRARY_PATH” needs to point to the CUDA library folder. The "/usr/local/cuda" folder may be its parent folder, which contains the library folder, header include folder, the bin folder, etc. To set the environment variable to the library folder, try the following command:
>> setenv("LD_LIBRARY_PATH","/usr/local/cuda/lib64");
To validate whether the path points to the correct library folder, check if the folder contains the library files such as “libcudart.so”, “libcufft.so”, “libsucolver.so”, and “libcublas.so”.
For more information on setting up the prerequisite product for GPU Coder, please refer to the GPU Coder documentation.

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

R2023a

Preguntada:

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

Editada:

el 9 de Abr. de 2026 a las 9:42

Community Treasure Hunt

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

Start Hunting!

Translated by