【CUDA】apt install nvidia-cuda-toolkit;Please ask your administrator.

CUDA steps on the pit

View CUDA version

When I want to check the version of CUDA, the following situation suddenly occurs:

insert image description here

This is not because the system does not have CUDA installed, but because the environment does not have it.

Notice:Do not execute apt install nvidia-cuda-toolkitit, or it will reinstall a version.

Solution

Enter the bin directory

  1. First find the bin directory of cuda, for example:/usr/local/cuda/bin
  2. Check if there is nvcc
    insert image description here

add environment variable

$ export PATH=/usr/local/cuda/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

Enter nvcc -Vthe view again to display the version of CUDA
insert image description here

Guess you like

Origin blog.csdn.net/qq_44824148/article/details/122662018