$ sudo apt–get install gcc
$ sudo apt-get install g++
$ sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
$ sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
$ cat /etc/modprobe.d/blacklist-nvidia-nouveau.conf
blacklist nouveau
options nouveau modeset=0
(이렇게 나오면 된거임)
$ sudo update-initramfs -u
$ sudo reboot
CUDA Toolkit 11.3 Downloads link
각 버전에 맞게 설치해주기
$ wget https://developer.download.nvidia.com/compute/cuda/11.3.0/local_installers/cuda_11.3.0_465.19.01_linux.run
$ sudo reboot
reboot 후 로그인 창에서 ctrl+alt+F2 입력한 뒤
Ubuntu tty창으로 넘어가기
$ ubuntu-drivers devices
recommended nvidia-driver version 확인
$ sudo apt install nvidia-driver-470
470 자리에 위에서 확인한 recommended driver version 입력하기
$ sudo sh cuda_11.3.0_465.19.01_linux.run
$ vi ~/.bashrc
$ export PATH=/usr/local/cuda-11.3/bin${PATH:+:${PATH}}
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
$ source ~/.bashrc
설치 확인
$ nvcc -V
$ nvidia-smi