当前位置:网站首页>NVIDIA three piece environment configuration
NVIDIA three piece environment configuration
2022-06-27 20:30:00 【51CTO】
For the environment of deep learning , We need to straighten out the relationship between .
Like PyTorch frame , The higher the version , The higher the demand for graphics card computing power , The computing power of the graphics card is up ,CUDA The version of should also follow up ,CUDA The version goes up , The driver version should also keep up with ...
Personally, I usually follow the driver of higher version + Low version of the CUDA+ And CUDA Corresponding cudnn+ And CUDA Corresponding PyTorch Configure the environment in this order .
CUDA Correspondence with the drive
But there will be metaphysical problems , Self exploration !
Multi Baidu , Will be solved .
drive
Encounter problems that can't be solved , The easiest way is to clean it all up , Restarting . If the new computer is configured for the first time, you can skip the clearing operation .
# uninstall CUDA, Correspond to your version number
sudo /usr/local/cuda-11.1/bin/cuda-uninstaller
sudo rm -rf /usr/local/cuda-11.1/
# Unload the drive
sudo /usr/bin/nvidia-uninstall
sudo apt-get --purge remove nvidia*
sudo apt-get purge nvidia*
sudo apt-get purge libnvidia*
sudo apt-get autoremove
# Make sure nothing is output
sudo dpkg --list | grep mvidia*
# Make sure the open source driver is disabled nouveau, Theoretically normal installation NVIDIA The official driver will be automatically disabled
lsmod | grep nouveau
# No output means that the disabling is successful
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
Actually CUDA Will bring its own drive , But usually the driver is installed first , Then go install CUDA, In the installation CUDA Cancel the installation in the process of CUDA Built in drive .
Of course, it can also be directly driven and CUDA With the installation
# Download the corresponding driver for your card
Download address :https://www.nvidia.cn/Download/index.aspx ?lang =cn
# After downloading, go to the directory where the file is located , It's a run Postfix file , Plus Execution Authority
sudo chmod a +x NVIDIA-Linux-x86_64-470.82.00.run
sudo ./NVIDIA-Linux-x86_64-470.82.00.run
# After that, restart
sudo reboot
# Test it , See if you output information
nvidia-smi
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
CUDA
# download CUDA, download run file , Don't deb file ,deb The file will replace the installed driver during installation
Download address :https://developer.nvidia.com/cuda-toolkit-archive
# After downloading, go to the directory where the file is located , It's a run Postfix file , Plus Execution Authority
sudo chmod a +x cuda_11.1.0_455.23.05_linux.run
sudo ./cuda_11.1.0_455.23.05_linux.run
# If the driver has been installed , Remember to install CUDA Cancel the installation of the driver
# Check the environment variables after the installation , Theoretically, it will automatically add... At the end
sudo vim ~/.bashrc
# without , Remember to add , Corresponding to good version
export PATH =/usr/local/cuda-11.0/bin ${PATH:+: ${PATH} }
export LD_LIBRARY_PATH =/usr/local/cuda-11.0/lib64 ${LD_LIBRARY_PATH:+: ${LD_LIBRARY_PATH} }
# Update environment variables
source ~/.bashrc
# Test version
nvcc -V
# Compile and test the device deviceQuery:
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
# Compile and test bandwidth bandwidthTest:
cd ../bandwidthTest
sudo make
./bandwidthTest
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
cudnn
# After decompressing , File replacement
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
# Change permissions
sudo chmod a +r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
# install deb package
sudo dpkg -i libcudnn8_8.0.5.39-1 +cuda11.0_amd64.deb
sudo dpkg -i libcudnn8-dev_8.0.5.39-1 +cuda11.0_amd64.deb
sudo dpkg -i libcudnn8-samples_8.0.5.39-1 +cuda11.0_amd64.deb
# Test after completion
cd /usr/src/cudnn_samples_v8/mnistCUDNN
sudo make
./mnistCUDNN
# Pictured , success
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
Problem summary
function sudo dpkg --list | grep mvidia* And the output
NVIDIA's related packages have not been deleted yet , Compare the output of the remaining packages , Delete one by one .
function lsmod | grep nouveau There is no output , But also prompt to disable
Theoretically, the driver will disable itself nouveau Open source driver , But the metaphysics problem , You'll see .
Ps: The screen may be blank after the driver is installed again after the update , Wait a moment . Then force the restart .
If you cannot access the graphical interface ,Ctrl+Alt+F1 Switch to character interface ,Ctrl+Alt+F7 Switch to the GUI
Tip the lack of gcc g++ make Such as package
Just install one by one , Common in new systems .
It is recommended to install after installation build-essential Dependency package sudo apt-get install build-essential
边栏推荐
- Safety is the last word, Volvo xc40 recharge
- 微信iOS版8.0.24更新发布 缓存细分清理上线
- Logcli Loki command line tool
- Grasp the detailed procedure of function call stack from instruction reading
- 优维HyperInsight:掘金164.94亿美元可观测市场的“金锄头”?
- 谈谈我写作生涯的画图技巧
- Practice of combining rook CEPH and rainbow, a cloud native storage solution
- UE4:Build Configuration和Config的解释
- [required reading for high-quality products] sub query of Oracle database in Linux system
- Database log
猜你喜欢
随机推荐
Data intelligence enters the "deep water area", and data governance is the key
UE4 actor Basics
As a software engineer, give advice to young people (Part 2)
ABAP随笔-面试回忆 望大家 需求不增 人天飙升
谈谈我写作生涯的画图技巧
1028 List Sorting
BLE蓝牙模块NRF518/NRF281/NRF528/NRF284芯片方案对比
字典树(复习)
Source code analysis of golang map concurrent read / write problem
Record a failure caused by a custom redis distributed lock
通过 Cargo 管理 Rust 项目
Rust 所有权进阶 -- 内存管理
连接集成开发专题月 | 企业主数据治理的驱动因素
Massive data attended the Lanzhou opengauss meetup (ECOLOGICAL NATIONAL trip) activity, enabling users to upgrade their applications with enterprise level databases
云原生安全指南: 从零开始学 Kubernetes 攻防
ABAP随笔-通过api获取新冠数据
DBeaver恢复和备份数据库的方式
Linux系统ORACLE 19C OEM监控管理
Golang map 并发读写问题源码分析
Univision hyperinsight: Nuggets' $16.494 billion "gold hoe" in the observable market?