RE: bhyve intel 530 integrated graphics error

From: Michael Sløgedal <michael_at_sloged.al>
Date: Wed, 17 Jan 2024 12:29:59 UTC
Thanks Corvin,

 

However it’s still not clear to me from D26209 what exactly I need to do, and
what I’ve tried doesn’t work 😊 Any additional advice is appreciated.

 

 1. Dropped the GOP rom for now. Unless I need it for windows loading screen /
    windows diagnostics/repair ? GpuZ won’t extract it anyhow.
 2. I’ve added the -A option, no visible change
 3. BHYVE_CODE.fd – not sure if I’m using it right. I changed the symlink for
    BHYVE_UEFI.fd to point to this file. No visible change – except I now have
    4 non-working COM ports.
 4. I tried passthru on usb, and get the same error that I did with the audio
    card (see below)
 5. The gfx card initially boots with windows Error 43. When I delete it and
    scan for hardware changes it pops back in, without the error, but no
    displays detected.
 6. I’m using vga/dvi ports without success, haven’t tried displayport. No hdmi
    ports. In case that matters.
 7. Should I try to update freebsd to 14-STABLE branch and see if that makes a
    difference? (If I can figure out how)

 

# tail /vm/win10ltsc/bhyve.log

pci_fbuf: mmap_memseg failed

Assertion failed: (mr->name == memp->name), function unregister_mem, file /usr/
src/usr.sbin/bhyve/mem.c, line 344.

 

# tail /vm/win10ltsc/vm-bhyve.log

Jan 17 13:08:48:  [primary disk: disk0.img]

Jan 17 13:08:48:  [primary disk dev: file]

Jan 17 13:08:48: dynamically allocated port 5900 for vnc connections

Jan 17 13:08:48: booting

Jan 17 13:08:48:  [bhyve options: -c 6,sockets=1,cores=3,threads=2 -m 8G -Hwl
bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -A -U
8dff5c4a-b083-11ee-b2cd-78d004259091 -S]

Jan 17 13:08:48:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,ahci,hd:/vm/
win10ltsc/disk0.img -s 31:6,passthru,0/31/6 -s 2:0,passthru,0/2/0 -s
20:0,passthru,0/20/0 -s 6:0,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080 -s
7:0,xhci,tablet]

Jan 17 13:08:48:  [bhyve console: -l com1,/dev/nmdm-win10ltsc.1A]

Jan 17 13:08:48: starting bhyve (run 1)

Jan 17 13:08:50: bhyve exited with status 134

Jan 17 13:08:50: stopped

 

# pciconf -lv |grep -EC 2 "(USB 3|Audio)"

ppt1@pci0:0:20:0:       class=0x0c0330 rev=0x31 hdr=0x00 vendor=0x8086 device=
0xa12f subvendor=0x8086 subdevice=0xa12f

    vendor     = 'Intel Corporation'

    device     = '100 Series/C230 Series Chipset Family USB 3.0 xHCI
Controller'

    class      = serial bus

    subclass   = USB

--

ppt2@pci0:0:31:3:       class=0x040300 rev=0x31 hdr=0x00 vendor=0x8086 device=
0xa170 subvendor=0x8086 subdevice=0xa170

    vendor     = 'Intel Corporation'

    device     = '100 Series/C230 Series Chipset Family HD Audio Controller'

    class      = multimedia

    subclass   = HDA

 

 

From: Corvin Köhne <corvink@FreeBSD.org>
Sent: Wednesday, January 17, 2024 8:19 AM
To: Michael Sløgedal <michael@sloged.al>; freebsd-virtualization@FreeBSD.org
Subject: Re: bhyve intel 530 integrated graphics error

 

Hi,

 

unfortunately, GPU passthrough is supported by bhyve but not OVMF. So,

you have to use a patched OVMF. The required patch stack is available

at https://reviews.freebsd.org/D41714. An older version and most

probably still working prebuilt version is available at

https://reviews.freebsd.org/D26209.

 

On Wed, 2024-01-17 at 01:18 +0100, Michael Sløgedal wrote:

> Hi,

>  

> I’ve been trying to collect the necessary info online about how to do

> gpu passthru with integrated intel graphics to win10, but can’t make

> it work.

>  

>    1. First tried with just passthru, and after 3-4 reboots, the

> display adapter shows up in win10 guest, but it won’t load properly.

 

Despite some configuration requirements (e.g. always use slot 2) that's

all you need.

 

>    2. Tried adding the hd audio device as well, get bluescreen with

> “memory_management” stop code in guest

 

Shouldn't happen but seems like another issue.

 

>    3. Tried adding a gop rom from

> https://github.com/patmagauran/i915ovmfPkg - host crashed and got

> error below

 

A GOP is only required for pre OS graphics (e.g. grub menu).

 

I highly recommend using the GOP from your host system to avoid damages

or strange issues due to incompatibilities. Unfortunately, it's not

always possible to easily extract the GOP from your host system. Even

Intel recommends to ask your board manufacturer:

https://projectacrn.github.io/3.2/tutorials/gpu-passthru.html#enable-the-gvt-d-gop-driver

 

Some alternative ways to extract the GOP:

 

On Windows try GPU-Z:

https://nvidia.custhelp.com/app/answers/detail/a_id/4188/~/extracting-the-geforce-video-bios-rom-file

On Linux try sysfs:

https://pve.proxmox.com/wiki/PCI_Passthrough#The_.27romfile.27_option

 

>  

> I’m at a loss what to try next. Any ideas where I’m going wrong?

>  

> # tail /vm/win10ltsc/vm-bhyve.log       

> Jan 17 00:49:02:  [primary disk: disk0.img]

> Jan 17 00:49:02:  [primary disk dev: file]

> Jan 17 00:49:02: dynamically allocated port 5900 for vnc connections

> Jan 17 00:49:02: booting

> Jan 17 00:49:02:  [bhyve options: -c 6,sockets=1,cores=3,threads=2 -m

> 8G -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s

> 2:0,passthru,0/2/0,rom=/vm/win10ltsc/i915ovmf.rom -U 8dff5c4a-b083-

> 11ee-b2cd-78d004259091 -S]

> Jan 17 00:49:02:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s

> 4:0,ahci,hd:/vm/win10ltsc/disk0.img -s 31:6,passthru,0/31/6 -s

> 6:0,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080 -s 7:0,xhci,tablet]

> Jan 17 00:49:02:  [bhyve console: -l com1,/dev/nmdm-win10ltsc.1A]

 

You have to use the `-A` flag. There's an open PR for vm-bhyve:

https://github.com/churchers/vm-bhyve/pull/525/commits/653d01f5b53c0bd8ce707137f67617536de8b1c0

 

> Jan 17 00:49:02: starting bhyve (run 1)

> Jan 17 00:49:04: bhyve exited with status 134

> Jan 17 00:49:04: stopped

>  

> # tail /vm/win10ltsc/bhyve.log  

> pci_fbuf: mmap_memseg failed

> Assertion failed: (mr->name == memp->name), function unregister_mem,

> file /usr/src/usr.sbin/bhyve/mem.c, line 344.

>  

> # uname -a

> FreeBSD yellowfellow 14.0-RELEASE-p3 FreeBSD 14.0-RELEASE-p3 #0: Mon

> Dec 11 04:56:01 UTC 2023    

> root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/G

> ENERIC amd64

 

--

Kind regards,

Corvin