Setup deep learning environment on Ubuntu 20


1. Install Nvida Driver
Software update

2. Install packages
sudo apt-get update
sudo apt-get upgrade -ysudo apt-get install -y build-essential cmake unzip pkg-config
sudo apt-get install -y libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install -y libxvidcore-dev libx264-dev
sudo apt-get install -y libgtk-3-dev
sudo apt-get install -y libopenblas-dev libatlas-base-dev liblapack-dev gfortran
sudo apt-get install -y libhdf5-serial-dev graphviz
sudo apt-get install -y python3-dev python3-tk python-imaging-tk
sudo apt-get install -y linux-image-generic linux-image-extra-virtual
sudo apt-get install -y linux-source linux-headers-generic

3. check

type the following commands in the terminator:

nvidia-smi

4. Install cuda 11.2

wget https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run
sudo sh cuda_11.2.2_460.32.03_linux.run

Don't select 'install driver'!

Now, you can see the following information on your screen:

===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-11.2/
Samples:  Installed in /home/dd/

Please make sure that
 -   PATH includes /usr/local/cuda-11.2/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-11.2/lib64, or, add /usr/local/cuda-11.2/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.2/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 460.00 is required for CUDA 11.2 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run --silent --driver

Logfile is /var/log/cuda-installer.log
 

5. install cuDNN

remember to setup a Nvdia Account

Download cuDNN v8.1.0 (released on January 26th, 2021), for CUDA 11.0,11.1, and 11.2 from the link above. Then, unzip the embedded folder.

tar -zvxf cudnn-11.2-linux-x64-v8.1.0.77.tgz

6. edit variable environment

open `~/.bashrc`by run the following.

cd ~ 
sudo gedit .bashrc

Add the following at the end of `~/.bashrc`. Note: replace xxx with your own path.

export LD_LIBRARY_PATH=xxx/cuda/lib64:$LD_LIBRARY_PATH

Save the file, and run by the following at the terminal.

source .bashrc

7. copy h files to the target folder

cd xxx/cuda/include
sudo cp *.h /usr/local/cuda/include/
Note: replace xxx with your own path

8. reset the read and write permissions of the cudnn.h file.

sudo chmod a+r /usr/local/cuda/include/cudnn.h

9. To verify the installation, check:

nvcc -V

More details:

https://medium.com/analytics-vidhya/install-cuda-11-2-cudnn-8-1-0-and-python-3-9-on-rtx3090-for-deep-learning-fcf96c95f7a1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值