如何在 Ubuntu 20.04 中启用 Nvidia 显卡?

如何在 Ubuntu 20.04 中启用 Nvidia 显卡?

我为我的台式机买了一台 RTX 3070,但似乎无法让我的台式机使用它。它可以看到它,但watch nvidia-smi显示它已关闭

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.80       Driver Version: 460.80       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 RTX 3070    Off  | 00000000:01:00.0  On |                  N/A |
|  0%   39C    P8    14W / 220W |    198MiB /  7972MiB |      2%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       904      G   /usr/lib/xorg/Xorg                 35MiB |
|    0   N/A  N/A      1484      G   /usr/lib/xorg/Xorg                 54MiB |
|    0   N/A  N/A      1650      G   /usr/bin/gnome-shell               74MiB |
|    0   N/A  N/A      2218      G   /usr/lib/firefox/firefox            3MiB |
|    0   N/A  N/A      2421      G   /usr/lib/firefox/firefox            3MiB |
|    0   N/A  N/A      2465      G   /usr/lib/firefox/firefox            3MiB |
|    0   N/A  N/A      2571      G   /usr/lib/firefox/firefox            3MiB |
|    0   N/A  N/A      2607      G   /usr/lib/firefox/firefox            3MiB |
|    0   N/A  N/A      2971      G   /usr/lib/firefox/firefox            3MiB |
+-----------------------------------------------------------------------------+

我正在使用已安装并启用的驱动程序 nvidia-driver-460(使用 GUI 完成)

此外,tensorflow 检测到 GPU,但执行简单的训练操作所花费的时间比应有的时间长得多(我安装了 cuDNN 和 CUDA 工具包),并且终端中显示的 GPU 上的负载根本没有增加。

据我所知,这是我唯一的 GPU,lspci | grep VGA仅返回01:00.0 VGA compatible controller: NVIDIA Corporation Device 2484 (rev a1)

附加信息:我正在使用 gdm3 并且已禁用 wayland

ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00002484sv00001462sd00003909bc03sc00i00
vendor   : NVIDIA Corporation
driver   : nvidia-driver-460 - distro non-free recommended
driver   : nvidia-driver-465 - distro non-free
driver   : nvidia-driver-460-server - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

ubuntu-drivers list
nvidia-driver-465, (kernel modules provided by linux-modules-nvidia-465-generic-hwe-20.04)
nvidia-driver-460-server, (kernel modules provided by linux-modules-nvidia-460-server-generic-hwe-20.04)
nvidia-driver-460, (kernel modules provided by linux-modules-nvidia-460-generic-hwe-20.04)
cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

那么我怎样才能让我的桌面使用我的 GPU?

谢谢

相关内容