Deep learning environment Ubuntu install a full --NVIDIA drive, Cuda ,, cudnn, Anconda, Pycharm, Tensorrt installation

Last weekend some reason inexplicable reinstall the system, fiddle once again the depth of the learning environment a full installation ~ ~
vomiting ~ ~ make a note for next time to continue to have to reinstall the system installed. . . . .

The installation of all the Ubuntu16.04 based system, the installation environment is good
nvidia-410, Cuda10.0.130, cudnn7.6.5, Anconda5.1 (Python3.6.4), Tensorrt7.0.0.11.

Install NVIDIA drivers

Clean uninstall all of the installed nvidia driver

sudo apt-get remove --purge nvidia-*

Execute the following command to add a drive source

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update

Ctrl + Alt + F1 to switch execution tty1

sudo service lightdm stop
sudo apt-get install nvidia-410 nvidia-settings nvidia-prime
sudo nvidia-xconfig
sudo update-initramfs -u
sudo reboot

Above sudo apt-get install nvidia-410 nvidia-settings nvidia-primethis statement represents the nvidia driver version I installed the 410 (cuda10.0 need nvidia-410more drivers, video drivers, and the correspondence between cuda version please Baidu), it will take a very long time and, I hung up one night to go installed. . . Look speed of luck now. . .

Installation CUDA10.0

Click cuda official website download link
to download the corresponding version of the deb installation package, the installation instructions to install.
cd installation package to cuda path, execute:

sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda

Above, to complete the installation cuda10.0

Installation cudnn7.6.5

Click on the official website download link to download the corresponding tar package,
cd to the following cuda tar package, extract the tar package,
execute:

sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

then

gedit ~/.bashrc

Add the following to the last position

export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda

Above, complete cudnn installation.
Cuda and cudnn test whether the installation was successful as follows:

# 查看cudnn版本
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
# 查看cuda版本
cat  /usr/local/cuda/version.txt

Anaconda installation

Too simple to ignore. . .

Installation Pycharm

Download Pycharm tar package , extract,

Add a shortcut method
first:

sudo gedit /usr/share/applications/pycharm.desktop

Second: Adding content in it

[Desktop Entry]
Type=Application
Name=Pycharm
GenericName=Pycharm3
Comment=Pycharm3:The Python IDE
Exec="/home/delian/tools/pycharm-community-2019.3.1/bin/pycharm.sh" %f
Icon=/home/delian/tools/pycharm-community-2019.3.1/bin/pycharm.png
Terminal=pycharm
Categories=Pycharm;

Attention Execand Iconthe path
to add executable permissions:

sudo chmod +x /usr/share/applications/pycharm.desktop

OK!

Installation Tensorrt

  1. Download tensorrt installation package (deb)
  2. Follow the installation instructions
  3. Installation pycuda

Terminal execute:
Source of an activate Python environment

pip install 'pycuda>=2019.1.1' 
Published 29 original articles · won praise 12 · views 10000 +

Guess you like

Origin blog.csdn.net/c2250645962/article/details/103889843