File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 - 删除软连接
1414 ``` shell
1515 cd /usr/local
16- ls -l cuda # 查看cuda的软链接
16+ ls -l cuda # 查看cuda的软链接
1717 sudo rm -rf cuda
1818 sudo ln -s /usr/local/cuda-10.0 /usr/local/cuda # 更换为对应的cuda
1919 ```
2020 - 添加环境变量
2121 ` ` ` shell
22- # 假设你使用的是bash,那么你需要打开.bashrc
23- export PATH=" /usr/local/cuda-10.0/bin:$PATH "
24- export LD_LIBRARY_PATH=" /usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH "
25- export CUDA_HOME=/usr/local/cuda
22+ # 修改`/etc/profile`以做到多用户、多Shell解释器通用
23+ sudo tee -a /etc/profile > /dev/null << 'EOF '
24+ # CUDA
25+ export PATH=${PATH}:/usr/local/cuda/bin
26+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64
27+ export CUDA_HOME=/usr/local/cuda # 通过设置软链接`/usr/local/cuda`,可以做到多版本CUDA共存
28+ EOF
2629 ```
27- 在完成上述步骤后,你需要 source ~ /.bashrc
30+ 在完成上述步骤后,你需要` source /etc/profile`刷新环境变量或者`reboot`重启
You can’t perform that action at this time.
0 commit comments