[Bug 258007] bhyve Assertion failed: (!err), function hda_init, file /usr/src/usr.sbin/bhyve/pci_hda.c, line 400

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 23 Aug 2021 13:43:13 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258007

            Bug ID: 258007
           Summary: bhyve Assertion failed: (!err), function hda_init,
                    file /usr/src/usr.sbin/bhyve/pci_hda.c, line 400
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: marietto2008@gmail.com

Hello,I have 3 graphic cards in my PC. The default is the Intel integrated mobo
gpu. I use this as primary. The other are the RTX 2080 ti and the GTX 1060. I'm
trying to make the passthru of my Nvidia RTX 2080 ti from FreeBSD to Ubuntu
21.04 emulated with bhyve. Unfortunately an error that seems a bug prevents me
from completing the task. First of all I want to show you what is the FULL pci
configuration on my PC :

root@marietto:/home/marietto # pciconf -v -l

hostb0@pci0:0:0:0:    class=0x060000 rev=0x0d hdr=0x00 vendor=0x8086
device=0x3e30 subvendor=0x1458 subdevice=0x5000
    vendor     = 'Intel Corporation'
    device     = '8th/9th Gen Core 8-core Desktop Processor Host Bridge/DRAM
Registers [Coffee Lake S]'
    class      = bridge
    subclass   = HOST-PCI

pcib1@pci0:0:1:0:    class=0x060400 rev=0x0d hdr=0x01 vendor=0x8086
device=0x1901 subvendor=0x1458 subdevice=0x5000
    vendor     = 'Intel Corporation'
    device     = '6th-10th Gen Core Processor PCIe Controller (x16)'
    class      = bridge
    subclass   = PCI-PCI

pcib2@pci0:0:1:1:    class=0x060400 rev=0x0d hdr=0x01 vendor=0x8086
device=0x1905 subvendor=0x1458 subdevice=0x5000
    vendor     = 'Intel Corporation'
    device     = 'Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe
Controller (x8)'
    class      = bridge
    subclass   = PCI-PCI

vgapci2@pci0:0:2:0:    class=0x030000 rev=0x02 hdr=0x00 vendor=0x8086
device=0x3e98 subvendor=0x1458 subdevice=0xd000
    vendor     = 'Intel Corporation'
    device     = 'CoffeeLake-S GT2 [UHD Graphics 630]'
    class      = display
    subclass   = VGA

none0@pci0:0:18:0:    class=0x118000 rev=0x10 hdr=0x00 vendor=0x8086
device=0xa379 subvendor=0x1458 subdevice=0x8888
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH Thermal Controller'
    class      = dasp

xhci1@pci0:0:20:0:    class=0x0c0330 rev=0x10 hdr=0x00 vendor=0x8086
device=0xa36d subvendor=0x1458 subdevice=0x5007
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH USB 3.1 xHCI Host Controller'
    class      = serial bus
    subclass   = USB

none1@pci0:0:20:2:    class=0x050000 rev=0x10 hdr=0x00 vendor=0x8086
device=0xa36f subvendor=0x8086 subdevice=0x7270
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH Shared SRAM'
    class      = memory
    subclass   = RAM

none2@pci0:0:22:0:    class=0x078000 rev=0x10 hdr=0x00 vendor=0x8086
device=0xa360 subvendor=0x1458 subdevice=0x1c3a
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH HECI Controller'
    class      = simple comms

ahci0@pci0:0:23:0:    class=0x010601 rev=0x10 hdr=0x00 vendor=0x8086
device=0xa352 subvendor=0x1458 subdevice=0xb005
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH SATA AHCI Controller'
    class      = mass storage
    subclass   = SATA

pcib3@pci0:0:27:0:    class=0x060400 rev=0xf0 hdr=0x01 vendor=0x8086
device=0xa340 subvendor=0x1458 subdevice=0x5001
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI

pcib4@pci0:0:28:0:    class=0x060400 rev=0xf0 hdr=0x01 vendor=0x8086
device=0xa338 subvendor=0x1458 subdevice=0x5001
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI

pcib5@pci0:0:28:5:    class=0x060400 rev=0xf0 hdr=0x01 vendor=0x8086
device=0xa33d subvendor=0x1458 subdevice=0x5001
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI

pcib6@pci0:0:29:0:    class=0x060400 rev=0xf0 hdr=0x01 vendor=0x8086
device=0xa330 subvendor=0x1458 subdevice=0x5001
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI

isab0@pci0:0:31:0:    class=0x060100 rev=0x10 hdr=0x00 vendor=0x8086
device=0xa305 subvendor=0x1458 subdevice=0x5001
    vendor     = 'Intel Corporation'
    device     = 'Z390 Chipset LPC/eSPI Controller'
    class      = bridge
    subclass   = PCI-ISA

hdac2@pci0:0:31:3:    class=0x040300 rev=0x10 hdr=0x00 vendor=0x8086
device=0xa348 subvendor=0x1458 subdevice=0xa0c3
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH cAVS'
    class      = multimedia
    subclass   = HDA

ichsmb0@pci0:0:31:4:    class=0x0c0500 rev=0x10 hdr=0x00 vendor=0x8086
device=0xa323 subvendor=0x1458 subdevice=0x5001
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH SMBus Controller'
    class      = serial bus
    subclass   = SMBus

none3@pci0:0:31:5:    class=0x0c8000 rev=0x10 hdr=0x00 vendor=0x8086
device=0xa324 subvendor=0x8086 subdevice=0x7270
    vendor     = 'Intel Corporation'
    device     = 'Cannon Lake PCH SPI Controller'
    class      = serial bus

em0@pci0:0:31:6:    class=0x020000 rev=0x10 hdr=0x00 vendor=0x8086
device=0x15bc subvendor=0x1458 subdevice=0xe000
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Connection (7) I219-V'
    class      = network
    subclass   = ethernet

vgapci0@pci0:1:0:0:    class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x1e04 subvendor=0x19da subdevice=0x2503
    vendor     = 'NVIDIA Corporation'
    device     = 'TU102 [GeForce RTX 2080 Ti]'
    class      = display
    subclass   = VGA

hdac0@pci0:1:0:1:    class=0x040300 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x10f7 subvendor=0x19da subdevice=0x2503
    vendor     = 'NVIDIA Corporation'
    device     = 'TU102 High Definition Audio Controller'
    class      = multimedia
    subclass   = HDA

xhci0@pci0:1:0:2:    class=0x0c0330 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x1ad6 subvendor=0x19da subdevice=0x2503
    vendor     = 'NVIDIA Corporation'
    device     = 'TU102 USB 3.1 Host Controller'
    class      = serial bus
    subclass   = USB

none4@pci0:1:0:3:    class=0x0c8000 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x1ad7 subvendor=0x19da subdevice=0x2503
    vendor     = 'NVIDIA Corporation'
    device     = 'TU102 USB Type-C UCSI Controller'
    class      = serial bus

vgapci1@pci0:2:0:0:    class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x1c02 subvendor=0x19da subdevice=0x2438
    vendor     = 'NVIDIA Corporation'
    device     = 'GP106 [GeForce GTX 1060 3GB]'
    class      = display
    subclass   = VGA

hdac1@pci0:2:0:1:    class=0x040300 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x10f1 subvendor=0x19da subdevice=0x2438
    vendor     = 'NVIDIA Corporation'
    device     = 'GP106 High Definition Audio Controller'
    class      = multimedia
    subclass   = HDA

nvme0@pci0:3:0:0:    class=0x010802 rev=0x03 hdr=0x00 vendor=0xc0a9
device=0x5403 subvendor=0xc0a9 subdevice=0x2100
    vendor     = 'Micron/Crucial Technology'
    class      = mass storage
    subclass   = NVM

xhci2@pci0:5:0:0:    class=0x0c0330 rev=0x03 hdr=0x00 vendor=0x1912
device=0x0014 subvendor=0x1912 subdevice=0x0015
    vendor     = 'Renesas Technology Corp.'
    device     = 'uPD720201 USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB

Then,according with the wiki : https://wiki.freebsd.org/bhyve/pci_passthru ; I
have masked the pci devices of the graphic card inside the file
/boot/loader.conf like this :

/boot/loader.conf

pptdevs="1/0/0 1/0/1 1/0/2 1/0/3"

but I tried also different combinations,like these :

pptdevs="1/0/0 1/0/2 1/0/3"

or

pptdevs="2/0/0"

or

pptdevs="2/0/0 2/0/1"

and I have rebooted the PC and I've seen that all relevant pci devices have
been masked correctly.

ppt0@pci0:1:0:0:    class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x1e04 subvendor=0x19da subdevice=0x2503
    vendor     = 'NVIDIA Corporation'
    device     = 'TU102 [GeForce RTX 2080 Ti]'
    class      = display
    subclass   = VGA

ppt1@pci0:1:0:1:    class=0x040300 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x10f7 subvendor=0x19da subdevice=0x2503
    vendor     = 'NVIDIA Corporation'
    device     = 'TU102 High Definition Audio Controller'
    class      = multimedia
    subclass   = HDA

ppt2@pci0:1:0:2:    class=0x0c0330 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x1ad6 subvendor=0x19da subdevice=0x2503
    vendor     = 'NVIDIA Corporation'
    device     = 'TU102 USB 3.1 Host Controller'
    class      = serial bus
    subclass   = USB

ppt3@pci0:1:0:3:    class=0x0c8000 rev=0xa1 hdr=0x00 vendor=0x10de
device=0x1ad7 subvendor=0x19da subdevice=0x2503
    vendor     = 'NVIDIA Corporation'
    device     = 'TU102 USB Type-C UCSI Controller'
    class      = serial bus


So,I tried to run the Ubuntu virtual machine with this command :


bhyve -S -c 4 -m 8G -w -H \
        -s 0,hostbridge \
        -s 1,virtio-blk,/mnt/da1p1/vms/os/ubuntu-budgie-gpu/ubuntu-2104-gpu.img
\
        -s 2,passthru,1/0/0 \
        -s 2:1,passthru,1/0/1 \
        -s 2:2,passthru,1/0/2 \
        -s 2:3,passthru,1/0/3 \
        -s 6,virtio-net,tap0 \
        -s 20,hda,play=/dev/dsp8,rec=/dev/dsp8 \
        -s 29,fbuf,tcp=0.0.0.0:5900,w=1440,h=900 \
        -s 30,xhci,tablet \
        -s 31,lpc -l com1,stdio \
        -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
        vm0


sometime the VM freezes,sometimes it gives the error "bhyve Assertion failed:
(!err), function hda_init, file /usr/src/usr.sbin/bhyve/pci_hda.c, line 400"

It seems like a bug or what ? Suggestions to give me ? thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.