Jump to content

Nixos + vfio / gpu passthrough

I tried following along a guide for GPU VFIO (https://astrid.tech/2022/09/22/0/nixos-gpu-vfio/) I followed it verbatim and got nowhere. I even went ahead and purchased the exact same CPU+Mobo ( AMD Ryzen 7 5700X 3.4 GHz 8-Core Processor & ASRock B550M PG RIPTIDE Micro ATX AM4 Motherboard) advertised on the guide. Still nothing.

 

So I tried 7 other linux distributions (in some cases down to the exact same kernel)... still nothing.

 

I decided to start from scratch for the 8th? 10th? time now, but this time I decided to go back to nixos, but with a fresh bios and fresh everything.

 

EFI/BIOS (Default with some minor changes***):
|- ADVANCE
|----XMP-II = ENABLED***
|----PSS 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 COMMON OPTIONS
|----cTDP CONTROL = AUTO
|----EFFICIENT MODE EN = AUTO
|----PACKAGE POWER LIMIT CONTROL = AUTO
|----APBDIS = AUTO
|----DF CSTATES = AUTO
|----CPPC = AUTO
|----CPPC PREFERED CORES = AUTO

 

Pastebins:
|- boot log (https://pastebin.com/WZ64NT60)
|- configuration.nix
|----pre-requisites.nix (https://pastebin.com/250UfeEE)
|----vfio-isis.nix (https://pastebin.com/AhwTYq39)

|- sudo dmesg | grep -i -e DMAR -e IOMMU && lspci -nnk (https://pastebin.com/jaqpM1u0)

 

The problem: I'm unable to attach the vfio drivers to the GPU. Sorry for the language barrier.

 

Can anyone help me out?

 

Link to comment
Share on other sites

Link to post
Share on other sites

Gpu passthrough needs 3 things

 

Iommu enable which you did and in bios settings and its booting UEFI not boot.

 

Blacklist the drivers like nouveau and nvidia/amd and make sure its not in use (lspci -K) if doesn't work blacklist audio GPU driver too.

 

List drivers in vfio like 0000:0000,1111:1111

Which is GPU and GPU audio.

 

If you succeeded try learn CPU pinning this wil make sure that linux and VM doesn't fight each other for work on cores.

 

I've succeeded with kubuntu.

 

As for nixos still new to that area.

I might try it later.

 

Someone posted their config and succeeded. Reddit link

Maybe it helps for you too.

 

I'm jank tinkerer if it works then it works.

Regardless of compatibility 🐧🖖

Link to comment
Share on other sites

Link to post
Share on other sites

23 hours ago, yn_____ said:

|----vfio-isis.nix (https://pastebin.com/AhwTYq39)

Did you alter this file to match your "shared" GPU?

What re the outputs of cat /proc/cmdline and lspci -k|grep VGA -A5?

Link to comment
Share on other sites

Link to post
Share on other sites

  • 3 weeks later...

@BoomerDutch @Ralphred

 

Hey! thanks guys for the help. I wanted to let you know I managed to get it to work: https://old.reddit.com/r/VFIO/comments/1brrkhc/success_amd_radeon_rx_6900_xt_ryzen_7_5700x/

 

Dropping this here for anyone else looking into this. I don't want anyone to think that it's not possible. It just takes a bit of tinkering and getting your UEFI/BIOS settings set properly.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×