VFIO: Bizarre VM only crash in game (Apex Legends) (Help Needed)

Hello Level1Techs forum. I’m a long time lurker, and first time poster, so apologies if this is in the wrong section.

I’ve had a VFIO passthrough setup for the past 2 or 3 years, using Arch with a GTX970 as the hypervisor. I pass 3 out of 4 cores of my i7 Skylake (with corresponding hyperthreads) over to my Windows10 VM. My VM has direct access to raw disks via SATA passthrough, allowing dual boot. Lastly, I’m blacklisting the AMD RX480 GPU, Intel network adapter, and dedicated USB PCI hub from the linux kernel. Only the VM can touch those.

I have played many titles at >100FPS with no problems at all. Rainbow 6 Siege, Overwatch, Monster Hunter World, et cetera, all play perfectly fine.

I was unable to play the game Apex Legends in a VFIO VM without it constantly crashing (bad_module_info), micro-freezing (causing disconnects), or dumping to desktop with no message. The Windows Event log doesn’t disclose anything useful.

The VM is otherwise stable, it’s only this game that stops responding.

The odd part is that when I dual boot into Windows 10 directly (since I passthrough SATA controllers), the game runs perfectly fine. No freezing, no crashes, nothing.

The only thing architecturally different is

  • Windows is running outside of qemu
  • i7 has 4c/8t (over 3c/6t)
  • Technically has access to the GTX970 (though it’s explicitly disabled in Device Manager).
  • Direct access to 32GB of mem (instead of 16GB of hugepage-reserved mem)
  • Lower DPC latency

There are many people on the EA forums complaining about the crashes on their system. The odd part is that I can make my problem go away simply by dual booting.

I’m leaning towards it possibly being related to high DPC latency, and my next troubleshooting step will be to run the game with pinned VM cores + isol_cpus.

Has anyone else had a problem similar to this before?
Does anyone here play Apex Legends in their VFIO VM?

1 Like

Same issue with me. Passing through a GTX 1080ti on a 5820k. Game constantly freezes and disconnects in the VM, but works perfectly when dual booting

1 Like

Seems there’s quite a few reports of crashes on bare metal as well on the Nvidia forums: https://forums.geforce.com/default/topic/1097787/apex-legends-completely-trashing-rtx2080ti/

Are you running your VM with the hypervisor flag enabled or disabled?

I am getting the same issue but on Ryzen 5 2600+ and passing through an RX480 (although this has another issue where it is getting red hot).

Event Viewer is useless on a good day, but there is nothing there. Easy Anti Cheat logs show nothing. I do get an issue where i have no sound on start up, then after the EA logo it just goes black. If i get past that im good for 20-40mins.

I haven’t tried dual booting, but im interested in if you fixed it with “pinned VM cores + isol_cpus” and if that worked, how do i do that?!

I personally think this is NOT related to the Passthrough.
I’ve been getting similar Problems on native Windows. On Hardware. On Launch day i’ve had problems even getting through the tutorial withour crashing.
With my Friends we are experiencing the “random shutdown without message” at least 2-4 times a day on various PCs.

I feel this Game is just pretty buggy in itself and it might not be related to playing it in a VM…

@domsch1988,

I know the game is buggy but I can almost entirely eliminate the problem by dual booting.

I get consistent crashes while in my VFIO VM. Every single match, I will crash. Sometimes due to particle effects, other times just dumped to desktop.

To date, by dual booting, I’ve only crashed once, ever.
This game has forced me to dual boot, unfortunately.
Something about running the game in a higher latency context exacerbates the problems with their engine.

Pinning qemu processes to CPU cores improves performance by ensuring the CPU cache is utilized as much as possible.
You must first enable the kernel parameters ‘isol_cpus’, ‘nohz_full’ and ‘rcu_nocbs’
Here is an example on how to do that.
Note: You don’t have to do the chrt step mentioned. Pinning your processes in the below step will handle distributing the process per core.

Next, you can pin your CPUs by editing your config through $ virsh edit
Here is an example for Intel
An example for AMD

None of the steps so far helped with stability. I still crash on Apex Legends unless I’m dual booting.

Thanks, I’ll take a look at these over the weekend and report back. I also still have NPT disabled, looking at that arch wiki I can enable it on above 4.9.

I got it working for me and wrote a guide on it, this should help you.

Apex Legends 100% cpu fix