とらりもんHOME  Index  Search  Changes  Login

GPU

$ lspci | grep -i nvidia でGPUの型番が出てこない時:

nishida@tochinoki:~$ lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1e81 (rev a1)
01:00.1 Audio device: NVIDIA Corporation Device 10f8 (rev a1)
01:00.2 USB controller: NVIDIA Corporation Device 1ad8 (rev a1)
01:00.3 Serial bus controller [0c80]: NVIDIA Corporation Device 1ad9 (rev a1)
# 解決策:
nishida@tochinoki:~$ sudo update-pciids
Downloaded daily snapshot dated 2020-02-10 03:15:02
nishida@tochinoki:~$ lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation TU104 [GeForce RTX 2080 SUPER] (rev a1)
01:00.1 Audio device: NVIDIA Corporation TU104 HD Audio Controller (rev a1)
01:00.2 USB controller: NVIDIA Corporation TU104 USB 3.1 Host Controller (rev a1)
01:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU104 USB Type-C UCSI Controller (rev a1)

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
lspci | grep -i nvidia

# watch GPU working
watch -n1 "nvidia-smi"
# 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:2020/02/11 18:04:09
Keyword(s):
References: