当前位置:网站首页>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
边栏推荐
- 云原生安全指南: 从零开始学 Kubernetes 攻防
- SQL reported an unusual error, which confused the new interns
- [help] troubleshooting of JVM's high CPU resource consumption
- Redis cluster Series III
- 【STL编程】【竞赛常用】【part 1】
- (LC)46. Full Permutation
- As a software engineer, give advice to young people (Part 2)
- 通过 Cargo 管理 Rust 项目
- 安全才是硬道理,沃尔沃XC40 RECHARGE
- Safety is the last word, Volvo xc40 recharge
猜你喜欢

MySQL beginner benefits

muduo

At 19:00 on Tuesday evening, the 8th live broadcast of battle code Pioneer - how to participate in openharmony's open source contribution in multiple directions

SQL Server - window function - solve the problem of filtering consecutive n records

数据库日志

OpenSSL client programming: SSL session failure caused by an obscure function
![[login interface]](/img/72/d527a5de23aa9da108e405eb6bb39c.png)
[login interface]

Data intelligence enters the "deep water area", and data governance is the key

Connection integration development theme month | drivers of enterprise master data governance

UE4:Build Configuration和Config的解释
随机推荐
Database lock problem
[help] troubleshooting of JVM's high CPU resource consumption
数智化进入“深水区”,数据治理是关键
Longitude and latitude analysis
智联招聘的基于 Nebula Graph 的推荐实践分享
pfSense Plus22.01中文定制版发布
Wechat IOS version 8.0.24 update release cache subdivision cleaning Online
Binary tree related problems 2
蓄力中台,用友iuap筑牢社会级企业数智化新底座
数仓的字符截取三胞胎:substrb、substr、substring
键入网址到网页显示,期间发生了什么?
探秘GaussDB,听听客户和伙伴怎么说
移动低代码开发专题月 | 可视化开发 一键生成专业级源码
Grasp the detailed procedure of function call stack from instruction reading
Yyds dry goods counting SQL sub query
Linux system plays Oracle database multi table query connection query with a smile
Observable, reliable: the first shot of cloudops series Salon of cloud automation operation and maintenance
Database optimization
微信iOS版8.0.24更新发布 缓存细分清理上线
redis数据结构