Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jun 2025 09:17:27 +0200
From:      Stephan Althaus <Stephan.Althaus@Duedinghausen.eu>
To:        virtualization@freebsd.org
Subject:   Re: bhyve: GPU passthrough for Nvidia cards
Message-ID:  <1e7c671d-8297-4dc2-bc10-9cc66aac28f1@Duedinghausen.eu>
In-Reply-To: <a8ec0352318568f747cac3133c4e008ecdd85f60.camel@FreeBSD.org>
References:  <4785074a005d66ed92e5670b9fa4ce45a5d65eba.camel@FreeBSD.org> <c0cf8b11-3e21-4296-860c-17b87c9f2588@Duedinghausen.eu> <a8ec0352318568f747cac3133c4e008ecdd85f60.camel@FreeBSD.org>

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

On 6/27/25 08:38, Corvin Köhne wrote:
> On Thu, 2025-06-26 at 16:49 +0200, Stephan Althaus wrote:
>> On 6/26/25 15:07, Corvin Köhne wrote:
>>> Hi,
>>>
>>> I'm currently experimenting with GPU passthrough for Nvidia cards. All I
>>> have to
>>> do to make it work with Ubuntu guests, is setting the INTPIN register to any
>>> value instead of just 0x00. Unfortunately, I'm unfamiliar with PCI legacy
>>> interrupts and how they work. The INTLINE register is set to 0xFF
>>> (unconnected).
>>> So, is it safe to set the INTPIN register or what has to be done for it to
>>> work
>>> as expected?
>>>
>>> Any help would be appreciated.
>>>
>>>
>> Hi!
>>
>> You surely mean 'newer' NVidia cards, as my GT1030 works with FreeBSD
>> 14.2 Host and ubuntu guest, NVIdia driver 570, (and Win guest btw)
>> out-of-the-box, no kernel/driver modding...
>>
>> Regards,
>>
>> Stephan
>>
>>
> FYI, I'm working on a desktop system with an RTX A500 on 15.0-CURRENT.
>
> Ubuntu dmesg reports "NVRM: Can't find an IRQ for your NVIDIA card!" by default.
> Setting the INTPIN register solve this issue and the card can be detected by the
> nvidia-smi command. However, as mentioned in my initial post, I'm not sure what
> has to be emulated to be able to set the INTPIN in a sane way.
>
>
Hi!

I am sorry, i have no knowledge on that topic, how that works in detail.

What i can say from my recent tests on various hosts/guests, with my 
GT1030, that the GPU mostly has INT_PIN 0x01, and the audio device 
always INT_PIN 0x02.
I can't say for sure if it is 'always' because i don't think i have log 
files for each combination :-/


00:08.0 VGA compatible controller: NVIDIA Corporation GP108 [GeForce GT 
1030] (rev a1) (prog-if 00 [VGA controller])
     Subsystem: Micro-Star International Co., Ltd. [MSI] Device 8c98
     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx+
     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- 
<TAbort- <MAbort- >SERR- <PERR- INTx-
     Latency: 0, Cache Line Size: 64 bytes
     Interrupt: pin A routed to IRQ 45


00:08.1 Audio device: NVIDIA Corporation GP108 High Definition Audio 
Controller (rev a1)
     Subsystem: Micro-Star International Co., Ltd. [MSI] Device 8c98
     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-
     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- 
<TAbort- <MAbort- >SERR- <PERR- INTx+
     Latency: 0, Cache Line Size: 64 bytes
     Interrupt: pin B routed to IRQ 22


With the AMD RX 6400 there is the same pattern: PIN A to the GPU, PIN B 
to the audio device..

I am not shure where the INT_PIN gets set/mapped, in the bhyve command 
or by the BHYVE_UEFI BIOS, or by the guest OS (?)

If you need some special info, i will happily assist and startup my BSD 
host and see...

Regards,
Stephan





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1e7c671d-8297-4dc2-bc10-9cc66aac28f1>