xrandr --listproviders 不显示任何显卡

xrandr --listproviders 不显示任何显卡

我希望能够xrandr识别我的两张 RTX 3070 Nvidia 显卡。

但是,xrandr 没有返回任何内容。

xrandr --listproviders
Providers: number : 0

我正在使用nvidia-primenvidia-driver-530

我认为这是由于Xwayland在其上运行 X 组合层wayland而不是xorg直接运行造成的。

虽然我不太清楚这是否wayland是根本原因,但我认为我想禁用wayland我的服务器计算机(Ubuntu Server 22.04)上的所有内容并仅运行。我正在通过 Ubuntu 桌面客户端xorg访问服务器。ssh -X

xrandr --listmonitors
Monitors: 1
 0: +*XWAYLAND15 3840/620x2160/330+0+0  XWAYLAND15
xinput
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ xwayland-pointer:16                       id=6    [slave  pointer  (2)]
⎜   ↳ xwayland-relative-pointer:16              id=7    [slave  pointer  (2)]
⎜   ↳ xwayland-pointer-gestures:16              id=8    [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ xwayland-keyboard:16                      id=9    [slave  keyboard (3)]

echo $XDG_SESSION_TYPE
tty
loginctl show-session 1 -p Type
Type=tty

我需要进行哪些设置或配置才能xrandr --listproviders显示 Nvidia 显卡?

我很乐意根据需要提供更多详细信息。

答案1

在使用时,您应该使用lshw和等应用程序,因为它们实际上将在您的远程系统上运行,向您显示该系统中的硬件。 在远程系统上运行时,只会显示您的本地显示器和视频卡。原因是,当运行这些命令时,您正在将显示调用转发到本地主机。 和将在远程系统上正常运行,并向您显示您拥有的硬件。nvidia-smissh -Xssh -Xxrandrlshwnvidia-smi

举个例子,我这​​里有两台并排的主机。一台有 GTX 1060,另一台有 GTX 1650:

本地系统:

terrance@terrance-ubuntu:~$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x1b7 cap: 0x1, Source Output crtcs: 4 outputs: 5 associated providers: 0 name:NVIDIA-0
terrance@terrance-ubuntu:~$ xrandr --listmonitors
Monitors: 3
 0: +*DVI-D-1 1920/521x1080/293+1920+0  DVI-D-1
 1: +DVI-D-0 1280/338x1024/270+3840+0  DVI-D-0
 2: +HDMI-0 1920/509x1080/286+0+0  HDMI-0
terrance@terrance-ubuntu:~$ sudo lshw -C video
[sudo] password for terrance: 
  *-display                 
       description: VGA compatible controller
       product: GP104 [GeForce GTX 1060 6GB]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:36 memory:fb000000-fbffffff memory:c0000000-cfffffff memory:de000000-dfffffff ioport:ef00(size=128) memory:c0000-dffff
  *-graphics
       product: VESA VGA
       physical id: 1
       logical name: /dev/fb0
       capabilities: fb
       configuration: depth=32 resolution=1280,1024
terrance@terrance-ubuntu:~$ nvidia-smi
Thu Apr 27 07:13:38 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.41.03              Driver Version: 530.41.03    CUDA Version: 12.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  NVIDIA GeForce GTX 1060 6GB     Off| 00000000:01:00.0  On |                  N/A |
|  0%   58C    P0               31W / 120W|    534MiB /  6144MiB |      1%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      3031      G   /usr/lib/xorg/Xorg                          348MiB |
|    0   N/A  N/A      3306      G   xfwm4                                         2MiB |
|    0   N/A  N/A      3413      G   /usr/local/bin/ckb-next                       1MiB |
|    0   N/A  N/A    137496      G   ...,WinRetrieveSuggestionsOnlyOnDemand       38MiB |
|    0   N/A  N/A    141190      G   /usr/lib/firefox/firefox                    139MiB |
+---------------------------------------------------------------------------------------+

远程系统(通过连接ssh -X):

terrance@terrance-ubuntu:~$ ssh -X intrepid
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-71-generic x86_64)

  System information as of Thu Apr 27 07:12:42 AM MDT 2023

  System load:  0.02                Processes:              222
  Usage of /:   73.4% of 454.44GB   Users logged in:        0
  Memory usage: 9%                  IPv4 address for bond0: 10.0.0.220
  Swap usage:   0%                  IPv4 address for tun0:  10.8.0.1

Expanded Security Maintenance for Applications is enabled.

0 updates can be applied immediately.

You have new mail.
Last login: Thu Apr 27 07:02:50 2023 from 10.0.0.100
-------------------------------------------------------------- 04/27/23 07:12:43
terrance@Intrepid:~$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x1b7 cap: 0x1, Source Output crtcs: 4 outputs: 5 associated providers: 0 name:NVIDIA-0
-------------------------------------------------------------- 04/27/23 07:12:53
terrance@Intrepid:~$ xrandr --listmonitors
Monitors: 3
 0: +*DVI-D-1 1920/521x1080/293+1920+0  DVI-D-1
 1: +DVI-D-0 1280/338x1024/270+3840+0  DVI-D-0
 2: +HDMI-0 1920/509x1080/286+0+0  HDMI-0
-------------------------------------------------------------- 04/27/23 07:13:01
terrance@Intrepid:~$ sudo lshw -C video
  *-display                 
       description: VGA compatible controller
       product: TU117 [GeForce GTX 1650]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:29 memory:fb000000-fbffffff memory:c0000000-cfffffff memory:de000000-dfffffff ioport:ef00(size=128) memory:c0000-dffff
  *-graphics
       product: VESA VGA
       physical id: 1
       logical name: /dev/fb0
       capabilities: fb
       configuration: depth=32 resolution=640,480
-------------------------------------------------------------- 04/27/23 07:13:16
terrance@Intrepid:~$ nvidia-smi
Thu Apr 27 07:13:25 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.105.17   Driver Version: 525.105.17   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| 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  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| 35%   41C    P8    11W /  75W |      1MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
-------------------------------------------------------------- 04/27/23 07:13:25

如您所见,该xrandr命令在本地主机和远程主机上运行时显示的内容完全相同。但lshwnvidia-smi在两台主机上显示的正是我需要看到的内容。

答案2

最终,我尝试做的事情似乎无法实现。

由于我不认为图形软件应该以这种方式在无头 Ubuntu 服务器上运行,因此我安装了它,lightdm以便我可以访问服务器机器上的 GUI,并通过直接视频连接将其直接连接到显示器。

安装 GUI 后,一切似乎都运行正常,所有 Nvidia 卡都被识别。

相关内容