Compute Only GPU Passthrough with Web Console Gui

rpm5099

New Member
Jan 16, 2024
19
2
3
I have read many posts here, on Reddit and other places regarding GPU passthrough as primary where the hardware setting for display is set to None. However I'm unable to find any information regarding how to configure a VM to have a GPU passed through to a VM for compute only while utilizing Proxmox UI web based NoVNC or Spice for GUI access. I have everything working ok using the GPU (Quadro RTX 4000) and accessing it via Rustdesk or VNC. However, when I enable Spice and disable the passed through GPU as primary it still boots but I am not able to get to the gui most of the time, although sometimes it works after a long delay. There seems to be some conflict between the qxl and Nvidia driver as evidenced in dmesg output and bizarre behavior. It almost seems as if the qxl and Nvidia drivers are fighting for access. I do have a display port blank plug in the passed through GPU.

Setting "default" for display in the hardware with the passthrough gpu set as NOT primary allows Rustdesk remote to work fine, but the web console has a black screen with a working mouse and keyboard - so close!

This seems like a common application, especially for data science/tensorflow activities, to have the compute gpu(s) passed through but still having the convenience of web based console UI access. Without that it's impossible to view messages during boot or configure BIOS settings. It's always possible I missed something obvious, but I appreciate any suggestions. I can provide any logs, but I wasn't sure which would be helpful. I put the output of a few commands below.

Thanks!

Code:
$xrandr --query
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm
   1920x1080     60.00*+
   3840x2160     17.00
   2560x1600     29.99
   2560x1440     30.00
   1680x1050     59.95
   1600x900      60.00
   1440x900      59.89
   1280x1024     75.02    60.02
   1280x800      59.81
   1280x720      60.00
   1152x864      75.00
   1024x768      75.03    70.07    60.00
   800x600       75.00    72.19    60.32    56.25
   640x480       75.00    72.81    59.94
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
USB-C-0 disconnected (normal left inverted right x axis y axis)

Code:
$xrandr --listactivemonitors

Monitors: 1
0: +*DP-3 1920/480x1080/270+0+0 DP-3

Code:
$nvidia-smi
Sat Jun 21 19:53:13 2025     
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.247.01             Driver Version: 535.247.01   CUDA Version: 12.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  Quadro RTX 4000                On  | 00000000:01:00.0  On |                  N/A |
| 30%   42C    P0              33W / 125W |    328MiB /  8192MiB |      4%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                       
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      7973      G   /usr/lib/xorg/Xorg                           92MiB |
|    0   N/A  N/A      8536      G   /usr/bin/gnome-shell                         87MiB |
|    0   N/A  N/A      9946      C   /usr/share/rustdesk/rustdesk                132MiB |
|    0   N/A  N/A     10192      G   /usr/share/rustdesk/rustdesk                 10MiB |
+---------------------------------------------------------------------------------------+

Code:
$lspci | grep -i vga
00:01.0 VGA compatible controller: Device 1234:1111 (rev 02)
01:00.0 VGA compatible controller: NVIDIA Corporation TU104GL [Quadro RTX 4000] (rev a1)

Code:
$journalctl -p err --since today'
Jun 21 19:39:57 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:19 iptv gdm3[3127]: Gdm: on_display_added: assertion 'GDM_IS_REMOTE_DISPLAY (display)' failed
Jun 21 19:40:22 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:23 iptv systemd[3810]: Failed to start app-gnome-snap\x2duserd\x2dautostart-8921.scope - Application launched by gnome-session-binary.
Jun 21 19:40:23 iptv systemd[3810]: Failed to start app-gnome-user\x2ddirs\x2dupdate\x2dgtk-8930.scope - Application launched by gnome-session-binary.
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Jun 21 19:40:25 iptv gdm3[3127]: Gdm: on_display_removed: assertion 'GDM_IS_REMOTE_DISPLAY (display)' failed
lines 224-278/278 (END)

Code:
#qm config 120
agent: 1,fstrim_cloned_disks=1
balloon: 0
bios: ovmf
boot: order=scsi0
cores: 16
cpu: host,flags=+pdpe1gb;+aes
cpuunits: 100
description: scsi1%3A spare%3Avm-113-disk-0,aio=threads,backup=0,cache=writeback,iothread=1,size=4000G,ssd=1%0Avirtio0%3A bigtank%3Avm-113-disk-0,backup=0,size=15000G%0Alxc.cgroup2.devices.allow%3A c 226%3A128 rwm%0Alxc.mount.entry%3A /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file%0Afeatures%3A fuse=1,nesting=1%0Ascsi1%3A supervmdata%3Avm-120-disk-1,backup=0,iothread=1,replicate=0,size=400G,ssd=1%0Ascsi1%3A supervmdata%3Avm-120-disk-2,backup=0,cache=writethrough,discard=on,iothread=1,replicate=0,size=1000G
efidisk0: supervmdata:vm-120-disk-0,efitype=4m,size=1M
hostpci0: mapping=RTX4000,pcie=1
machine: q35
memory: 32768
meta: creation-qemu=9.0.0,ctime=1719981867
name: sIPTV
net0: virtio=BC:24:11:56:92:02,bridge=vmbr0,queues=16
numa: 1
onboot: 1
ostype: l26
parent: before24update
scsi0: supervmdata:vm-120-disk-1,discard=on,iothread=1,size=200G,ssd=1
scsi1: supervmdata:vm-120-disk-2,backup=0,discard=on,iothread=1,replicate=0,size=1000G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=a52d496a-54de-4e12-9b89-d32106e212c8
sockets: 2
spice_enhancements: foldersharing=1,videostreaming=all
tags: up
vmgenid: a4d1d679-c9af-4467-9218-9059601a5498
vmstatestorage: supervmdata
 
Last edited:
Howdie,

I'm new to proxmox and currently setting up a host with some RTX 3090's that will be used for computation only.
Installing the GPU drivers on a ubuntu 24.04 simply with ubuntu-drivers autoinstall got me into a situation identical to what you describe.

What worked for me was to use the --gpgpu option:

--gpgpu Instrall drivers for use in a headless (aka General Purpose GPU) environment. This results in a smaller installation footprint by not installing packages that are only useful in graphical environments.
So, basically, what did it for me was to installing the nvidia drivers on the VM with:

Bash:
ubuntu-drivers --gpgpu autoinstall
 
Last edited:
Hmm, maybe i'll give that a try, although I'll have to remove the existing drivers to do that. Do you know if installing that way works with the docker container and cuda toolkits?
 
Apparently you can install either the server or desktop driver, but you need to put it into "compute-only" driver mode.

Add the nvidia-drm setting to `/etc/default/grub` (and then `sudo update-grub` and reboot):
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=0"

Within `/etc/modprobe.d/` check to see if any files have `options nvidia-drm modeset=1` in them and change it to 0. If it doesn't exist, add a new file with `options nvidia-drm modeset=0`.

Do the exact same thing in `/etc/modprobe.d/` except make sure `blacklist nvidiafb` exists somehwere to disable the frame buffering.

To verify after reboot:
```
nvidia-smi # Should show your GPU and driver version
lsmod | grep qxl # QXL driver should be loaded
lsmod | grep nvidia # NVIDIA compute modules loaded
```

I am running Ubuntu 25.04 and just set that up and it seems to be working fine - no errors within dmesg.