我按照此说明配置 Cuda,但这一步我尝试编写这些行
To configure the CUDA environment for all users (and applications) on your system create the file (use sudo and a text editor of your choice)
/etc/profile.d/cuda.sh
with the following content,
export PATH=$PATH:/usr/local/cuda/bin
export CUDADIR=/usr/local/cuda
但得到了"/etc/profile.d/cuda.sh" is a directory
我尝试运行 Cuda 示例并得到了
Error: target directory missing
Usage: cuda-install-samples-11.1.sh <target directory>
Will append NVIDIA_CUDA-11.1_Samples to <target directory>
我试图在 bashrc 中编写以下内容
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64
PATH=${CUDA_HOME}/bin:${PATH}
export PATH
编辑
我尝试使用此命令运行示例来测试 cuda
./cuda-install-samples-11.1.sh
但得到了
Error: target directory missing
Usage: cuda-install-samples-11.1.sh <target directory>
Will append NVIDIA_CUDA-11.1_Samples to <target directory>
编辑 2
我试图运行这个命令
./cuda-install-samples-11.1.sh /home/user/NVIDIA_CUDA-11.1_Samples
但得到了
bash: ./cuda-install-samples-11.1.sh: No such file or directory