NVIDIA驱动,CUDA,CONDA环境安装
NVIDIA驱动安装
- 检查驱动信息
last reboot
uname -r
cat /var/log/apt/history.log
nvidia-smi
ll /usr/src/
lsmod |grep nvidia
lspci |grep -i nvidia
dmesg -i |grep nvidia
dmesg |grep -i nvidia
dmesg |grep -i nvrm
dpkg --get-selections | grep linux-image
- 查看加载内核版本
zgrep -ai BOOT_IMAGE /var/log/syslog*
cat /boot/grub/grub.cfg |grep 4.15
cat /etc/default/grub
- 卸载NVIDIA驱动
sudo apt-get --purge remove nvidia*
- 卸载cuda
./usr/local/cuda/bin/cuda-uninstaller
- 安装NVIDIA及CUDA
apt-get update
sudo apt-get install nvidia-driver-470
wget https://developer.download.nvidia.com/compute/cuda/11.4.4/local_installers/cuda_11.4.4_470.82.01_linux.run
chmod +x cuda_11.4.4_470.82.01_linux.run
./cuda_11.4.4_470.82.01_linux.run --toolkit --samples --silent
nvidia-smi -pm 1
nvidia-smi
/usr/local/cuda/bin/nvcc -V
环境变量
export PATH=/usr/local/cuda-11.4/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
CONDA环境安装
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2022.05-Linux-x86_64.sh
bash Anaconda3-2022.05-Linux-x86_64.sh
conda env create -f deep3d_env.yaml
conda env list
conda config --show-sources
conda config --remove channels https://anaconda.org/brown-data-science/gcc/5.4.0/download
conda config --add channels https://mirror.sjtu.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirror.sjtu.edu.cn/anaconda/pkgs/main
conda config --add channels defaults
环境变量设置
vim /root/.bashrc
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/data/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/data/anaconda3/etc/profile.d/conda.sh" ]; then
. "/data/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/data/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
如对您有帮助,支持下呗!
微信
支付宝