Single GPU passthrough - patch script

Migsi

Dabbler
Joined
Mar 3, 2021
Messages
40
Hello folks,

as I often see questions popping up about single GPU passthrough in Scale, I felt like collecting all bits and pieces related to this issue:

At the beginning of April, @jahf took some of his time to investigate this issue and came up with a complete (but now outdated) guide on how to patch the middleware to allow hosts with 1 GPU in total to isolate that GPU. As there was a ticket on IX Jira already, I felt free to link the topic and the ticket, hoping for some accelerated development. Sadly but somewhat understandable, this issue was rated with a very low priority and is not expected to be tackled by IX soon. PRs by the community are welcomed though. I plan to submit a PR as soon as I have enough time to come up with the appropriate code changes; it might take a while though, as I currently worked around this issue using my simple, basic python patch script. It should handle the whole patching process itself, without any intervention needed. Though I can't guarantee you this is working, as it's basically searching and replacing strings along the middelware which might change within newer releases. In any case, use it at your own risk.

Also feel free to fork this, improove it, get the neccessary infos for a PR yourself, or do whatever you want with it :)

Best regards
 

Attachments

  • allow_single_gpu_passthrough.txt
    5.8 KB · Views: 517

bonfire62

Dabbler
Joined
Nov 27, 2022
Messages
21
Sorry to resurrect this old thread, but I just ran the script on my single gpu machine and I'm still seeing this message:
1672683026453.png

Toggling "Ensure display device does nothing. Do I need to have the GPU unplugged from any display as well?
Trying to connect an AMD 5700 XT
 

alucryd

Cadet
Joined
Jan 22, 2023
Messages
2
Looks like the script doesn't work with the latest release. I set up a test machine to be able to easily try video encoding on both intel and nvidia, but TrueNAS completely locks out the intel chipset. It's quite a shame in this day and age to not offer the option of running headless, the required devices in /dev/dri aren't even loaded for the chipset so running a docker directly on the host is useless, that's a few steps backwards compared to anything out there :/
 

alucryd

Cadet
Joined
Jan 22, 2023
Messages
2
The devices not being present were actually due to the kernel being too old, had to pass an extra boot parameter to force i915 to probe the GPU, so that one is not on TrueNAS.
 

Migsi

Dabbler
Joined
Mar 3, 2021
Messages
40
Sorry to resurrect this old thread, but I just ran the script on my single gpu machine and I'm still seeing this message:
View attachment 61820
Toggling "Ensure display device does nothing. Do I need to have the GPU unplugged from any display as well?
Trying to connect an AMD 5700 XT
It is highly probable the script does not work on releases past Anglefish :/ As the upgrade to Bluefin preserved the isolation on my machine, I'm still fine, even though I can't change any related settings to this anymore, as it won't let me save due to this exact error. The script should be fairly easy to fix, though there might now exist more than the previously known locations where this check needs to be patched out.

I still want to provide IX with a proper fix to this, but as it would require unbinding the framebuffer before passing through the card, I don't really know how to proceed. Ideally the framebuffer gets bound to the card again after the VM shuts down, so you never end up with no graphics on the host; at least when no VM runs.
 
Top