Linux | 18.10 Install GPU and related software
by Botao Xiao
Linux 18.10 Install GPU and related software
Install Linux with ISO
- Need to provide a UEFI partition and bios area.
- Install the system to the bios area.
- Reserve enough space on ssd.
- Give swap 2 * Ram size.
Set up your Integer net
- Settings -> Internet->IPv4. Choose manual
- setup ip address: 130.113.23.XXX
- set mask: 255.255.0.0
- set Gateway: 130.113.31.5
- set DNS 130.113.184.55
- Apply.
Set up aptitude
sudo apt-get update
Install GPU
Install Driver and CUDA / CUDNN for GPU
- Driver is the communication between hardware and OS, we need to install drive to let OS talk with GPU. We need to install the driver first.
- Download drive from NVIDIA website, select the correct version for the GPU, mine is RTX 2080 tI, here is the link.
- Go to the directory, change the permission of the .run file
sudo chmod 777 NVIDIA-Linux-x86_64–410.57.run # Name might different
- Run the file.
sudo ./NVIDIA-Linux-x86_64–410.57.run
* Continue Installation -> Yes 4. Up to current step, the GPU is visible to OS, we can use command to check the GPU ``` watch -n 1 nvidia-smi # Make sure you have watch and you are using a nvidia gpu. ```
- Once we install the GPU, we can start installing the CUDA for the system. CUDA is the base platform for GPU to do calculations.
- Download cuda from NVIDIA website, I am downloading cuda toolkit 10.1
- Since we are using the Integrated Graphic card on the motherboard, we need to add a blacklist to get rid of the effection.
- Create a file called “blacklist-nouveau.conf” and write:
blacklist nouveau options nouveau modeset=0
- Create a file called “blacklist-nouveau.conf” and write:
- Add the conf file to system Configure
sudo cp (path to your conf)/blacklist-nouveau.conf /etc/modprobe.d
- Make the conf file effective
sudo update-initramfs -u
- Remove all cuda installed before
sudo apt-get purge nvidia-cuda*
- Logout from GUI, and use “ALT + CTRL + F3” to open a new linux tty, type your user name and password to login.
- Go to the directory of the CUDA and run it with
sudo sh cuda_10.0.130_410.48_linux.run # Name may differ.
- Select all option and start installation.
- Remove all cuda installed before
- Before going back to GUI, add the path to global
sudo vim ~/.bashrc export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}} # add export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} # Add source ~/.bashrc #activate bashrc file
- After installation, you can use “ALT + ->” to go back to login GUI.
- If you meet a infinite loop when login with correct password after installation of CUDA problem(Optional)
sudo rm -f /etc/modprobe.d/blacklist-nouveau.conf sudo update-initramfs -u sudo X -configure sudp cp (path to the file)/xorg.conf.new /etc/X11/xorg.conf # Give a new configure file for DirectX11, which is a new one with cuda. init 5
- Intall cudnn. CUDNN is a toolkit for stupid deep learning.
- Download your cudnn from nvidia and select the correct version.
- Copy and paste the key files ``` tar -xf cudnn-10.0-linux-x64-v7.3.1.20.tgz
sudo cp -R cuda/include/* /usr/local/cuda-10.0/include
sudo cp -R cuda/lib64/* /usr/local/cuda-10.0/lib64 ```
Install Anaconda
- Download the anaconda from its website and extract it.
- Add anaconda to global environment
vim ~/.bashrc export PATH="<path to anaconda>bin:$PATH"
- Create your working environment:
conda create -n tensorflow python=3.7
- Now you can play with your anaconda.
Reference
Subscribe via RSS