bhyve Current state of bhyve Nvidia passthrough?

I'm not going to watch a 35 minute video, create a bug report if you can reproduce it.
I can now confirm that on 15.0p3 this is still an issue.

Rebooting the VM will still make the passed through GPU not work within the guest. This "reset bug" is real and still exists. I will add it to bugzilla.

But you spread misinformation while accusing others of the same, which is *more* than unnecessary.
 
Okay here we go ...

Code:
uname -ar
\
FreeBSD beastie 15.0-RELEASE-p5 FreeBSD 15.0-RELEASE-p5 GENERIC amd64


Code:
#cd /usr/
#rm -rf /usr/src
#git clone https://github.com/beckhoff/freebsd-src /usr/src
cd /usr/src
#git checkout -f origin/phab/corvink/14.2/nvidia-wip
git checkout -f origin/phab/corvink/15.0/nvidia-wip
cd /usr/src/usr.sbin/bhyve
sudo make && make install
\
...
Error

/usr/src/usr.sbin/bhyve/bootrom.c:123:33: error: use of undeclared identifier 'VM_BOOTROM'

  123 |         romptr = vm_create_devmem(ctx, VM_BOOTROM, "bootrom", BOOTROM_SIZE);

      |                                        ^

/usr/src/usr.sbin/bhyve/bootrom.c:177:31: error: use of undeclared identifier 'VM_BOOTROM'

  177 |         if (vm_mmap_memseg(ctx, gpa, VM_BOOTROM, segoff, len, prot) != 0) {

      |                                      ^

2 errors generated.

*** Error code 1


Stop.

make: stopped making "all" in /usr/src/usr.sbin/bhyve

I want to play decent latest title was doing a CachyOS passthrough to play video games


Code:
pciconf -l | grep ppt
ppt0@pci0:8:0:0:        class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1e87 subvendor=0x3842 subdevice=0x2183
ppt1@pci0:8:0:1:        class=0x040300 rev=0xa1 hdr=0x00 vendor=0x10de device=0x10f8 subvendor=0x3842 subdevice=0x2183
ppt2@pci0:8:0:2:        class=0x0c0330 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1ad8 subvendor=0x3842 subdevice=0x2183
ppt3@pci0:8:0:3:        class=0x0c8000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1ad9 subvendor=0x3842 subdevice=0x2183

When using CBSD not reading all of the PPT


Code:
cbsd bhyve-ppt mode=list
\

Configured PCI Passthru devices (4):

 PCI     DRIVER    DEVICE                                  CLASS         SUBCLASS    VM    VENDOR
8/0/3    ppt       (1) TU104 USB Type-C UCSI Controller    serial bus    USB         -     NVIDIA Corporation

I also tried doing it via -S option and launching bhyve it won't launch error is below
Code:
cmd: env LIB9P_LOGGING=/usr/jails/jails-system/cachyos_linux/cbsd_lib9p.log /usr/bin/nice -n 1 /usr/sbin/bhyve -w -H -S
-A -c cpus=8,sockets=8,cores=1,threads=1 -m 8589934592 -H -A -S -u -w -U dd1c24ca-2c4c-11f1-8a0c-7085c25db4b0 -s 0,hostb
ridge   -s 4,virtio-blk,/usr/jails/vm/cachyos_linux/dsk1.vhd,sectorsize=512/4096    -s 5,virtio-net,tap3,mtu=1500,mac=00
:a0:98:c2:1f:00  -s 6,virtio-rnd -s 10:0,passthru,8/0/0 -s 10:1,passthru,8/0/1 -s 10:2,passthru,8/0/2 -s 10:3,passthru,8
/0/3 -s 7,fbuf,tcp=127.0.0.1:5902,w=1920,h=1080 -s 30,xhci,tablet  -s 31,lpc -l bootrom,/usr/local/cbsd/upgrade/patch/ef
i.fd,/usr/jails/jails-system/cachyos_linux/BHYVE_UEFI_VARS.fd,fwcfg=qemu -l com1,stdio     cachyos_linux
-----                                                                                                   
bhyve: PCI device at 8/0/0 is not using the ppt(4) driver                                               
Device emulation initialization error: Device busy                                                     
fbuf frame buffer base: 0x2279fe400000 [sz 33554432]                                                   
Sleep 1 seconds...                                                                                     
Erase is delete.                                                                                       
119: not found                                                                                         
Warning: unable to determine bhyve pid for: cachyos_linux
bstop done in 1 seconds


loader.conf


Code:
#BHYVE setting needed for the cbsd bconstruct-tui
vmm_load="YES"
##Passthough
nmdm_load="YES"
#Bhyve Passthrough
pptdevs="8/0/0 8/0/1 8/0/2 8/0/3"
hw.vmm.amdvi.enable="1"
# Force the IOMMU to be more permissive with BAR mapping
hw.vmm.iommu.enable="1"
hw.vmm.iommu.relaxed_mapping="1"
# Disable the host's EFI framebuffer from "holding" the GPU memory
hw.vga.textmode="1"
machdep.disable_mtrr_setup="1"
# Specific for NVIDIA TU104 on FreeBSD 15
hw.pci.honor_msi_blacklist="0"


============================================================================================

PROBLEM was the IOMMU in BIOS/Motherboard Setting needs Enable.....



I can confirm without Corvin patches
Code:
git checkout -f origin/phab/corvink/15.0/nvidia-wip
(due to error compiling above).


ON 15p5 GPU Pass through work as expected On Linux => was able to pass thru to Linux CachyOS Distro for gaming.
ON 15p5 GPU Pass through work as expected On Microsoft=> was able to pass thru same 2080 Super to Microsoft VM.
 
Last edited:
I can now confirm that on 15.0p3 this is still an issue.

Rebooting the VM will still make the passed through GPU not work within the guest. This "reset bug" is real and still exists. I will add it to bugzilla.

I can confirm the bug, too (15.0p5). Have you already opened a report in bugzilla?
 
Works fine for me, but continuously refusing to provide a bug report or steps for reproduction for your issue is rather annoying...

Okay here we go ... [doesn't follow instructions for how to compile freebsd]

Code:
#cd /usr/
#rm -rf /usr/src
#git clone https://github.com/beckhoff/freebsd-src /usr/src
cd /usr/src
#git checkout -f origin/phab/corvink/14.2/nvidia-wip
git checkout -f origin/phab/corvink/15.0/nvidia-wip
cd /usr/src/usr.sbin/bhyve
sudo make && make install
\
...
Error

/usr/src/usr.sbin/bhyve/bootrom.c:123:33: error: use of undeclared identifier 'VM_BOOTROM'

  123 |         romptr = vm_create_devmem(ctx, VM_BOOTROM, "bootrom", BOOTROM_SIZE);

      |                                        ^

/usr/src/usr.sbin/bhyve/bootrom.c:177:31: error: use of undeclared identifier 'VM_BOOTROM'

  177 |         if (vm_mmap_memseg(ctx, gpa, VM_BOOTROM, segoff, len, prot) != 0) {

      |                                      ^

2 errors generated.

*** Error code 1


Stop.

make: stopped making "all" in /usr/src/usr.sbin/bhyve
That's not how it's done, you cant just build bhyve like that, do a buildworld and buildkernel if you have no idea what you're doing. Don't overcomplicate things yet.
 
I can confirm the bug, too (15.0p5). Have you already opened a report in bugzilla?
It is not really a bug, it is more like a lack of feature in GPU card. Most consumer GPUs do not support Function Level Reset (FLR) properly or do not support it at all. Sometimes it is possible to reset those cards using various hacks.
 
Works fine for me, but continuously refusing to provide a bug report or steps for reproduction for your issue is rather annoying...


That's not how it's done, you cant just build bhyve like that, do a buildworld and buildkernel if you have no idea what you're doing. Don't overcomplicate things yet.
You sound like an idiot.... And a script kiddie.

Educate yourself please c-c-c-c
 
Good evening everyone,
I wonder if anybody can advise me what to do. I used to run FreeBSD 14.X version with 2x GPUs in my Dell PowerEdge R730xd - one was RTX 3090 and the other one Nvidia Quadro T1000 8GB Low Profile. Both video cards worked fine in Virtual Machines (RTX 3090 in Windows 10, T1000 in Windows 11). Because I did have to trim radiator to fit RTX3090 I decided to remove it from the server and fit it in my desktop PC. I have updated FreeBSD to 15.0-p4. I have fitted new radiator and I bought RTX 5060 so I can use it for moonlight/sunshine with AV1 however when I started VM it was freezing during boot loading when the circle is spinning in Windows. I did have to kill the VM. As soon as I use command
vm poweroff win11gamesvm my system has Kernel Panic and restarts. I was testing a little bit more by installing fresh Windows 11 but it makes no difference. When I have disabled in /boot/loader.conf T1000 I have managed to start VM, get freeze and kill VM with no Kernel Panic. I have updated FreeBSD 15.0 to 15.0-RELEASE-p9
I have pulled out RTX 5060 and tested in my desktop PC - works fine, even under some stress from Cyberpunk 2077. Any tricks and tips how I can successfully pass-through both GPUs to VMs? I can't even find any information on Kernel Panic in dmesg to paste it here to give some clue. I wonder if anybody managed to use RTX 5060 in VM?

pciconf -lv
ppt0@pci0:130:0:0: class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x2d05 subvendor=0x1458 subdevice=0x41a1
vendor = 'NVIDIA Corporation'
device = 'GB206 [GeForce RTX 5060]'
class = display
subclass = VGA
ppt1@pci0:130:0:1: class=0x040300 rev=0xa1 hdr=0x00 vendor=0x10de device=0x22eb subvendor=0x10de subdevice=0x0000
vendor = 'NVIDIA Corporation'
class = multimedia
subclass = HDA


Code:
loader="uefi"

graphics="yes"

graphics_res="1920x1080"

xhci_mouse="yes"

cpu=8

cpu_sockets=1

cpu_cores=4

cpu_threads=2

memory=16G


# put up to 8 disks on a single ahci controller.

# without this, adding a disk pushes the following network devices onto higher slot numbers,

# which causes windows to see them as a new interface

ahci_device_limit="8"


# ideally this should be changed to virtio-net and drivers installed in the guest

# e1000 works out-of-the-box

network0_type="virtio-net"

#network0_type="e1000"

network0_device="tap7"

network0_switch="public"


disk0_type="nvme"

disk0_name="disk0.img"

#disk1_type="nvme"

#disk1_name="gamedrive.img"


# Passthrough

#passthru0="129/0/0=3:0"

#passthru1="129/0/1=3:1"

#RTX 5060

passthru0="130/0/0=3:0"

passthru1="130/0/1=3:1"



# windows expects the host to expose localtime by default, not UTC

utctime="no"

uuid="21280ac9-3329-11ef-bb25-ecf4bbe5c838"

network0_mac="58:9c:fc:03:0b:77"

debug="yes"

Please advise, if there are any patches available or I should take another step please let me know.
Thanks,
Seb
 
Back
Top