Help with Fedora Linux configuration and EGPU Windows VM Passthrough

Hardware:

Batch 6 DIY
i5, 64gb ram
Radeon Rx 5700xt
Coolermaster EG200 EGPU enclosure

Software:
Fedora KDE 35
QEMU/KVM & IOMMU already enabled

Story:

I started using linux 2 years ago now, I’m very far from proficient, but I’m trying. I have been trying to pass through my gpu through my egpu enclosure to my windows vm, I’ve already disabled the amd kernel modules to make sure nothing binds on either side. I’m having trouble figuring out which pci devices to passthrough, doing the gpu + audio has been unsuccessful. I really appreciate any help but if worst comes to worst I’ll just use the spice/qxl rendering for my GIS work; obviously not ideal but I’d rather do it than dual booting.

Brainstorming:

Should I maybe get one of those external pcie express slots and do it that way?
Maybe my gpu is not great for passing through, I have a rx 560 that I could try out, not sure if that’ll change anything though.

Again thanks to anyone for any help they might be able to offer, I’ve been looking at dozens of search results and nothing really seems to address what I’ve been dealing with. Like I said, I’ll make it work with the spice server for my VM but doing GIS work with just integrated graphics rendering is really challenging.

I’ve tried using the common egpu-switcher script but it kept booting into a black screen. I was using X-org so I’m not really sure what could have caused it to fail.

Just realized pastebin is a thing, sorry:

IOMMU Groups

XML

You can confirm vfio-pci is bound to the GPU yes? check lspci -nnk .

You say unsuccessful, what does that mean? Does libvirt give you an error when starting the VM? or does the VM start but the devices are errorring in device manager? what exactly is going wrong?

1 Like

There’s no error, the gpu is just not being utilized. Being passthrough’d to the vm doesn’t redirect the display out put to the gpu and when closing the vm the hardware virtualization halts and I need to do a hard reset.

Trying to switch to the gpu using a xorg script (egpu-switcher from egpu.io) never boots back into the system.

ok, does device manager show the GPU?

did you install the AMD driver from the website?

it also sounds like you might want the vendor-reset dkms module, it is often necessary for older AMD cards to reset more than once.

The gpu isn’t detected in device manager but is detected in my linux vm’s when doing lspci

As far as vendor-reset module, I’ve never fooled around with the kernel and the github isn’t very helpful, so I’m not sure about how to do it

I’m wondering if just getting a cheap external pcie slot might work better, not sure though

Update: Tried using rx 550 & rx 5700xt and same issue

Hi there! Saw your comment on my blog post.

As I may have mentioned in that blog post, I’m running stock Fedora, but have added two COPR repositories to give me better gaming performance when using eGPUs or AMD cards.

I made a post-install script to set Fedora up this way here if interested.

Here’s the COPR repo for the newer kernels and mesa drivers that I use: gloriouseggroll/mesa-aco Copr

Outside of that, I only have the egpu-switcher app installed for initial setup of the eGPU. Those are the only recommendations I have at this time.

1 Like

I’ll check those out, thank you for the help

1 Like

Still having the same issue where it boots into a blank screen after switching the script to auto or external.

I think I’ll just have to wait until the framework team come up with a dgpu for the laptop.

I tried using an nvidia card that I borrowed from a friend and still had the same issue

@FrameworkSupport I’m wondering if there might some correlation with my mainboard, maybe the i7 would fix the issue

Good News !! I got it to work. I started thinking about the different things that need to go just right for it work.

Disabled thunderbolt on my host os
Used a different display port cable to make sure the output was working
Used my 5700xt to avoid the amd reset power bug

All that and the past few updates for the bolt packages have made it work!
I’m now able to pass my egpu through to a VM!

Thank you for everyone who’s tried to help, I’m so happy

1 Like

Solution and discussion also here:

1 Like

This is great, and awesome to see! It would be cool if you could talk about the performance you are seeing in your Window’s VM as a result. I imagine gaming is the primary focus there, or are you using some GPU heavy CAD software that is Windows only?

1 Like

@2disbetter The main focus and use for the VM is ArcGIS pro which is spatial analysis software, gaming is secondary but still being done. What do you think would be good benchmarks for the gaming side of things?

Some things I’ve noticed:

Network issues where webpages need a few reloads to properly work, but that’s a larger issue with KVM as a whole which I haven’t figured out yet

There is the odd time where shutting down the VM hangs and it requires a hard reset of the whole machine, in my experience with this it’s not proven to be too common and generally related with leaving apps open. !Very important not to disconnect the egpu while the VM is shutting down because that will definitely require a hard reset. Unplugging the egpu after the VM has shutdown might be necessary due to the amd reset bug, though since I’m using a 5700xt it should really be related to the egpu enclosure more than the gpu itself