Score:1

xrandr --listproviders not showing any graphics cards

pn flag

I would like to be able to have xrandr recognize my two RTX 3070 Nvidia Graphics Cards.

However, xrandr does not return anything.

xrandr --listproviders
Providers: number : 0

I am using nvidia-prime and nvidia-driver-530.

I believe that this is caused by Xwayland running an X composition layer on top of wayland and not running xorg directly.

Although I don't really know if wayland is actually the root cause, I believe I would like to disable all wayland on my server machine (Ubuntu Server 22.04) and run xorg only. I am accessing the server through ssh -X from a Ubuntu desktop client.

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

What settings or configuration would I need to get xrandr --listproviders to display the Nvidia graphics cards?

I would be happy to provide additional details as necessary.

Score:0
id flag

You should use applications like lshw and nvidia-smi when using ssh -X as they will be actually ran on your remote system showing you the hardware in that system. ssh -X will only show you your local monitors and video card(s) when xrandr is ran on the remote system. The reason is that you are forwarding the display calls to your local host when those commands are run. lshw and nvidia-smi will run on the remote system fine and show you what hardware you have.

To give examples I have two hosts here sitting side by side. One has a GTX 1060 in it and the other a GTX 1650:

Local system:

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 |
+---------------------------------------------+

Remote system (connected via 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

As you can see the xrandr command will show exactly the same when ran on both my local host and the remote host. But the lshw and nvidia-smi show exactly what I need to see on both hosts.

jameszp avatar
pn flag
Thank you for the information. What I am trying to do is set variables for rendering Nvidia offline `__NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0` and `__NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G1`. However, the server does not seem to be able to select or find those names. That is the true issue that I want to resolve because I am unable to select the graphics card I want to use at will. I am able to see the graphics cards with `lshw` and `nvidia-smi`, but still unable to find a way to select the offload provider.
jameszp avatar
pn flag
Would I have to be running an Xsession to recognize the Nvidia cards as offload providers? I'm not running any GUI or remote desktop, and only using a virtual terminal to access the server. Is there a way to get the Nvidia cards recognizes as offload providers through the virtual or local terminal?
Score:0
pn flag

Ultimately, what I was trying to do did not seem possible.

Since I do not think the graphics software is meant to be run this way on a headless Ubuntu server, I installed lightdm so I could access a GUI on the server machine and connect it directly to the monitor with a direct video connection.

With the GUI installed, everything seemed to work fine with all the Nvidia cards being recognized.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.