Regarding Linux inside a KVM/QEMU VM using a Ryzen CPU

Hello Everyone,

During some testing I discovered some odd compatibility issues when using the default Ryzen CPU profile with KVM/QEMU (Either EPYC or EPYC-IBPB)

This came up when I was trying to run a Windows Game called “Code Vein” which at the start seemed to be just unable to run with Proton. But some of my other systems running Linux OSes were able to boot the game fine, difference being they weren’t VMs.

Going back to my KVM/QEMU machine I was able to get the game to run correctly by changing the CPU Profile on QEMU/KVM to “qemu64” from the default host option.

With this I would like to find out if there is something I need to add to the EPYC or EPYC-IBPB CPU profiles to get them to function correctly, or should I leave it on qemu64, I am still new this but I have been enjoying the adventure :slight_smile:

My current virtualised system:
OS: Ubuntu 20.04
CPU: AMD Ryzen 3900X (Using 8 cores and 12 threads)
GPU: AMD Radeon R9 290X 4GB
RAM: 16GB (of a total 32GB)

Regards,
Matt

are you doing gpu passthrough? can you run other (linux native) games on the vm?

If memory serves, the EPYC CPU configuration options have fewer instructions available than host CPU configuration options. You can add the necessary ones manually in the XML, but I’m not sure what the EPYC CPU configuration options provide that the host or “qemu64” CPU configuration options don’t (I’m not exactly all that experienced myself).

Very sorry for the delay in the reply, currently using a GPU passthrough config, normal native Linux games run fine either using the Epyc IBPB or qemu64,

But Code Vein is the only game I have found so far that has the problem. Pretty much all other Windows only games run on my Ubuntu system

Same here, thanks to this channel and forum I have gotten this running, deferentially has been a great experience and overall there is a solution (using qemu64) but I just wanted to make sure I wasn’t getting cheap on solving an issue.

I will say you make a good point around the instructions and potentially not being all available when using the Epyc-IBPB option :thinking:.

Also sorry for the delay in replying, didn’t think anyone was reading. Cheers for this though :blush:

You should try to use host-passthrough or host-model to tell the VM the right cpu instructions and cpu family. I also had problems with Epyc-IBPB as it didn’t let mee boot an older W10LTSC iso. After setting it to host-passthrough it told the VM that it’s running a Ryzen 5 1600 and everything worked since! It should also make the VM faster in some regards as qemu64 doesn’t passthrough all the instructions as said earlier! :wink:

Agreed.

After revisiting QEMU in the past few days for the purposes of having Android x86 with passthrough of GPU instructions (3D hardware acceleration in a virtualised environment, using VirGL in this case) and comparing QEMU’s performance with that of VirtualBox when it comes to providing an optimal virtual machine to run Windows XP in (VirtualBox wins, at least for AutoCAD 2007 and CATIA V5R16; I tried all three virtual GPU options in QEMU, with QXL and 64MiB of VRAM providing the best performance in QEMU), I have refreshed my memory on the matter.

In short, “EPYC” provides a minimal set of processor instructions, while “qemu64” provides the bare minimum to get an operating system to boot and function normally. Note that, as per the manual page, these various CPU options are meant for greater ease of migration across different hosts and/or for greater compatibility with many different host CPUs. If you don’t need to move the virtual machine between computers, then just go with “host-passthrough” and call it a day.

SlenderJim, good luck in your endeavours and have a nice day!

I have one question and one remark.

  1. You set twelve threads in the CPU topology. That means that each core has twelve threads, as that setting sets the number of threads per core.
  2. Does Code Vein not work with the host CPU configuration?
1 Like
  1. Cheers for that one, personally didn’t know that was what they were going for with the logic, tbh never saw any performance issues either. But that does make more sense as I didn’t know why setting the cores and threads would give me a Max of 96 available. (My bad on this one)

But I will be honest I have had no issues even with this setup like so.

  1. Code Vein will not work if you use the host CPU configuration check box with a Linux Vm, from my experience. But will work fine on the Windows VM

UPDATE:

After changing the CPU Cores and Threads to the correct values for the logic of KVM/QEMU, I was able to fix the issue with Code Vein.

Cheers @elsandosgrande for your big help.

The biggest thing was I wouldn’t have guessed it was the CPU’s Core and Thread setting as everything else wasn’t suffering any issues.

Cheers again to the guys as well for your inputs :+1:t2:
@reavessm
@modzilla

Overall just make sure you check your CPU’s Core and Thread settings with KVM/QEMU :slight_smile:

2 Likes

You’re welcome and have a nice day!