How to install NVIDIA driver on Ubuntu 18.04 (Note)

To install the GeForce driver (NVIDIA Driver on Ubuntu) or the CUDA Toolkit (including the NVIDIA driver) downloaded from NVIDIA from the run file, first unload the kernel module [nvidia-drm]. I asked to stop Xserver and got an error and could not install the required NVIDIA Driver. As an example, I will write down the installation procedure of NVIDIA CUDA (by default, the NVIDIA Driver is automatically installed) as a memorandum.

If you install the GeForce driver (NVIDIA Driver on Ubuntu) alone, not from the CUDA Toolkit, the following page will be very helpful.

** [Story of installing NVIDIA driver in UEFI secure boot machine] **


OS : Ubuntu 18.04 CUDA version: 11.2 CUDA file name (*): cuda_11.2.0_460.27.04_linux.run

(*) File naming convention: cuda _ [CUDA version] _ [NVIDIA driver version] _ [OS type] .run


Step 1: Download the CUDA Toolkit from NVIDIA Site.

Here, the procedure is written assuming that it has been downloaded to the ~/Downloads/directory.


Step 2: Preparations for booting in CUI (multi-user) mode 1

** If you fail to set it, the login screen may not be displayed, so please set it carefully. **

bash


$ cd /lib/systemd/system
$ sudo unlink default.target
$ sudo ln -s multi-user.target default.target

Step 3: Preparations for booting in CUI (multi-user) mode 2

bash


$ ls -l
(OK if it looks like ↓)
lrwxrwxrwx 1 root root 16 January 3 01:46 default.target -> multi-user.target

Step 4: Reboot

bash


$ reboot

If all goes well, it will start in CUI mode, so enter your user name and password to log in.


Step 5: Install CUDA Toolkit

bash


$ cd ~/Downloads
$ sudo sh cuda_11.2.0_460.27.04_linux.run

The installation screen is displayed in a menu format, so it will be omitted. (There are also options, so select as needed)

By the way, the screen may appear to freeze during installation, but due to the large file size of Toolkit, it just takes a long time to process. If you leave it alone, the process will usually be completed.


Step 6: Preparations for starting in GUI mode 1

** If you fail to set it, the login screen may not be displayed, so please set it carefully. **

bash


$ cd /lib/systemd/system
$ sudo unlink default.target
$ sudo ln -s graphical.target default.target

Step 7: Preparation for starting in GUI mode 2

bash


$ ls -l
(OK if it looks like ↓)
lrwxrwxrwx 1 root root 16 January 3 01:46 default.target -> graphical.target

Step 8: Reboot

bash


$ reboot

Step 9: Pass the path of CUDA Toolkit

The installation completion screen tells you to pass the path to the following two directories. /usr/local/cuda-11.2/lib64 /usr/local/cuda-11.2/bin

It is specified to write cuda-11.2 in the directory, but since a symbolic link called cuda is created in the cuda-11.2 directory, ~/.bashrc like the following export statement You can write it in a file.

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

Finally, reload .bashrc with the source command and you're done.

bash


$ source ~/.bashrc

It's my memorandum, so I've only written it roughly, but some people may have given up on installing the NVIDIA Driver or CUDA Toolkit without knowing this procedure, so I hope it helps.


Referenced site To disable GUI login on CentOS7, Ubuntu 18.04 Story of putting NVIDIA driver in UEFI secure boot machine

Recommended Posts

How to install NVIDIA driver on Ubuntu 18.04 (Note)
How to install WildFly on Ubuntu 18.04
How to install production Metabase on Ubuntu
Install Realtek network driver on Ubuntu Note
How to install network drivers on standalone Ubuntu
How to install multiple JDKs on Ubuntu 18.04 LTS
Note: Install PostgreSQL 9.5 on Ubuntu 18.04
How to install ImageMagick on Windows 10
How to use Bio-Formats on Ubuntu 20.04
How to install MariaDB 10.4 on CentOS 8
How to build vim on Ubuntu 20.04
How to Install Elixir and Phoenix Framework on Ubuntu 20.04 LTS
How to install java9 on elementaryOS Freya or Ubuntu 14.04 LTS
How to install Eclipse (Photon) on Mac
I want to install PHP 7.2 on Ubuntu 20.04.
How to install beta php8.0 on CentOS8
How to change the timezone on Ubuntu
How to install kafkacat on Amazon Linux2
How to install and use Composer on an ECS instance on Ubuntu 16.04
How to install and configure the monitoring tool "Graphite" on Ubuntu
How to install Adopt OpenJDK on Debian, Ubuntu with apt (-get)
How to configure ubuntu to be used on GCP
How to install c2ffi on Ubuntu, which automatically parses C header files
Install pyqt5 on ubuntu
Install Ruby on Ubuntu 20.04
How to install Docker
How to install docker-machine
Note how to rollback Mysql deployed on Heroku
Install Autoware on Ubuntu 18.04.5
How to Install Oracle JDK 1.8 in Ubuntu 18.04 LTS?
How to install MySQL
Install Homebrew on Ubuntu 20.04
[Ruby on Rails] How to install Bootstrap in Rails
How to build a Pytorch environment on Ubuntu
How to run NullpoMino 7.5.0 on Ubuntu 20.04.1 64bit version
How to install ngrok
Load Suica on Ubuntu + Identiv Cloud 3701 F (preliminary note 3)
Load Suica on Ubuntu + Identiv Cloud 3701 F (preliminary note 2)
Note: Install PostgreSQL 9.5 on Ubuntu 18.04
Install Realtek network driver on Ubuntu Note
How to install NVIDIA driver on Ubuntu 18.04 (Note)
How to install Ruby on an EC2 instance on AWS
Install MySQL 5.6 on CentOS6 [How to specify the version]
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Cybozu Office 10 on Ubuntu 20.4
Install Docker on Ubuntu Server 20.04
[Rails] How to install devise
How to deploy on heroku
Install zabbix agent (5.0) on Ubuntu 18.04
Install MAV Proxy on Ubuntu 18.04
Install Arudino IDE on Ubuntu 20
Install Java on WSL Ubuntu 18.04
How to install Boots Faces
Install Ubuntu Desktop 20.10 on RaspberryPi4
[Note] How to write Dockerfile/docker-compose.yml
Install Arduino IDE on Ubuntu 20.04
Install raspi-config on Ubuntu 20.04 (LTS)
Install WordPress 5.5 on Ubuntu 20.04 LTS
Install PlantUML on Intellij on Ubuntu
Install Ubuntu Server 20.04 on Btrfs
[Rails] How to install simple_calendar
[Rails] How to install reCAPTCHA
How to install JDK8-10 (Mac)
How to add HDD to Ubuntu
[Note] Flow from docker installation to JupyterLab startup on ubuntu