我按照这个指令来配置库达,但是这个步骤我试着写行
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
Will append NVIDIA_CUDA-11.1_Samples to 我试图用bashrc编写以下内容
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64
PATH=${CUDA_HOME}/bin:${PATH}
export PATH 编辑
我尝试使用以下命令运行一个示例来测试库达。
./cuda-install-samples-11.1.sh但得到
Error: target directory missing
Usage: cuda-install-samples-11.1.sh
Will append NVIDIA_CUDA-11.1_Samples to <#>Edit 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
发布于 2020-11-01 01:50:10
目录/etc/profile.d/cuda.sh应该是一个文件,所以首先删除目录but,删除目录时要非常小心:
sudo rm -Rf /etc/profile.d/cuda.sh将以下内容添加到~/.profile的底部(每个用户),或者将其添加到名为/etc/profile.d/cuda.sh (全局)的文件中,然后重新启动系统:
# set PATH for cuda 11.1 installation
if [ -d "/usr/local/cuda-11.1/bin/" ]; then
export PATH=/usr/local/cuda-11.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
fi然后,对于cuda-install-samples-11.1.sh 命令,当您使用.run文件或.deb文件安装时,它默认为~/NVIDIA_CUDA-11.1_Samples,因此按以下方式运行该命令:
./cuda-install-samples-11.1.sh ~/NVIDIA_CUDA-11.1_Samples或在运行上述命令之前,请通过运行以下命令确保它是可执行的:
chmod +x cuda-install-samples-11.1.shhttps://askubuntu.com/questions/1288645
复制相似问题