You are not logged in.

#1 2019-10-24 08:46:07

estov
Member
Registered: 2015-05-22
Posts: 10

GPU Passthrough / Ubuntu guest

Hello,

I followed this article https://wiki.archlinux.org/index.php/PC … h_via_OVMF to setup a Ubuntu guest on Arch.
My hardware:

Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz

01:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] (rev a1)
	Kernel driver in use: vfio-pci
	Kernel modules: nouveau, nvidia_drm, nvidia

01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev a1)
	Kernel driver in use: vfio-pci
	Kernel modules: snd_hda_intel

I got everything running (enabling IOMMU, pci devices properly mapped to IOMMU groups, vfio driver (as you can see above) is in use). I installed Ubuntu 19.10 as guest system with nvidia drivers. It seems like that the gpu got passed through properly because in Ubuntu I retrieved the following hardware info:

lspci -s 04:00.0 -k
04:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] (rev a1)
	Kernel driver in use: nvidia
	Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

The output in the guest is identical with the output from the host. Now I wanted to run nvidia-settings (as root and non-root) to use the Nvidia card as standard gpu. But it doesn't work, an empty window pops up and in the console I get the following error messages:

ERROR: Unable to load info from any available system

(nvidia-settings:3294): GLib-GObject-CRITICAL **: 10:22:57.108: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** Message: 10:22:57.111: PRIME: No offloading required. Abort
** Message: 10:22:57.111: PRIME: is it supported? no

However nvidia-smi seems to work fine because it prints:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1060    Off  | 00000000:04:00.0 Off |                  N/A |
| N/A   51C    P0    24W /  N/A |      0MiB /  3019MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

I also tried to install bumblebee but the bumblebee daemon also ends up with an error....

As you can see in my libvirt domain configuration file (link below) I spoofed the vendor_id for the hypervisor by adding the lines <vendor_id state='on' value='1234567890ab'/> and <hidden state='on'/>
https://pastebin.com/S1LXq09h

So I can't use my NVIDIA gpu although it seems to be properly passed through and recognized by the guest system. Any help how to fix this?

Thank you

Offline

#2 2020-01-11 16:27:40

TheUnknownZ
Member
Registered: 2020-01-11
Posts: 2

Re: GPU Passthrough / Ubuntu guest

Hi there,

Did you manage to solve the problem?
I'm having exactly the same issues.

I tried modesetting and added nvidia, nvidia_modeset, nvidia_uvm and nvidia_drm to the initramfs but no luck

Got a Windows passthrough working properly but not with another arch distro.

Host: Arch gtx 970
Guest: Arch gtx 2070

Last edited by TheUnknownZ (2020-01-11 17:33:28)

Offline

#3 2020-01-12 13:13:04

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,922

Re: GPU Passthrough / Ubuntu guest

OP shouldn't use nvida-settings or (X -configure) .

If the passthrough was successful, the guest only sees one videocard : the nvidia card.
Optimus manager, bumblebee, bbswitch, nivdia-xrun and other tricks are  not relevant.

For testing setups / verifying configurations you want things as simple as possible.

Have the guest boot to console by adding systemd.unit=multi-user.target as kernel parameter.
login to console as user.
Then setup startx / xinit .
run startx , post Xorg logfile .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2020-01-12 17:57:57

TheUnknownZ
Member
Registered: 2020-01-11
Posts: 2

Re: GPU Passthrough / Ubuntu guest

I figured it out. I was using BIOS instead of UEFI.
I overlooked this because libvirt was not giving me the UEFI option anymore. Because of recent libvirt update.

Working package is in testing according to:
https://bugs.archlinux.org/task/64175

But I guess OP figured that out already because his post date is around the same time as the bug report.

Offline

Board footer

Powered by FluxBB