File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 13
13
- 删除软连接
14
14
``` shell
15
15
cd /usr/local
16
- ls -l cuda # 查看cuda的软链接
16
+ ls -l cuda # 查看cuda的软链接
17
17
sudo rm -rf cuda
18
18
sudo ln -s /usr/local/cuda-10.0 /usr/local/cuda # 更换为对应的cuda
19
19
```
20
20
- 添加环境变量
21
21
` ` ` 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
26
29
```
27
- 在完成上述步骤后,你需要 source ~ /.bashrc
30
+ 在完成上述步骤后,你需要` source /etc/profile`刷新环境变量或者`reboot`重启
You can’t perform that action at this time.
0 commit comments