F5F Stay Refreshed Software Operating Systems Nixos with vfio and GPU passthrough setup

Nixos with vfio and GPU passthrough setup

Nixos with vfio and GPU passthrough setup

C
catseecoo
Senior Member
662
11-01-2020, 04:38 AM
#1
I attempted to use the instructions from the GPU VFIO guide (https://astrid.tech/2022/09/22/0/nixos-gpu-vfio). I followed them exactly and still didn’t get anything. I even bought the same CPU and motherboard mentioned in the guide, but nothing worked. I tried several other Linux distros with matching kernels and still faced issues. Now I’m starting fresh for the 8th or 10th version, but this time I’m using a new BIOS and everything from scratch. The EFI/BIOS settings are set as follows:

- ADVANCE | XMP-II: ENABLED
- PSSS SUPPORT: ENABLED
- NX MODE: ENABLED
- SVM MODE: ENABLED
- SMT MODE: ENABLED
- AMD fTPM SWITCH: AMD CPU fTPM
- ADVANCE AMD CBS NBIO COMMON OPTIONS: IOMMU ENABLED
- DMA PROTECTION: AUTO
- DMAr SUPPORT: AUTO
- PCIe ARI SUPPORT: DISABLE
- PCIe ARI ENUMERATION: DISABLE
- ENABLE AER CAP: DISABLED
- SRIS: AUTO
- ADVANCE AMD CBS NBIO COMMON OPTIONS SMU: AUTO
- cTDP CONTROL: AUTO
- EFFICIENT MODE EN: AUTO
- PACKAGE POWER LIMIT CONTROL: AUTO
- APBDIS: AUTO
- DF CSTATES: AUTO
- CPPC PREFERRED CORES: AUTO

Paste of relevant logs: boot log, configuration.nix, pre-requisites.nix, vfio-isis.nix, sudo dmesg.

The issue: I can’t attach the VFIO drivers to my GPU. Apologies for any language issues. Anyone can assist?
C
catseecoo
11-01-2020, 04:38 AM #1

I attempted to use the instructions from the GPU VFIO guide (https://astrid.tech/2022/09/22/0/nixos-gpu-vfio). I followed them exactly and still didn’t get anything. I even bought the same CPU and motherboard mentioned in the guide, but nothing worked. I tried several other Linux distros with matching kernels and still faced issues. Now I’m starting fresh for the 8th or 10th version, but this time I’m using a new BIOS and everything from scratch. The EFI/BIOS settings are set as follows:

- ADVANCE | XMP-II: ENABLED
- PSSS SUPPORT: ENABLED
- NX MODE: ENABLED
- SVM MODE: ENABLED
- SMT MODE: ENABLED
- AMD fTPM SWITCH: AMD CPU fTPM
- ADVANCE AMD CBS NBIO COMMON OPTIONS: IOMMU ENABLED
- DMA PROTECTION: AUTO
- DMAr SUPPORT: AUTO
- PCIe ARI SUPPORT: DISABLE
- PCIe ARI ENUMERATION: DISABLE
- ENABLE AER CAP: DISABLED
- SRIS: AUTO
- ADVANCE AMD CBS NBIO COMMON OPTIONS SMU: AUTO
- cTDP CONTROL: AUTO
- EFFICIENT MODE EN: AUTO
- PACKAGE POWER LIMIT CONTROL: AUTO
- APBDIS: AUTO
- DF CSTATES: AUTO
- CPPC PREFERRED CORES: AUTO

Paste of relevant logs: boot log, configuration.nix, pre-requisites.nix, vfio-isis.nix, sudo dmesg.

The issue: I can’t attach the VFIO drivers to my GPU. Apologies for any language issues. Anyone can assist?

S
SirCyaniide
Member
140
11-15-2020, 08:43 PM
#2
Gpu passthrough requires three Iommu features enabled in BIOS settings. The UEFI isn't booting. Blacklist drivers such as nouveau and nvidia/amd, and verify lspci -K if it fails. Disable the audio GPU driver as well. List drivers in VFIO like 0000:0000,1111:1111 (GPU and GPU audio). If you achieved success, consider learning CPU pinning to prevent conflicts between Linux and VM. I managed to get it working with Kubuntu. For NixOS, it's still new to this area—I might try later. Someone shared their configuration and got it done. Reddit link could be useful too.
S
SirCyaniide
11-15-2020, 08:43 PM #2

Gpu passthrough requires three Iommu features enabled in BIOS settings. The UEFI isn't booting. Blacklist drivers such as nouveau and nvidia/amd, and verify lspci -K if it fails. Disable the audio GPU driver as well. List drivers in VFIO like 0000:0000,1111:1111 (GPU and GPU audio). If you achieved success, consider learning CPU pinning to prevent conflicts between Linux and VM. I managed to get it working with Kubuntu. For NixOS, it's still new to this area—I might try later. Someone shared their configuration and got it done. Reddit link could be useful too.

K
KaiSzeC
Junior Member
29
11-16-2020, 03:38 PM
#3
No changes were made to the file for your shared GPU. The command outputs indicate the available CPU and GPU details: `cat /proc/cmdline` lists system commands, while `lspci -k|grep VGA -A5` shows GPU information such as vendor and model.
K
KaiSzeC
11-16-2020, 03:38 PM #3

No changes were made to the file for your shared GPU. The command outputs indicate the available CPU and GPU details: `cat /proc/cmdline` lists system commands, while `lspci -k|grep VGA -A5` shows GPU information such as vendor and model.

L
LogicZah
Junior Member
18
11-16-2020, 03:45 PM
#4
Hey there! Glad you reached out for assistance. I’m excited to share that I’ve successfully implemented it: https://old.reddit.com/r/VFIO/comments/1...n_7_5700x/ Just wanted to reassure everyone it’s achievable. Don’t let anyone assume it’s impossible—just a few adjustments to your UEFI/BIOS settings will make it work.
L
LogicZah
11-16-2020, 03:45 PM #4

Hey there! Glad you reached out for assistance. I’m excited to share that I’ve successfully implemented it: https://old.reddit.com/r/VFIO/comments/1...n_7_5700x/ Just wanted to reassure everyone it’s achievable. Don’t let anyone assume it’s impossible—just a few adjustments to your UEFI/BIOS settings will make it work.