Description:
Add support of GPU Passthrough for integrated graphics of AMD Ryzen V1000 APUs.
Note:
This patch is currently not working on any system.
Prerequisites:
- AMD Ryzen V1000 APU with Vega graphics
How to enable GPU Passthrough:
Use the new "apu-d" device for your graphics card.
Your bhyve config could look like:
bhyve -c 1 -m 4G -HwS \ -s 0,hostbridge \ -s 2,apu-d,4/0/0 \ -s 5,ahci-hd,/root/fbsd/fbsd.img \ -s 6,virtio-net,tap10 \ -s 31,lpc \ -l com1,stdio \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd \ fbsd
Tested Scenarios:
CPU: AMD Ryzen Embedded V1807B
OS | |
Windows | Not Working |
Debian | Not Working |
FreeBSD | Not Working |
Installation Steps:
- Create a FreeBSD image
- Apply this patch to your FreeBSD sources
- Rebuild kernel and bhyve
- Apply following patches of sysutils_uefi-edk2-bhyve_files_2019-07-19.tgz to /usr/ports/sysutils/uefi-edk2-bhyve-csm:
- patch-IntelFrameWorkModulePkg_Csm_LegacyBiosDxe_LegacyBootSupport.c
- patch-IntelFrameWorkModulePkg_Csm_LegacyBiosDxe_LegacyPci.c
- Rebuild /usr/ports/sysutils/uefi-edk2-bhyve-csm
- Start vm with following config:
bhyve -c 1 -m 4G -HwS \ -s 0,hostbridge \ -s 2,apu-d,4/0/0 \ -s 5,ahci-hd,/root/fbsd/fbsd.img \ -s 6,virtio-net,tap10 \ -s 31,lpc \ -l com1,stdio \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd \ fbsd
- Press a key to enter Boot Menu
- Boot your FreeBSD image (Boot Manager -> EFI Hard Drive)
- Build gpu-firmware-kmod, drm-current-kmod and drm-kmod from ports
- load amdgpu
- kldload amdgpu
Known Limitations:
- Detection of VBIOS address only uses VFCT table. drm-kmod/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c contains more options
What I've done so far:
- Extract PCI ROM support from vga-bios patches
- Add an ioctl to get VBIOS from VFCT
- Add an apu-d device
- It's a passthru device
- It maps VBIOS into PCI ROM
- Passthrough VGA-Ports and VGA-Memory
- Add a dummy pci device to allow shadowing of OpROM
Known Issues:
- Load of amdgpu driver fails with following message:
<6>[drm] Found VCN firmware Version ENC: 1.9 DEC: 1 VEP: 0 Revision: 28 <6>[drm] PSP loading VCN firmware <6>[drm] reserve 0x400000 from 0xf43f800000 for PSP TMR <4>[drm] psp command failed and response status is (0x0) [drm ERROR :psp_hw_start] PSP load asd failed! [drm ERROR :psp_hw_init] PSP firmware loading failed [drm ERROR :amdgpu_device_fw_loading] hw_init of IP block <psp> failed -22 drmn0: amdgpu_device_ip_init failed drmn0: Fatal error during GPU init <6>[drm] amdgpu: finishing device. <6>[drm] amdgpu: ttm finalized Warning: can't remove non-dynamic nodes (dri)! device_attach: drmn0 attach returned 22