とらりもんHOME  Index  Search  Changes  Login

GPU

Install CUDA in Ubuntu 16.04 (2018/06/05, 2019/03/23 K Nasahara)

export PATH=/usr/local/cuda/bin/:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

Then reboot! After that, check the following!

  • lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)
  • nvidia-smi -L
GPU 0: GeForce GTX 650 (UUID: GPU-6fa3b725-060c-0f7c-43e0-08d66033f6b4)

Things to do, after you got graphic board. 2017/12/15 Ishibashi

Check the GPU hardware

$ lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)

Nvidia and CUDA installation.

sudo apt-cache search 'nvidia-[0-9]+$'
↑It shows available nvidia driver versions.
sudo apt-get install nvidia-??? # you choose one driver version.
sudo apt-get install nvidia-387
sudo apt-get install nvidia-387-dev
sudo apt-get install nvidia-modprobe
sudo apt-get install nvidia-opencl-icd-387
sudo apt-get install nvidia-prime
sudo apt-get install nvidia-settings

you can download CUDA installer here.
"runfile" is used in this case below.

./cuda_9.1.85_387.26_linux.run

## Write those sentences below on ".bashrc".
export PATH=/usr/local/cuda-9.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda

sudo apt-get install cuda
sudo apt update
sudo apt upgrade
sudo reboot now

Helpful commands

# GPU model.
nvidia-smi -L
lspci | grep -i nvidia

# Nvidia driver version.
cat /proc/driver/nvidia/version

# CUDA version.
nvcc -V

# Installed packages.
dpkg -l | grep cuda
dpkg -l | grep nvidia

install other packages.

pip install cupy --no-cache-dir -vvvv
# sudo apt install nvidia-cuda-toolkit # This command is somehow destructive.
sudo apt install nvidia-cuda-toolkit

Last modified:2019/03/23 12:15:41
Keyword(s):
References: