1.原来,是英特尔的集显
2.添加N卡驱动
1.检查是否有GPU显卡,我电脑一张集显,一张独显,很清楚。如果不清楚的可以用 lspci | grep -i nvidia
查看:
linux2021@dahu:~$ lspci | grep -i nvidia 01:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] (rev a1) 01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev a1) linux2021@dahu:~$
2.检测推荐的驱动ubuntu-drivers devices
linux2021@dahu:~$ ubuntu-drivers devices == /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0 == modalias : pci:v00008086d000024FDsv00008086sd00009010bc02sc80i00 vendor : Intel Corporation model : Wireless 8265 / 8275 manual_install: True driver : backport-iwlwifi-dkms - distro free == /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001C20sv00001D72sd00001706bc03sc00i00 vendor : NVIDIA Corporation model : GP106M [GeForce GTX 1060 Mobile] driver : nvidia-driver-460 - distro non-free driver : nvidia-driver-390 - distro non-free driver : nvidia-driver-450-server - distro non-free driver : nvidia-driver-460-server - distro non-free recommended driver : nvidia-driver-418-server - distro non-free driver : nvidia-driver-450 - distro non-free driver : xserver-xorg-video-nouveau - distro free builtin
3.安装驱动
(1)自动安装合适的版本
sudo ubuntu-drivers autoinstall
(2) 安装指定版本
如:
sudo apt-get install nvidia-driver-390
4.重启
安装成功
查看详细信息:
linux2021@dahu:~$ nvidia-smi Fri May 14 11:24:15 2021 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 460.73.01 Driver Version: 460.73.01 CUDA Version: 11.2 | |-------------------------------+----------------------+----------------------+ | 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 1060 Off | 00000000:01:00.0 Off | N/A | | N/A 46C P3 17W / N/A | 241MiB / 6078MiB | 1% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | 0 N/A N/A 2181 G /usr/lib/xorg/Xorg 120MiB | | 0 N/A N/A 3032 G /usr/bin/gnome-shell 47MiB | | 0 N/A N/A 3895 G ...AAAAAAAAA= --shared-files 68MiB | +-----------------------------------------------------------------------------+