Passthrough nvidia to ubuntu 22.04, the physical monitor does not turn on

miha12345

New Member
Jan 7, 2023
2
0
1
On the proxmox 7.3 host, an nvidia gtx 1650 GPU with a connected monitor via HDMI.
Passthrough on windows 10 vm works fine. Two monitors are defined in the system: a physical hdmi and a virtual one. There are two monitors in the video settings, you can change the resolution, drag windows to any monitor, play game. The task manager shows the load on the nvidia GPU.
win10.png

Passthrough GPU on ubuntu vm 22.04. Drivers are installed, nvidia-settings shows a physical monitor, but there is only a virtual monitor in the screen settings. All processes are executed without using nvidia GPU. What should I do to activate the physical monitor?

settingDisplay.png nvidia-smi.png

On host settings:

/etc/default/grub
Bash:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"

/etc/modules
Code:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

lspci -n -s 01:00
Code:
01:00.0 0300: 10de:1f82 (rev a1)
01:00.1 0403: 10de:10fa (rev a1)

/etc/modprobe.d/vfio.conf
Code:
options vfio-pci ids=10de:1f82,10de:10fa

etc/modprobe.d/blacklist.conf
Code:
blacklist radeon
blacklist nouveau
blacklist nvidia
blacklist nvidiafb

/etc/pve/qemu-server/101.conf
Code:
agent: 1
bios: ovmf
boot: order=scsi0;ide2;net0
cores: 8
cpu: host,hidden=1,flags=+pcid
efidisk0: local-lvm:vm-101-disk-0,efitype=4m,pre-enrolled-keys=1,size=4M
hostpci0: 0000:01:00,pcie=1
ide2: nas:iso/ubuntu-mate-22.04.1-desktop-amd64.iso,media=cdrom,size=2605246K
machine: q35
memory: 10240
meta: creation-qemu=7.1.0,ctime=1673086446
name: ubuntu
net0: virtio=B6:DC:E7:D6:30:8F,bridge=vmbr0,firewall=1,tag=1
numa: 0
ostype: l26
scsi0: local-lvm:vm-101-disk-1,discard=on,iothread=1,size=300G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=68bdb4ba-fa25-4986-92dd-860189cd48fd
sockets: 1
vga: std
vmgenid: ad69ed97-8952-441d-bafc-055a96e2f5f0
 
What happens if you enable Primary GPU (for the passed through GPU) or set Display to None? I think Linux VM's tend to only use the first GPU they find, which is the virtual one.
 
  • Like
Reactions: miha12345
What happens if you enable Primary GPU (for the passed through GPU) or set Display to None? I think Linux VM's tend to only use the first GPU they find, which is the virtual one.
Only the HDMI monitor works. Applications run via Nvidia GPU.
How to make two monitors and expand the desktops of a virtual monitor and an hdmi monitor?
 
How to make two monitors and expand the desktops of a virtual monitor and an hdmi monitor?
I think you need to configure Ubuntu to use two GPUs. I'm not sure how to do that and it is probably different depending on whether you run an Xorg or a Wayland session. There is probably an Ubuntu guide somewhere on the internet.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!