ubuntu18.04 installation and CUDA installation
ubuntu18.04 official link 64 -bit
Rufus official download
1 1 1 1 1 1 1 1, extraction code: ico2
1. Run Rufus
2. Select the U disk (device), select the mirror file (guide type selection), and the rest default. Then click to start and make the production.
- The shortcut key to enter the BIOS varies from machines, and carefully observes the launch interface of the machine.
- The highest priority is adjusted to USB. If there are several options with USB, try it all, as long as you enter the following interface.
1. Select Chinese (simplified) above, and then click Ubuntu
2. Keyboard layout, don’t care, click on
3. Continue
4. Create the first account, you can write it casually. If it says that this name has been used, then unplug the network cable, then write, and then insert the network cable.
5.Key steps
- The first option is equivalent to the existing operating system (it can be WIN10, or ubuntu16.04), and then install Ubuntu18.04
- The second option is equivalent to installing dual systems
- The third option has not been ordered, it should be to remove all the data on the machine, and then install Ubuntu
6. Continue
7. Wait for the installation to complete, and pull out the U disk startup at the prompt
- Update system
sudo apt-get update
sudo apt-get upgrade
- Set the root password, it is useful at the critical moment
sudo passwd
- Install VIM text editor, it is useful at critical moments
sudo apt-get install vim
- Installation driver, especially graphics card driver. Just this order is OK.
sudo ubuntu-drivers autoinstall
At this time, running the following command should be seen
nvidia-smi
It should be seen,
Fri Jan 1 22:04:39 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.38 Driver Version: 455.38 CUDA Version: 11.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce GTX 108... Off | 00000000:01:00.0 Off | N/A |
| 22% 38C P8 10W / 250W | 121MiB / 11177MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 1 GeForce GTX 108... Off | 00000000:02:00.0 Off | N/A |
| 21% 30C P8 9W / 250W | 11MiB / 11178MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1286 G /usr/lib/xorg/Xorg 14MiB |
| 0 N/A N/A 1562 G /usr/bin/gnome-shell 14MiB |
| 0 N/A N/A 20063 G /usr/lib/xorg/Xorg 65MiB |
| 0 N/A N/A 20185 G /usr/bin/gnome-shell 21MiB |
| 1 N/A N/A 1286 G /usr/lib/xorg/Xorg 4MiB |
| 1 N/A N/A 1562 G /usr/bin/gnome-shell 0MiB |
| 1 N/A N/A 20063 G /usr/lib/xorg/Xorg 4MiB |
| 1 N/A N/A 20185 G /usr/bin/gnome-shell 0MiB |
+-----------------------------------------------------------------------------+
can try again
watch -n 1 nvidia-smi
-
According tonvidia official, choose the right CUDA (will automatically help you choose)
For example, he recommended me to install CUDA11.1. There is no need to be too tangled with CUDA, especially for students who use Anaconda to manage the Python environment. If you use anoconda to manage the Python environment, it is okay not to install CUDA, because it will automatically install the corresponding version of the CUDATOOLKIT when you need the library (such as TensorFlow-GPU).Run the command he gives.
wget https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda_11.1.0_455.23.05_linux.run
sudo sh cuda_11.1.0_455.23.05_linux.run
- can also be based onCUDA Toolkit Archive, choose the CUDA version that suits you yourself
1. Select Continue
2. Enter Accept
3. Select the file to be installed, because the driver has been installed just now, so remove the × in front of Driver and not install it. It can also be seen that the CUDATOOLKIT installed by Anaconda is part of CUDA. Then instant
4. Seeing this interface is finished
5. Set environment variables
- Open the environment variable
sudo gedit ~/.bashrc
- At the end of .bashrc
export PATH=/usr/local/cuda-10.2/bin${PATH:+:$PATH}}
export CUDA_HOME=/usr/local/cuda-10.2
- Moving the modified environment variables
source ~/.bashrc
- Run NVCC -V, View CUDA version
nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:24:38_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89
Installation is successful!