How to install Ubuntu20.04 and install NVIDIA driver

Install Ubuntu 20.04 Install NVIDIA driver to configure Pytouch and tensorflow environment

Native environment: Dell G3 3579
win10, the system is on 128 solid state drives

Install Ubuntu20.04

1 Boot and press F2 to enter BIOS
2 security boot set disable
3 reference
https://www.zalou.cn/article/173277.htm

Install NVIDIA driver

First install the driver, first prohibit nouveau
Then uninstall the original nvidia driver (if any)
reference:
https://www.zalou.cn/article/171959.htm
But this happens after installation
nvidia-smi has output, nvidia-settings has reflection, and shortcut icons are also generated
But after the restart takes effect, in Settings -> About: the graphics card has changed from the original integrated graphics card 630 to lvib or something
Although it does not affect the establishment of the approved learning environment, it always feels that it will hang in the future
In another case, after installing the driver, go to Settings->About: The graphics card displays GTX1060. But every time it is turned on or off, it shows: dev/sda5 clean…
dev/sda6 clean. After 2s, turn off the machine, the same is true for the startup.
Another situation is that the environment is set up, and the drivers are good, but a command, when installing NetEase Yunyue, what dependencies should be made, and then a command
Go, dev/sda6 clean flashes infinitely after booting. ctro-alt-f1 can open the tty, but the user name and password are too late to enter, and the tty flashes back and it takes less than 1s. Then can not enter the system.
Finally reinstall the system
right now:
After installing the ubuntu system, do not update anything, and do not ban nouveau. The first thing is to install the driver directly,

After restarting, nothing happened.

Build pytouch

Install miniconda3,
Replaced by China University of Science and Technology, Tsinghua Yuan
conda create -n pytouch python=3.7
conda activate pytouch
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda install pytorch=0.4.1 torchvision cuda90

Install pycharm

Click tools->create desktop entry to directly generate shortcut keys
Set the compiler to pytouch
Fill in the code test using GPU:

import torch
flag = torch.cuda.is_available()print(flag)

ngpu=1
# Decide which device we want to run on
device = torch.device("cuda:0"if(torch.cuda.is_available() and ngpu >0)else"cpu")print(device)print(torch.cuda.get_device_name(0))print(torch.rand(3,3).cuda()) 
# True
# cuda:0
# GeForce GTX 1060
# tensor([[0.5772,0.5287,0.0946],
#  [0.9525,0.7855,0.1391],
# [0.6858,0.5143,0.8188]], device='cuda:0')

Install tensorflow14

import tensorflow as tf
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())import warnings
warnings.filterwarnings("ignore")
hello=tf.constant("Hello,Tensorflow")print(hello)
a=tf.constant([1.0,2.0]) #Define constant
b=tf.constant([3.4,4.0])
result1=a+b
print("a+b=",result1)
c=tf.constant([[3.0],[1.4]])
result2=a+c
sess=tf.Session()print("result1:",result1)#The display result is "add:0"Tensor, shape has only one element, that is, the dimension is 1
# 2 Indicates that the first dimension has two elements and is floating point
try:print(sess.run(result1))print("result2:",result2)print(sess.run(result2))print(sess.run(hello))
except:
 # Exception handling
 print("Exception")finally:
 # Close the session and release resources
 sess.close()

to sum up

This is the end of this article about installing Ubuntu 20.04 and installing NVIDIA driver tutorials. For more related installation of Ubuntu 20.04 NVIDIA driver content, please search for previous articles on ZaLou.Cn or continue to browse related articles below. Hope everyone Support ZaLou.Cn a lot in the future!

Recommended Posts

How to install Ubuntu20.04 and install NVIDIA driver
How to install cuda10.1 driver in Ubuntu
How to install Pycharm and Ipython on Ubuntu 16.04/18.04
How to install and configure Gogs on Ubuntu 18.04
How to install and configure Cyberpanel on Ubuntu 18.04
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure GitLab on Ubuntu 18.04
How to install and use Docker on Ubuntu 20.04
How to install and use Curl on Ubuntu 18.04
How to install and use Composer on Ubuntu 18.04
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure Elasticsearch on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install and use Composer on Ubuntu 20.04
How to install and use BaasBox on Ubuntu 14.04
How to install and configure VNC on Ubuntu 18.04
How to install and configure Sphinx on Ubuntu 16.04
How to install and configure OrientDB on Ubuntu 14.04
How to install and use PostgreSQL on Ubuntu 16.04
How to install and configure AppScale on Ubuntu 12.04
How to install and use Docker on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install and use MySQL Workbench on Ubuntu 18.04
How to install theano and keras on ubuntu system
How to install Helm in Ubuntu
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install MySQL on Ubuntu 20.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
How to install mysql in Ubuntu 14.04
How to install Memcached on Ubuntu 18.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install Python 3.8 on Ubuntu 18.04
How to install KVM on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Anaconda on Ubuntu 20.04
How to install Prometheus on Ubuntu 16.04
How to install Jenkins on Ubuntu 18.04
How to install Apache on Ubuntu 20.04
How to install R on Ubuntu 20.04
How to install Moodle on Ubuntu 16.04