Solved Passthrough of GPU into FreeBSD VM

Hi,

Not so sure about the appropriate forum for this question, but it's mostly a GPU/Driver related question…

I'm running a multi-OS/multi-headed workstation based upon VMware ESXi (5.5 for now). It sports multiple Radeon GPUs and USB controllers. I'm running few guest VMs: an old OSX desktop, a windows 7 desktop, both with a dedicated GPU and USB controller provided by the passthrough capabilities of my hardware and ESXi.
I have a third GPU and USB controller that I want to use inside a FreeBSD VM. Unfortunately it does not work.
FreeBSD boots, but fails using the GPU. I've tried various FreeBSD releases (10/11) and flavors (vanilla, PCBSD, TrueOS). My latest adventure was with TrueOS (FreeBSD 12), but the result was about the same with all of these.

At boot time, GPU is properly detected, but the OS cannot use it (see partial dmesg below). I've also tried Ubuntu (14 and 16 LTE) which failed because it was unable to retrieve the BIOS from the graphics card. I suspect the problem is exactly the same with FreeBSD, but Linux gave a pretty explicit error message about it, when FreeBSD is more quiet. (full description about this issue on Ubuntu: https://ubuntuforums.org/showthread.php?t=2344008)

lspci shows properly (I think) the GPU and the USB controller:

Code:
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Curacao XT / Trinidad XT [Radeon R7 370 / R9 270X/370X]
03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]
13:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller

dmesg:

Code:
...
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
isab0: <PCI-ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX4 UDMA33 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1060-0x106f at device 7.1 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
pci0: <bridge> at device 7.3 (no driver attached)
vgapci0: <VGA-compatible display> port 0x1070-0x107f mem 0xec000000-0xefffffff,0xfe000000-0xfe7fffff irq 16 at device 15.0 on pci0
vgapci0: Boot video device
mpt0: <LSILogic 1030 Ultra4 Adapter> port 0x1400-0x14ff mem 0xfeba0000-0xfebbffff,0xfebc0000-0xfebdffff irq 17 at device 16.0 on pci0
mpt0: MPI Version=1.2.0.0
pcib2: <ACPI PCI-PCI bridge> at device 17.0 on pci0
pci2: <ACPI PCI bus> on pcib2
em0: <Intel(R) PRO/1000 Legacy Network Connection 1.1.0> port 0x2000-0x203f mem 0xfd5c0000-0xfd5dffff,0xfdff0000-0xfdffffff irq 18 at device 0.0 on pci2
em0: Ethernet address: 00:0c:29:e7:90:d5
em0: netmap queues/slots: TX 1/256, RX 1/256
pcib3: <ACPI PCI-PCI bridge> at device 21.0 on pci0
pcib3: [GIANT-LOCKED]
pci3: <ACPI PCI bus> on pcib3
vgapci1: <VGA-compatible display> port 0x4400-0x44ff mem 0xd0000000-0xdfffffff,0xfd480000-0xfd4bffff irq 18 at device 0.0 on pci3
hdac0: <ATI (0xaab0) HDA Controller> mem 0xfd4fc000-0xfd4fffff irq 19 at device 0.1 on pci3
hdac0: hdac_get_capabilities: Invalid corb size (0)
device_attach: hdac0 attach returned 6
...
pci4: <ACPI PCI bus> on pcib19
xhci0: <ASMedia ASM1042A USB 3.0 controller> mem 0xfd2f8000-0xfd2fffff irq 16 at device 0.0 on pci4
xhci0: 32 bytes context size, 64-bit DMA
xhci0: Unable to map MSI-X table
usbus0 on xhci0
...
Loading kernel modules:
hdac0: <ATI (0xaab0) HDA Controller> mem 0xfd4fc000-0xfd4fffff irq 19 at device 0.1 on pci3
hdac0: hdac_get_capabilities: Invalid corb size (0)
device_attach: hdac0 attach returned 6
hdac0: <ATI (0xaab0) HDA Controller> mem 0xfd4fc000-0xfd4fffff irq 19 at device 0.1 on pci3
hdac0: hdac_get_capabilities: Invalid corb size (0)
device_attach: hdac0 attach returned 6
hdac0: <ATI (0xaab0) HDA Controller> mem 0xfd4fc000-0xfd4fffff irq 19 at device 0.1 on pci3
hdac0: hdac_get_capabilities: Invalid corb size (0)
device_attach: hdac0 attach returned 6

Any hint/idea to make this GPU work inside the FreeBSD VM?
 
Ok, so I've made a new try yesterday with the latest FreeBSD 12 release. Installing drm-kmod solves the problem. I can now run my FreeBSD desktop VM with dedicated USB ports, dedicated sound card and dedicated discrete GPU.
Still some tuning to do, but it works ok.
 
Back
Top