Bhyve GPU passthrough

Adam amvandemore at gmail.com
Sat Jun 15 19:13:35 UTC 2019


On Sat, Jun 15, 2019 at 5:52 AM Robert Crowston <crowston at protonmail.com>
wrote:

> I think I am the most recent adventurer, but if you go back a couple of
> years I am only building on material I found discussed in this mailing list.
>
> I do have an nVidia GPU working on Linux under the nouveau drivet. It
> required some changes to the bhyve source; in particular I had to remap the
> 64 bit PCI BAR allocations into the lower 4 GB of the guest’s address
> space. I am not sure if that is a quirk of the AMD processor I’m using.
>
> I think there are a few things that prevent this from working in the
> general case. Probably the most serious is bhyve doesn’t support emulation
> or passthrough of PCI ROMs. I am working on a hack to make that work in my
> spare time. But I am not an official member of the project, just tinkering.
> :-)
>
> The nVidia Windows driver only checks the pending break enable bit on the
> feature flags register to see if it is virtualized (or at least that was
> the case about a year ago). You can readily change that to 0 in the bhyve
> source code. But we are some way from that yet.
>

Hey yes your information both previous and current is helpful.  nouveau
doesn't get me anything so I didn't test it.  Pretty much only goal is CUDA
in the VM, but it seems you are right in that this is a ways off.  There
are some changes relative to my experience vs what you originally
describe.  Maybe part of that are the changes to bhyve 12-stable.  The only
thing that shows in the FreeBSD VM when trying nvidia-smi is:

Jun 15 14:09:38 passthrough kernel: NVRM: GPU 0000:00:01.0: RmInitAdapter
failed! (0x26:0x65:1133)
Jun 15 14:09:38 passthrough kernel: nvidia0: NVRM: rm_init_adapter() failed!

So I guess that is the PCI ROM issue.

If you do work up some patches and need some other testing, let me know.

-- 
Adam


More information about the freebsd-virtualization mailing list