Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #63645 > unrolled thread

Bug#923393: CONFIG_DRM_I915_GVT_KVMGT is not enabled

Started byJohannes Schauer <josch@debian.org>
First post2019-03-17 23:10 +0100
Last post2019-08-23 02:40 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.debian.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Bug#923393: CONFIG_DRM_I915_GVT_KVMGT is not enabled Johannes Schauer <josch@debian.org> - 2019-03-17 23:10 +0100
    Bug#923393: CONFIG_DRM_I915_GVT_KVMGT is not enabled Johannes Schauer <josch@debian.org> - 2019-03-20 09:40 +0100
      Processed: Re: CONFIG_DRM_I915_GVT_KVMGT is not enabled "Debian Bug Tracking System" <owner@bugs.debian.org> - 2019-03-20 09:40 +0100
      Bug#923393: CONFIG_DRM_I915_GVT_KVMGT is not enabled Markus Huber <markus@bananenfisch.net> - 2019-08-23 02:40 +0200

#63645 — Bug#923393: CONFIG_DRM_I915_GVT_KVMGT is not enabled

FromJohannes Schauer <josch@debian.org>
Date2019-03-17 23:10 +0100
SubjectBug#923393: CONFIG_DRM_I915_GVT_KVMGT is not enabled
Message-ID<xCM8G-1to-9@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi,

I came here with the same request.

On Wed, 27 Feb 2019 15:01:39 +0100 Michael Fritscher <michael@fritscher.net> wrote:
> I would like to try GVT like described in
> https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide to get native 3D
> accelaration in a KVM guest. Unfortunately, the kernel compile options
> CONFIG_DRM_I915_GVT and CONFIG_DRM_I915_GVT_KVMGT are not set.  So I can't
> use it with the provided kernels.

CONFIG_DRM_I915_GVT_KVMGT depends on CONFIG_VFIO_MDEV and
CONFIG_VFIO_MDEV_DEVICE, so these would also have to be enabled (both are
disabled by default).

Thanks!

cheers, josch

[toc] | [next] | [standalone]


#63661

FromJohannes Schauer <josch@debian.org>
Date2019-03-20 09:40 +0100
Message-ID<xDEVr-2qa-7@gated-at.bofh.it>
In reply to#63645

[Multipart message — attachments visible in raw view] — view raw

Control: tag -1 + patch
Control: reassign -1 linux

Hi,

On Sun, 17 Mar 2019 23:04:23 +0100 Johannes Schauer <josch@debian.org> wrote:
> On Wed, 27 Feb 2019 15:01:39 +0100 Michael Fritscher <michael@fritscher.net> wrote:
> > I would like to try GVT like described in
> > https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide to get native 3D
> > accelaration in a KVM guest. Unfortunately, the kernel compile options
> > CONFIG_DRM_I915_GVT and CONFIG_DRM_I915_GVT_KVMGT are not set.  So I can't
> > use it with the provided kernels.
> 
> CONFIG_DRM_I915_GVT_KVMGT depends on CONFIG_VFIO_MDEV and
> CONFIG_VFIO_MDEV_DEVICE, so these would also have to be enabled (both are
> disabled by default).

I can confirm that the patch at the end of this email gives me this:

    $ ls /sys/devices/pci0000:00/0000:00:02.0/mdev_supported_types/
    i915-GVTg_V4_2	i915-GVTg_V4_4	i915-GVTg_V4_8

And after an "echo $uuid | sudo /sys/[...]/i915-GVTg_V4_2/create" I get a new
virtual card in /sys/devices/pci0000:00/0000:00:02.0/$uuid.

Unfortunately, I haven't had much luck with using this feature in practice. I
start qemu-system-x86_64 with:

    $ qemu-system-x86_64 -device vfio-pci,sysfsdev=/sys/[...]/$uuid/ \
        -vga qxl -display gtk,gl=on

And indeed the Windows guest shows me an Intel 5500 card but after installing
the drivers I constantly get a bluescreen immediately after boot. Neither
Windows 7, 8.1 or 10 worked. In Windows 10 the bluescreen shows a "video tdr
failure". On my host system I get spammed with dmesg output like:

    [Wed Mar 20 04:19:07 2019] vfio_pin_page_external: Task qemu-system-x86 (28656) RLIMIT_MEMLOCK (16777216) exceeded
    [Wed Mar 20 04:19:07 2019] gvt: vgpu 1: vfio_pin_pages failed for gfn 0x4359e, ret -12
    [Wed Mar 20 04:19:07 2019] gvt: vgpu 1: fail: spt 0000000030299d2a guest entry 0x4359e007 type 1
    [Wed Mar 20 04:19:07 2019] gvt: vgpu 1: fail: shadow page 0000000030299d2a guest entry 0x4359e007 type 1.
    [Wed Mar 20 04:19:07 2019] gvt: guest page write error, gpa f7acae0

or

    [Wed Mar 20 04:19:07 2019] vfio_pin_page_external: Task qemu-system-x86 (28656) RLIMIT_MEMLOCK (16777216) exceeded
    [Wed Mar 20 04:19:07 2019] gvt: vgpu 1: vfio_pin_pages failed for gfn 0x622cd, ret -12
    [Wed Mar 20 04:19:07 2019] gvt: vgpu 1: fail to populate guest ggtt entry

I'm using Debian buster, Linux 4.19.16 and qemu 1:3.1+dfsg-5 on an Intel
Broadwell system.

I don't know if these problems are due to my hardware or due to qemu or due to
my Windows guests but maybe it would make sense to see this setup working in
practice before enabling the respective kernel options?

Somebody on Arch Linux claims it's working:

https://www.reddit.com/r/VFIO/comments/8h352p

This bug should probably be assigned to src:linux instead of
src:linux-signed-amd64 as only the former contains the kernel sources.

Thanks!

cheers, josch


diff -Nru linux-4.19.16/debian/config/config linux-4.19.16/debian/config/config
--- linux-4.19.16/debian/config/config  2019-01-08 07:03:19.000000000 +0000
+++ linux-4.19.16/debian/config/config  2019-03-17 22:06:06.000000000 +0000
@@ -680,6 +680,8 @@
 ## file: drivers/gpu/drm/i915/Kconfig
 ##
 CONFIG_DRM_I915_USERPTR=y
+CONFIG_DRM_I915_GVT=y
+CONFIG_DRM_I915_GVT_KVMGT=m
 
 ##
 ## file: drivers/gpu/drm/i915/Kconfig.debug
@@ -5229,6 +5231,12 @@
 # CONFIG_VFIO_NOIOMMU is not set
 
 ##
+## file: drivers/vfio/mdev/Kconfig
+##
+CONFIG_VFIO_MDEV=m
+CONFIG_VFIO_MDEV_DEVICE=m
+
+##
 ## file: drivers/vhost/Kconfig
 ##
 CONFIG_VHOST_NET=m

[toc] | [prev] | [next] | [standalone]


#63662 — Processed: Re: CONFIG_DRM_I915_GVT_KVMGT is not enabled

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2019-03-20 09:40 +0100
SubjectProcessed: Re: CONFIG_DRM_I915_GVT_KVMGT is not enabled
Message-ID<xDEVs-2qa-11@gated-at.bofh.it>
In reply to#63661
Processing control commands:

> tag -1 + patch
Bug #923393 [linux-image-4.19.0-2-amd64] CONFIG_DRM_I915_GVT_KVMGT is not enabled
Added tag(s) patch.
> reassign -1 linux
Bug #923393 [linux-image-4.19.0-2-amd64] CONFIG_DRM_I915_GVT_KVMGT is not enabled
Bug reassigned from package 'linux-image-4.19.0-2-amd64' to 'linux'.
No longer marked as found in versions linux-signed-amd64/4.19.16+1.
Ignoring request to alter fixed versions of bug #923393 to the same values previously set

-- 
923393: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923393
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

[toc] | [prev] | [next] | [standalone]


#64878

FromMarkus Huber <markus@bananenfisch.net>
Date2019-08-23 02:40 +0200
Message-ID<yy5Mt-4Ja-1@gated-at.bofh.it>
In reply to#63661
IMHO, KVMGT should be enabled as soon as possible.

Since the modules would not be loaded by default and the user have explicit to enable it, i see more benefits.

I've tested a scenario with a precompiled "MainlineBuilds" kernel (5.3.0-050300rc5-generic #201908182231) from Ubuntu on my Debian sid system (with Intel HD 530 Skylake):

- After loading "modprobe kvmgt", i've got 2 types:

  root@nietzsche:~# cat /sys/devices/pci0000\:00/0000\:00\:02.0/mdev_supported_types/i915-GVTg_V5_*/description
  low_gm_size: 128MB
  high_gm_size: 512MB
  fence: 4
  resolution: 1920x1200
  weight: 4
  low_gm_size: 64MB
  high_gm_size: 384MB
  fence: 4
  resolution: 1024x768
  weight: 2

- Since i don't use a remote protocol (as spice), i tried this one:

  https://github.com/intel/gvt-linux/wiki/Dma_Buf_User_Guide
  "A new feature called “Local display” has been supported in GVT-g (KVMGT only) by introducing “dma-buf”, a generic kernel level frame work to share buffers."

- My testing scenario: run Libreelec (Kodi) in a qemu-kvm container - and it works...

  To do this (first enable enable_gvt, load modules, create vGPU [1]), give the user privileges:
  markus@nietzsche:~$ cat /etc/udev/rules.d/10-qemu.rules
    SUBSYSTEM=="vfio", OWNER="root", GROUP="kvm"

- Start qemu from commandline:

kvm -hda ./kodi.img \
  -boot c -m 2G \
  -vga none \
  -display gtk,gl=on \
  -soundhw ac97 \
  -smp cores=4,threads=2,sockets=1 \
  -enable-kvm \
  -cpu host \
  -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000\:00\:02.0/a297db4a-f4c2-11e6-90f6-d3b88d6c9525,display=on,x-igd-opregion=on,driver=vfio-pci-nohotplug,ramfb=on

- Libreelec output sysinfo:
  GPU: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2) [...]

  The performance playing a full-hd video is about 60% less CPU usage comparing to virgl!!!

* Problems:
- When using the higher resolution (1920x1200 in my case), the VM freezes with "RLIMIT_MEMLOCK (67108864) exceeded"
  dirty fix - set memlock to 1GB for specific user [2]:
  root@nietzsche:~# cat /etc/security/limits.d/99-memlock.conf
    markus hard memlock 1048576
    markus soft memlock 1048576
- The resolution isn't flexible - maybe on Linux guests, this could be fixed via xorg (or wayland?) [3]
- After shutdown a VM using GVT-g (Dma_Buf) and restart another VM without kvmgt, the CPU-usage is very high! Removing the module is solving this (but i don't know, if this just happens, because I've tested it in a weird environment Debian sid with an Ubuntu maintainer kernel).
- For Linux guests, it seems, this is only working with an compatible kernel also on the guest side...

So, i think, it should be enabled in the default kernel, because it has great benefits!
On the other side: there are some problems... but the user should have the possibility to activate the modules and test it! The modules have to enabled manually - and in combination with spice, it seems to be more stable than with the newer "dma-buf"-mode!

Thanks,
Markus



[1] https://wiki.archlinux.org/index.php/Intel_GVT-g
[2] https://stackoverflow.com/questions/39187619/vfio-dma-map-error-when-passthrough-gpu-using-libvirt
[3] https://github.com/intel/gvt-linux/issues/44

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web