How to apply ACS Override patch (Kubuntu 18.10 & Kernel 4.18.16)

Hey all, sorry if this is a stupid question.

I am extremely new to Linux (working in it for about a month) and am moving over from Windows 10. Ever since I switched, I’m falling more and more in love with it. I still have my windows partition as a back up, but I’m trying very hard to switch solely to Linux. The latest challenge I’m facing is being able to game. I’ve done the research and what I’m going to do a mix of native gaming, WINE gaming, and a VM with a GPU passthrough using VFIO. After a week and a half of work I’ve managed to figure out all problems with VFIO but now that I can create the VM I’m having troubles with my IOMMU groupings. My GPU and companion sound controller are in a group with 4 other devices. I’ve read about a ACS override patch (I’m running on a Xeon E3-1200 controller which I’ve read doesn’t support ACS) and it looks like its extremely hardware specific to me and the one Wendell made looks looks like its only for radeon cards? If I’m wrong about this, I would really appreciate it if someone could help me by providing me a link to a good ACS patch and how to apply it to my kernel

EDIT: changing to kernel 4.19 did not affect the problem at all. Could an earlier kernel help me?

Here are my IOMMU groups so that you can see my issue

PC Specs:

Motherboard: ASRock Z370 Killer SLI/ac

GPUs: GeForce GTX 780, GeForce GTX 1070

CPU: Intel Core i7-8700k @ 3.70GHz


OS: Kubuntu 18.10

Kernel: 4.18.16

With most distros, you have to download the kernel source code, insert the ACS patch, and compile+install the patched kernel.

Since you are running Ubuntu(or spin thereof), there are pre-compiled kernels with the acs patch available here-

Download the kernel and headers, and install them with sudo dpkg -i <file>.deb, obviously substituting the correct path for it. Put pcie_acs_override=downstream in /etc/default/grub in the line GRUB_CMDLINE_LINUX_DEFAULT=" ". Then run sudo update-gruband reboot.

Hopefully, then they will be separated.

If you want to learn to compile your own custom kernel, you can download the patch at the page above. Download the patch for the kernel version you will be compiling, the patch versions are very similar but with minor tweaks.

1 Like

Thank you so much for the response! I got the kernel and my IOMMU groupings are now much more separated to the point where each GPU is in its own group. I had a small problem with the install but I looked at the error and it pointed me to a log where I just had to download a dependency (not sure why they had to print that to a log instead of just on the terminal, but whatever). However now I’m getting very low FPS after reinstalling my proprietary Nvidia driver (390.87) to the point where the entire system will gradually slow down to a halt if given a large work load (like actually creating the VM) and I have to reboot the system. Do you or anyone else have a fix for this?

EDIT: I tried it with the old kernel (that worked fine) and it looks like that is having the same problem now. My windows partition works great however, so it is not a hardware based issue and it is contained to linux

1 Like

I am having issues with the per-compiled acso kernels. They won’t install the proprietary nvidia drivers properly using my RTX 2080ti for the host.

When I try with my Vega 64 as the host, it seems to work but the RTX 2080ti does not get separated into the IOMMU groups properly. The VGA, Audio, USD, and Serial components of the RTX 2080ti all remain in the same IOMMU group. Every other device is split correctly in separate groups.

Is the ACS patch generic from the kernel dev team or are they written by the people applying them?

I would prefer to use elementary OS/Ubuntu for that stability (no rolling updates that could break things) and not having to deal with root permissions every time I want to do something like mounting drives (though installing gnome disks helps with that). However, I may try acso 4.19 or try to compile the kernel with the ACS patch file. If that fails, I’ll probably go back to ubuntu 16.04 or try some version of Arch.

I would recomend starting a new thread with all the info and troubleshooting you have done for the nvidia driver.

You also could try the nvidia-410 driver from this PPA-

It is a generic patch, not hardware specific.

Stuff like not installing properly is why proprietary drivers ideal on linux.

You did enable the patch in grub and reboot before checking the IOMMU groups? The reason for the patch is if you have thing(s) you do not want to passthrough in the same group as your GPU. So if it is the audio and stuff of the GPU, then just pass everything in the group through.

Thanks for the quick reply, I will do that re the thread.

I am actually using the ppa. I’ve had so many issues over the year with nvidia’s *.run drivers that all I use now are community tested and provided drivers.

You did enable the patch in grub and reboot before checking the IOMMU groups? The reason for the patch is if you have thing(s) you do not want to passthrough in the same group as your GPU. So if it is the audio and stuff of the GPU, then just pass everything in the group through.

Yes, I did check the IOMMU groups after rebooting and Vega 64 was split up into 4 groups but the nvidia card had all it’s components under the same group (iommu group 17). I tried running my VM but it kept saying 0000:04.00.00 in group 17 was not valid and I should check to make sure I had separated the groups.
I need to remove the Vega 64 and reinstall kvm and ovmf so the vfio-pci model takes hold of the card. As things stand right now the OS is putting priority on the AMD card even though Nvidia card is in the primary pcie slot. I had to remove it to last night to force the OS to use the nvidia card.

I seem to have broken my Asus Z87-Pro motherboard or at least got it stuck in the A2 IDE Detect error code so probably going to have to buy another motherboard if I can’t fix the A2 issue

My system continues to slow down to an absolute freeze, however I think I may have found the cause. I found this trying to fix my packagekit daemon which has been crashing a lot lately. Look at the pastebin below for my terminal output (its too long to screenshot in 1 shot). If i can fix this I think I may be able to fix the freezing issue (which happens after about 10-20 minutes of basic use) since to me that seems like a graphics problem because cpu load is 2-10% and ram is at 1.5-2 gb at time of freezing.

Is there a way to be able to grab these dependencies? I have no important files on this partition (as it is only a week old) so would it be simpler to just reinstall kubuntu and start over?

Ah! You were replying to me, not Elixir. I’ll start a new thread with the new info if the new graphics driver doesn’t help, thanks for the link to the ppa btw.

I would recomend removing everything nvidia so it switches back to nouveau after a reboot, then rebooting, update+upgrade, then reboot again and try to install the nvidia driver.

The stable nvidia driver and new kernel versions often do not get along. It is mostly on nvidia for not open-sourcing their driver, and partly on the kernel developers for constantly changing the kernel interfaces.

I’ve done that and the graphics problem isnt fixed.

However, I’ve started a new thread for the new problem, thank you for your help with the vfio issue.

Here’s the new thread if you wanna take a look

Update…got my replacement motherboard. Asrock Z97X Killer. Hoped no ACS patching needed but was wrong.
Anyway, I download the acso patch then manually recompiled the kernel following GaryBoltWolf’s old post here

I found a script on github someone had written to apply the patch and update the kernel it worked but I forgot to set the downstream so didn’t think it worked even though it did. You can find the script here

Anyway I manually applied recompiled the kernel on 4.15.18 because I was having one of those forgetful moments. From comments on the github, it seems the issue I was having is a common one with the acso pre-compiled kernels. Using the script or manually compiling yourself fixes this driver issue.

My other issue with the AMD gpu always being made to primary GPU seems to be both motherboard and kernel settings related. I think I had passed the nvida card to vfio initially but didn’t change all the settings back. Then of course the kernel would boot the AMDGPU driver before the vfio

Anyway, figured that out when after getting the new motherboard and reinstalling everything. I had to force amdgpu to stop loading before vfio following wendell’s post here

Now to figure out how to get the Vega 64 to stop the issue it has shutting down when you rebooting or power off the VM, so I don’t have to keep rebooting the entire system or leave the VM permanently on once booted