Skip to content

Commit 5df3cfb

Browse files
committed
📝 doc(cuda.md): update cmd
1 parent 0ca4921 commit 5df3cfb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/ai/cuda.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919
```
2020
- 添加环境变量
2121
```shell
22+
# 如果使用的是z-shell请替换`.bashrc`为`.zshrc`
23+
tee -a ~/.bashrc > /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
29+
30+
# 或者
31+
2232
# 修改`/etc/profile`以做到多用户、多Shell解释器通用
2333
sudo tee -a /etc/profile > /dev/null << 'EOF'
2434
# CUDA
@@ -27,4 +37,4 @@
2737
export CUDA_HOME=/usr/local/cuda # 通过设置软链接`/usr/local/cuda`,可以做到多版本CUDA共存
2838
EOF
2939
```
30-
在完成上述步骤后,你需要`source /etc/profile`刷新环境变量或者`reboot`重启
40+
在完成上述步骤后,你需要`source ~/.bashrc`(或`source /etc/profile`)刷新环境变量或者`reboot`重启

0 commit comments

Comments
 (0)