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