Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Aug 2025 19:07:21 +0200
From:      Wouter Snels <nospam@ofloo.net>
To:        Mark Millard <marklmi@yahoo.com>, peter.garshtja@ambient-md.com, Virtualisation on FreeBSD <freebsd-virtualization@freebsd.org>
Subject:   Re: GPU Passthrough on FreeBSD 14.3(AMD Radeon RX 6700 XT and Debian Linux 12.11)
Message-ID:  <17b83af1-06c7-4e2d-9445-034444b78342@ofloo.net>
In-Reply-To: <3F9D5D27-B5BA-408D-B577-9625080838BB@yahoo.com>
References:  <3F9D5D27-B5BA-408D-B577-9625080838BB.ref@yahoo.com> <3F9D5D27-B5BA-408D-B577-9625080838BB@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help

I haven't passed through a gpu, not sure how a thunderbolt gpu shows up 
but, .. you need to tell freebsd not to attach to that gpu, ..

put something like this in /boot/loader.conf, the numbers below depend 
on what pci slot your gpu is.

#pptdevs="179/0/0 179/0/1"

Note your host system requires a gpu for this to work.

Then pass it on to bhyve. For me the easiest way to manage bhyve from 
console is through vm-bhyve. It also has an command vm passthru

# vm passthru
DEVICE     BHYVE ID     READY        DESCRIPTION
hostb0     0/0/0        No           Sky Lake-E DMI3 Registers
ioat0      0/4/0        No           Sky Lake-E CBDMA Registers
ioat1      0/4/1        No           Sky Lake-E CBDMA Registers
ioat2      0/4/2        No           Sky Lake-E CBDMA Registers

If you done it correctly Ready will show yes

If you check their example config ..

less /usr/local/share/examples/vm-bhyve/config.sample

# passthru0
# Add a pass-through PCI device to the virtual machine. This allows the 
guest
# to access a hardware device no differently than if it was running on bare
# metal. The value of this option is the B/S/F of the appropriate device.
# e.g "3/0/0"
#
# The slot to use in bhyve can be specified as below. This example will
# force the host device 6/0/0 to use slot 2:0 in the guest
#
# passthru0="6/0/0=2:0"
#
# Please note that in order to stop the bhyve host from attaching to the 
device,
# there are some steps required to reserve the device in /boot/loader.conf.
#
# The 'vm passthru' command provides a convinient way of seeing the BSF 
of each
# device in your system, and whether any have been reserved ready for use
# in bhyve
#
# More details can be found in the FreeBSD bhyve wiki pages
#
passthru0=""

And yes your boot loader in your config needs to be uefi, with 
thunderbolt egpu you might need to pass through the entire controller 
just like when you want to pass through an usb device, there is ways 
around that but i doubt this can be done with an egpu.

Regards, ..

Op 29/08/2025 om 05:25 schreef Mark Millard:
> Petru Garstea <peter.garshtja_at_ambient-md.com> write on
> Date: Thu, 28 Aug 2025 17:42:18 UTC :
>
>> I want to mention also that GPU is connected as eGPU via thunderbolt3.
>
> [Do not take the below as claims of an expert. So
> believe folks with expertise if they report I'm
> wrong about anything.]
>
> Mostly this note is about watching out for assuming
> too much of an analogous context with folks that do
> not have thunderbolt involved at all in their
> context.
>
> If any aspect of what you are doing requires FreeBSD to
> support thunderbolt3: I'm not aware that any version
> of FreeBSD claims to support any version of thunderbolt
> yet. Also, if I understand right, the effort is going
> into thunderbolt4+ without initially having general
> backward compatibility with thunderbolt3. (That, of
> itself, makes the thunderbolt4 incomplete, if I
> understand right.)
>
> As I understand, the details even involve if the EFI
> software has builtin support for parts of the handling
> vs. if the operating system kernel must do those support
> activities on on its own. Sometimes some things appear
> to work for some contexts because of the EFI dealing
> with aspects that the kernel does not deal with (yet).
>
> (As I understand, FreeBSD does not yet face the
> alternative of both the EFI and the kernel being able
> to support such and guiding which way things should
> go.)
>
> ===
> Mark Millard
> marklmi at yahoo.com
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17b83af1-06c7-4e2d-9445-034444b78342>