天天看點

Centos7.5 添加環境變量并生效

Centos7.5 添加環境變量并生效

配置環境變量

使用者 jiangshan為例

(base) [jiangshan@localhost ~]$ export PATH=$PATH:/usr/local/MATLAB/R2014a/bin/

(base) [jiangshan@localhost ~]$ export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH

(base) [jiangshan@localhost ~]$ source /etc/profile

(base) [jiangshan@localhost ~]$ echo $PATH

/home/jiangshan/anaconda3/bin:/home/jiangshan/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/jiangshan/pycharm/pycharm-community-anaconda-2019.1.3/bin:/home/jiangshan/.local/bin:/home/jiangshan/bin:/usr/local/MATLAB/R2014a/bin/:/home/jiangshan/pycharm/pycharm-community-anaconda-2019.1.3/bin

(base) [jiangshan@localhost ~]$ echo $LD_LIBRARY_PATH

或 配置環境變量

[root@localhost software-tool]# gedit ~/.bashrc

Please make sure that

- PATH includes /usr/local/cuda-10.1/bin

- LD_LIBRARY_PATH includes /usr/local/cuda-10.1/lib64

添加如下:

#gpu driver

export CUDA_HOME=/usr/local/cuda-10.1

export PATH=/usr/local/cuda-10.1/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH

[root@localhost software-tool]# source ~/.bashrc

個人學習記錄