Page MenuHomeFreeBSD

bhyve: assign a valid INTPIN to NVIDIA GPUs
AcceptedPublic

Authored by corvink on Thu, Aug 14, 6:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 6, 6:54 PM
Unknown Object (File)
Sat, Sep 6, 4:51 PM
Unknown Object (File)
Sat, Sep 6, 4:30 PM
Unknown Object (File)
Sat, Sep 6, 2:19 PM
Unknown Object (File)
Fri, Sep 5, 5:31 PM
Unknown Object (File)
Fri, Sep 5, 5:08 PM
Unknown Object (File)
Fri, Sep 5, 4:50 PM
Unknown Object (File)
Fri, Sep 5, 4:26 PM

Details

Reviewers
jhb
markj
Group Reviewers
bhyve
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 66221
Build 63104: arc lint + arc unit

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.Mon, Aug 18, 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.