Page MenuHomeFreeBSD

bhyve: assign a valid INTPIN to NVIDIA GPUs
ClosedPublic

Authored by corvink on Aug 14 2025, 6:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 5:36 AM
Unknown Object (File)
Sat, Oct 11, 5:36 AM
Unknown Object (File)
Sat, Oct 11, 5:36 AM
Unknown Object (File)
Fri, Oct 10, 10:25 PM
Unknown Object (File)
Mon, Sep 29, 11:30 AM
Unknown Object (File)
Wed, Sep 24, 9:45 AM
Unknown Object (File)
Tue, Sep 23, 9:56 PM
Unknown Object (File)
Thu, Sep 18, 11:27 PM

Details

Summary

While testing GPU passthrough on Nvidia GPUs, I've noticed that it's sufficient
to simply set a valid value for the INT PIN register. Unfortunately, I'm
unfamiliar with PCI legacy interrupts and therefore not sure about resulting
side effects.

Signed-off-by: Corvin Köhne <corvink@FreeBSD.org>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Hmmm, do we not support INTx interrupts for passthrough in general? I guess we don't. There's a chance some guest OS might try to use INTx instead of MSI which won't work. Do you have more context on what is requiring this? Is it a driver in a Windows guest, or some other OS?

Related PR: Bug 288848

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288848

In Bug 288848, a related (quite long) forum thread is linked in its description.

In D51892#1186266, @jhb wrote:

Hmmm, do we not support INTx interrupts for passthrough in general? I guess we don't. There's a chance some guest OS might try to use INTx instead of MSI which won't work. Do you have more context on what is requiring this? Is it a driver in a Windows guest, or some other OS?

So far, I've only tested Linux guests. I'm not sure if the Linux driver tries to make use of INTx or not after applying this patch. What I do see is that it complains about a missing IRQ (take a look into the PR [1]) and this patch causes the message to disappear. Additionally, the GPU will be recognized by tools like nvidia-smi when applying this patch.

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288848

I would maybe just note that this has been tested specifically with Linux guests in the commit message. In particular, that it quiets a warning and allows tools like nvidia-smi to work.

This revision is now accepted and ready to land.Aug 18 2025, 7:22 PM

This patch worked for me as well and doesn't seem to bother Windows guest, but they don't seem to need it like the Linux ones do.

This revision was automatically updated to reflect the committed changes.