[vfio-users] Quadro M1200 Mobile for CUDA

Simon Brand 1992 at gmx.net
Mon Oct 15 16:00:57 UTC 2018


Good evening,

I have a Lenovo Thinkpad P51 and I want to pass the GPU (GM107GLM
[Quadro M1200 Mobile]) to (linux) VM. I only want to run cuda on the
GPU, so there is no output needed.
I use an uptodate arch linux:
 $ uname -r
4.18.14-arch1-1-ARCH
 $ qemu-system-x86_64 --version

The guest can see the nvidia card and the nvidia module is loaded, but
when I try to run nvidia-smi, it does not find my card.

I read that I need to pass every device in my IOMMU group to the vm.
I have the following groups:

IOMMU Group 1 00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200
v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901]
(rev 05)
IOMMU Group 1 01:00.0 3D controller [0302]: NVIDIA Corporation
GM107GLM [Quadro M1200 Mobile] [10de:13b6] (rev a2)
IOMMU Group 2 00:02.0 VGA compatible controller [0300]: Intel
Corporation Device [8086:591b] (rev 04)

I start the host kernel with these parameters:
BOOT_IMAGE=/boot/vmlinuz-linux
root=UUID=9ad057db-0173-4df2-b73c-ca8b2f30b850 rw
cryptdevice=/dev/nvme0n1p1:root root=/dev/mapper/root
cryptkey=rootfs:/crypt.key intel_iommu=on i915.enable_gvt=1 iommu=pt
quiet vfio_pci.ids=10de:13b6,8086:1901 efifb=off

But the pci-bridge still gets assigned to pcieport driver. (I dont
know, if this is a problem, beause I dont pass it to the vm?).

I start the VM with qemu:
/usr/bin/qemu-system-x86_64
-bios /usr/share/ovmf/x64/OVMF_CODE.fd -L ovmf64/
-enable-kvm -cpu host,kvm=off -smp 3,sockets=1,cores=3,threads=1 -m 2192
-name Cuda -rtc base=localtime
-net nic -net user,hostfwd=tcp::22221-:22222
-device
vfio-pci,host=01:00.0,multifunction=on,romfile=/path/to/hp-m1200.rom
-display gtk,gl=on
-device
vfio-pci,sysfsdev=/sys/devices/pci0000:00/0000:00:02.0/63905597-18a7-4f46-ab10-35ae270681d7/,x-igd-opregion=on,display=on
-drive file=/path/to/image.qcow2,id=win,format=qcow2,if=none -device
ide-hd,bus=ide.0,drive=win   -boot c

I attach a dmesg of the guest in the logs.
nvidia-smi just outputs: No devices were found

If I dont start with kvm=off, I get the error:
Unable to determine the device handle for GPU 0000:00:04.0: Unknown
Error

Any hint, where the problem could be?
I have the exactly same problems without the intel card passed to the
VM, but I thought, maybe nvidia detects that the integrated CPU is
missing or something.

Thanks for your time,
Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: guest.log
Type: text/x-log
Size: 49058 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20181015/f5d03ac3/attachment.bin>


More information about the vfio-users mailing list