<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet type="text/xsl" href="/index.xsl"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>./techtipsy</title><link>https://ounapuu.ee/tags/vr/</link><description>Recent content on ./techtipsy, a blog written by Herman Õunapuu.</description><generator>Hugo -- gohugo.io</generator><language>en-GB</language><managingEditor>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</managingEditor><webMaster>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</webMaster><lastBuildDate>Wed, 04 May 2022 08:00:00 +0300</lastBuildDate><atom:link href="https://ounapuu.ee/tags/vr/index.xml" rel="self" type="application/rss+xml"/><item><title>Trying out VR on an AMD Ryzen 4000 series APU</title><link>https://ounapuu.ee/posts/2022/05/04/vr-on-integrated-graphics/</link><pubDate>Wed, 04 May 2022 08:00:00 +0300</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2022/05/04/vr-on-integrated-graphics/</guid><description>A quick and dirty experiment: can the integrated graphics on an AMD Ryzen 4000 series APU run Beat Saber?</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="Trying out VR on an AMD Ryzen 4000 series APU" /><p>You may know that I really like <a href="/posts/2022/01/17/asrock-x300-future-of-desktops/">small, efficient APU-based builds</a>.
At this point in time, they&rsquo;re so close to being a viable mainstream option for
gaming, especially the Ryzen 6000-series mobile APU-s. <a href="https://youtu.be/2_Ik1vgIBN4?t=247">Forza Horizon 5, at
1080p high settings? Yes, they&rsquo;re that good.</a></p>
<p>I don&rsquo;t have the new Ryzen 6000 series APU-s to play around with, but
what I do have is an <a href="https://www.amd.com/en/products/apu/amd-ryzen-5-pro-4650g">AMD Ryzen 5 PRO 4650G</a>
and a <a href="https://www.vive.com/us/product/vive-cosmos/features/">HTC Vive Cosmos VR headset</a>.
I&rsquo;ve noticed that my NVIDIA GTX 1060 manages to hit frametimes of 2-3ms in
Beat Saber while the limit is at 11.1ms (90 Hz), which means that Beat Saber is
probably quite easy to run. But can it run on integrated graphics and still be
playable?</p>
<p>There&rsquo;s been some work done in this area before as well:</p>
<ul>
<li>
<p><a href="https://youtu.be/hDkiLWtnpok">LowSpecGamer tried out Half Life Alyx on a Ryzen 3 3200G</a></p>
</li>
<li>
<p><a href="https://youtu.be/KChRyQniUew">The Mysticle testing Beat Saber on integrated Intel graphics</a></p>
</li>
</ul>
<h2 id="test-setup">
  <a class="heading-anchor" href="#test-setup">Test setup<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Here&rsquo;s a quick rundown of the specs of the test PC:</p>
<ul>
<li>CPU: AMD Ryzen 5 PRO 4650G</li>
<li>GPU: Radeon Vega 7 integrated graphics</li>
<li>RAM: 16GB DDR4-3200 kit</li>
<li>Motherboard: ASRock X570M Pro4</li>
<li>Cooling: adequate</li>
<li>Storage: plenty</li>
</ul>
<p>To get the authentic, out of the box experience, I did not overclock any
component, unless you count using the XMP profile on my memory sticks to run them
at 3200 MT/s as overclocking.</p>
<p>The test PC usually has an NVIDIA GTX 1060 6G inside it, because it&rsquo;s a gaming
PC, after all. In my first test attempt I kept the NVIDIA GPU inside the PC since
I was lazy. I connected my TV to the HDMI port located on the motherboard, and
connected the VR headset to the DisplayPort present on the motherboard. What I
found out was that by default games would still utilize the NVIDIA GPU, passing
the final image to the integrated Vega 7 graphics, which then shows it on the big
screen. This type of setup is commonly found on laptops that have a discrete GPU
in addition to the integrated GPU, I just didn&rsquo;t expect this to work out of the
box on a desktop setup.</p>
<p>To do proper testing, I removed the dedicated GPU, updated the AMD GPU drivers
to the latest available version at the time of writing, and got down to testing.</p>
<h2 id="first-attempt-with-beat-saber">
  <a class="heading-anchor" href="#first-attempt-with-beat-saber">First attempt with Beat Saber<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p><a href="https://beatsaber.com/">Beat Saber</a> is a very popular VR game, and for good
reason. It&rsquo;s the perfect candidate for testing low-end VR gaming as it&rsquo;s not that
complex graphically and even runs on standalone headsets, such as <a href="https://www.oculus.com/quest-2/">the Quest 2</a>.</p>
<p>I set everything up, started the game, and was surprised that it even loaded!
The success stopped there, as I quickly noticed that the resolution used for the
headset was automatically set to the lowest available resolution, resulting in
text that was absolutely unreadable.</p>
<p>Unreadable text didn&rsquo;t stop me, so I navigated to the song list and picked
something familiar. The result? It works, barely.</p>









<figure class="center">
  <a href="/posts/2022/05/04/vr-on-integrated-graphics/media/test-1.jpg">
    <img src="/posts/2022/05/04/vr-on-integrated-graphics/media/test-1_hu_8b0725d86ae3755b.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="First test with Beat Saber on integrated AMD Vega 7 graphics.">

  </a>
  <figcaption class="center">First test with Beat Saber on integrated AMD Vega 7 graphics.</figcaption>
</figure>

<p>The game ran at a very low resolution, and even then the best it could do was
between 45-80 frames per second. As you can see from the screenshot, the
experience was not a fluid one. I could still hit the boxes, but it just didn&rsquo;t
feel good. At least it&rsquo;s somewhat playable, and the headset still rendered my
head movements in 90 Hz, reducing the risk of motion sickness.</p>
<p>Judging by the SteamVR performance statistics, I noticed that it was perfectly
happy with running the game at half the framerate (45 Hz), and unhappy about
inconsistent frametimes.</p>









<figure class="center">
  <a href="/posts/2022/05/04/vr-on-integrated-graphics/media/test-2.jpg">
    <img src="/posts/2022/05/04/vr-on-integrated-graphics/media/test-2_hu_16984ca3597c8074.webp"
     width="1087"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Closer look at the frametimes graph provided by SteamVR.">

  </a>
  <figcaption class="center">Closer look at the frametimes graph provided by SteamVR.</figcaption>
</figure>

<h2 id="test-attempt-2">
  <a class="heading-anchor" href="#test-attempt-2">Test attempt #2<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>To understand the performance fluctuations better, I started up MSI Afterburner
and enabled the on-screen display.</p>
<p>With the second attempt, I also made one important change to the configuration.
I set the TV connected to the machine from 4K resolution down to 720p to avoid
taxing the APU with any extra load.</p>
<p>I launched Beat Saber and while the resolution was still garbage, there was a
notable improvement in the performance.</p>









<figure class="center">
  <a href="/posts/2022/05/04/vr-on-integrated-graphics/media/test-3.jpg">
    <img src="/posts/2022/05/04/vr-on-integrated-graphics/media/test-3_hu_cb1aa1a9787fe068.webp"
     width="1002"
     height="800"
     loading="lazy"
     decoding="async"
     alt="Still not quite ideal, but much more consistent than before.">

  </a>
  <figcaption class="center">Still not quite ideal, but much more consistent than before.</figcaption>
</figure>

<p>The frametimes were much more consistent now and very close to the 90 Hz mark.
It does still stutter, as you can see from the SteamVR performance statistics,
but at least now it&rsquo;s a much more playable experience.</p>









<figure class="center">
  <a href="/posts/2022/05/04/vr-on-integrated-graphics/media/test-4.jpg">
    <img src="/posts/2022/05/04/vr-on-integrated-graphics/media/test-4_hu_c82ed8ff510a57f2.webp"
     width="1280"
     height="611"
     loading="lazy"
     decoding="async"
     alt="Framerate and frametime graphs, courtesy of MSI Afterburner.">

  </a>
  <figcaption class="center">Framerate and frametime graphs, courtesy of MSI Afterburner.</figcaption>
</figure>

<p>From the statistics provided by MSI Afterburner, you can clearly see that the
performance is so close to being playable, with the integrated GPU maxing out
at a somewhat stable 85 FPS, but then dropping down to a more stable 45 FPS
and staying there for a while. The game fluctuates between those two levels of
performance.</p>
<p>You can still call the game somewhat playable, though. It&rsquo;s not the best
experience and you&rsquo;re not going to set any world records while running at half
the refresh rate, but it&rsquo;s <em>something</em>.</p>
<h2 id="apu-s-vr-and-the-future">
  <a class="heading-anchor" href="#apu-s-vr-and-the-future">APU-s, VR and the future<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>The performance increases in APU-s aren&rsquo;t fast enough to catch up with discrete
GPU-s just yet. Relying on system memory that&rsquo;s optimized for latency rather
than memory bandwidth and then sharing that same memory with the CPU is also a
compromise that you cannot work around that easily.</p>
<p>This test shows what the integrated Vega graphics are capable of. With the
release of the Ryzen 6000 series mobile APU-s, the performance of the integrated
graphics has been increased yet again, with the GPU architecture now based on
RDNA 2.</p>
<p>Based on the results of my testing and seeing how the new APU-s perform in games,
I&rsquo;m betting that the new APU-s should be able to run some VR titles at a more
stable 90 Hz on a similar screen resolution.</p>
<p>Is this enough to consider them as a viable option for VR gaming in general?
Probably not. Games like Half Life Alyx can bring the NVIDIA GeForce GTX 1060
to its knees, and that&rsquo;s at the lowest graphics preset! But if you&rsquo;re like me
who spends 90% of their time in VR playing a graphically simple game like
Beat Saber, then it might be an option worth considering, especially in a market
where discrete GPU-s cost an arm and a leg. The great GPU shortage of 2021-2022
is showing signs of easing, but we&rsquo;re not quite there yet.</p>
<h2 id="future-steps">
  <a class="heading-anchor" href="#future-steps">Future steps<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>It&rsquo;s probably possible to improve the APU VR gaming experience by applying some
tweaks and fixes, such as <a href="https://github.com/fholger/vrperfkit">the VR performance toolkit</a>.
However, that won&rsquo;t reflect the out of the box experience that you&rsquo;d get. Casual
VR players are unlikely to go and seek such tweaks out.</p>
<p>Trying to lock the refresh rate to something like 45/60/75 Hz may also improve
the stability of the experience.</p>
<p>For the time being, I will just continue playing VR with a dedicated GPU, but I
am cautiously optimistic about the future of VR on APU-s.</p>
]]></content:encoded></item><item><title>VR, VFIO and how latency ruined everything</title><link>https://ounapuu.ee/posts/2021/12/29/vr-vfio-latency/</link><pubDate>Wed, 29 Dec 2021 06:00:00 +0200</pubDate><author>ihavesomethoughtsonyourblog@ounapuu.ee (Herman Õunapuu)</author><guid>https://ounapuu.ee/posts/2021/12/29/vr-vfio-latency/</guid><description>Alternative title: "Honey, I completely changed my server setup again!"</description><content:encoded><![CDATA[<img src="https://ounapuu.ee/media/cover_hu_4fe4cf2661554252.jpg" width="1200" height="630" alt="VR, VFIO and how latency ruined everything" /><p>I&rsquo;ve been running my <a href="/posts/2021/08/29/testing-gpu-passthrough-on-amd-ryzen-5700g/"><em>all-in-one</em></a>
PC for a while now. It was my desktop, my NAS and my gaming PC.
However, during the next couple of months I kept hitting small bumps along the
road. Most of these were quite straightforward to fix, but there is one that
finally convinced me to go back to a simpler setup.</p>
<h2 id="iscsi">
  <a class="heading-anchor" href="#iscsi">iSCSI<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>As mentioned in <a href="/posts/2021/10/13/diy-cloud-gaming-nvidia-moonlight/">one of my previous posts</a>,
I had set up the storage on my gaming VM over iSCSI. If you don&rsquo;t know what
iSCSI is: think of it like a hard drive that you can hook up to your machine
over the network. This setup had a couple of benefits: the amount allocated to
the VM was flexible and I would always have a snapshot of my game data in case
the Windows VM decided to nuke itself.</p>
<p>What I didn&rsquo;t take into account was the configuration. <code>tgt</code> allows you to
define the IP address of the client machine, which can be seen as an additional
layer of security. My gaming VM has two virtual NIC-s, one pointing to the
actual physical network, and another one to a virtual one. This resulted in the
iSCSI connection being flaky on startup: the disk was not present in the VM on
first boot, but was there after a reboot.</p>
<p>This issue was gone once I removed this restriction from the iSCSI target
configuration on the Linux VM. My best guess is that the iSCSI stack in Windows
might have tried to initiate a connection over the wrong NIC, depending on
whichever one was brought up first.</p>
<p>After &ldquo;solving&rdquo; this issue, it had been smooth sailing.</p>
<h2 id="gpu-audio-issues">
  <a class="heading-anchor" href="#gpu-audio-issues">GPU audio issues<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>When the Windows VM had been on for a while, the HDMI audio output would start
to glitch out after a while, with the audio sounding slow, robotic and garbled.
After doing some research, I found some resources that mentioned enabling MSI
interrupts in Windows. The guide for this can be found over at
<a href="https://forums.guru3d.com/threads/windows-line-based-vs-message-signaled-based-interrupts-msi-tool.378044/">Guru3D forums</a>.</p>
<p>After tweaking the Windows registry settings and reminding myself that I do have
snapshots to fall back to in case I mess up, I got the issue fixed.</p>
<h2 id="gpu-driver-issues">
  <a class="heading-anchor" href="#gpu-driver-issues">GPU driver issues<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>Whenever there&rsquo;s a new big and popular game released, NVIDIA usually releases
an updated version of their GPU drivers. I try to keep my software up to date,
so I usually install these updates when they come out. Just one problem: when I
upgrade the GPU drivers in the VM, the screen will stay black. After some time
passes, I have to force a reboot using <code>virt-manager</code>.</p>
<p>I have not looked into this issue yet as it only happens during driver updates,
but it&rsquo;s definitely an annoying thing to have.</p>
<h2 id="uefi-and-csm">
  <a class="heading-anchor" href="#uefi-and-csm">UEFI and CSM<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>UEFI updates have a bad habit of resetting all the custom settings that you
have made, and at least with the motherboards I have used, the settings cannot
be restored if the backed up settings are from an older UEFI version. This
means that I have to navigate the UEFI quite often to configure all the
settings that I need to have in place for VFIO to work.</p>
<p>There is one setting that I didn&rsquo;t expect to cause that much trouble though:
CSM support. CSM (compatibity support module) is generally enabled by default
and allows you to boot off of legacy operating systems if needed. I don&rsquo;t have
that requirement, so I went ahead and set my boot options to boot in UEFI mode
only.</p>
<p>Reboot, start up Fedora, and boom, anything VFIO related is spewing errors like
crazy.</p>
<p>Turns out that enabling UEFI only mode in UEFI settings somehow grabs the GPU
and causes problems when you try to then pass the GPU to a VM. While in this
mode, I noticed that the GPU was also shown in a separate menu in UEFI settings.
Enabling CSM support fixed this issue for me.</p>
<h2 id="vr-and-usb-issues">
  <a class="heading-anchor" href="#vr-and-usb-issues">VR and USB issues<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>With the situation in the world being less than optimal, I decided to spice up
my gaming setup with the addition of a <a href="https://www.vive.com/us/product/vive-cosmos/features/">HTC Vive Cosmos</a>
in case in-door activities become much more popular suddenly.</p>
<p>First issue: I can&rsquo;t get the damn thing working. My gaming VM setup has the
<a href="https://www.inateck.com/products/inateck-kt4006-dual-port-usb-3-0-pci-express-card-20-pin-connector-no-power-connection">inateck KT4006</a>
passed through so that I can plug peripherals to the PC and make them available
to the gaming VM with ease. After plugging everything in according to
instructions and turning the link box on, I&rsquo;m met with a barrage of USB
connected-disconnected sound effects. 6 or 7 cycles later the sound stops, and
with that do the rest of my USB devices.</p>
<p>I took the USB 3.0 card and tried it in an older machine that doesn&rsquo;t have a
fancy VFIO setup on it. Same issue. However, when connected to an USB 2.0 port,
the setup shows a warning in VIVE Console, but at least it works! Since my PC
literally has no USB 2.0 ports, I had to get a bit creative and plug an USB 2.0
extension cable between the PC and the USB 3.0 cable coming from the link box.</p>
<p>With the help of my friend I got confirmation that the issue is indeed with my
USB ports. I also ordered a different USB PCIe card from inateck, this time the
<a href="https://www.inateck.com/products/pci-e-to-usb-3-0-4-ports-pci-express-card-and-15-pin-power-connector-red-kt4001">inateck KTU3FR-4P</a>.
I made the assumption that since <a href="https://www.vive.com/eu/support/vive/category_howto/headset-not-detected-due-to-usb-issue.html">the VIVE support page also recommends an inateck card</a>,
then they must be fit for purpose.</p>
<p>Nope. The second card apparently has the same chipset and the same issue.</p>
<p>What did end up working was a random VIA USB 3.0 PCIe card, which shows up as
<code>VIA Technologies, Inc. VL805/806 xHCI USB 3.0 Controller</code> on my machine. Just
one issue: it has PCIe device reset issues. If I shut down the Windows VM and
start it up again, I would sometimes get a bunch of <code>IO_PAGE_FAULT</code> errors in
my kernel logs. No worries, guess I&rsquo;ll just avoid rebooting a notoriously
reboot-happy OS.</p>
<h2 id="latency-the-straw-that-broke-the-camels-back">
  <a class="heading-anchor" href="#latency-the-straw-that-broke-the-camels-back">Latency: the straw that broke the camel&rsquo;s back<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>If there&rsquo;s one thing you don&rsquo;t want to see in a VR gaming setup, it&rsquo;s latency.</p>
<p>I&rsquo;ve covered <a href="/posts/2021/09/07/diy-cloud-gaming-vfio-parsec-amd/">the tweaks I&rsquo;ve made to my setup in a previous post</a>.
Turns out that those might not be enough. The <a href="https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Example_with_systemd">CPU isolation using systemd</a>
works well in general, but not with kernel threads.</p>
<p>Whenever I did something IO heavy on an NVMe-based btrfs file system, it would
introduce stutter to the gaming VM. Running a scrub operation on the filesystem
was enough to put a huge load on the CPU, likely due to the raw speed that the
NVMe SSD-s can provide. This results in the gaming VM experiencing stutter
that ruins the whole experience.</p>
<p>Here&rsquo;s an illustration.</p>









<figure class="center">
  <a href="/posts/2021/12/29/vr-vfio-latency/media/normalusage.jpg">
    <img src="/posts/2021/12/29/vr-vfio-latency/media/normalusage_hu_bddd6f0b9c862f0f.webp"
     width="956"
     height="800"
     loading="lazy"
     decoding="async"
     alt="SteamVR performance statistics with a light load on the host system.">

  </a>
  <figcaption class="center">SteamVR performance statistics with a light load on the host system.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2021/12/29/vr-vfio-latency/media/latencyhell.jpg">
    <img src="/posts/2021/12/29/vr-vfio-latency/media/latencyhell_hu_6ffdf367424bccee.webp"
     width="927"
     height="800"
     loading="lazy"
     decoding="async"
     alt="The purple spikes mean that you are having a real bad time right now.">

  </a>
  <figcaption class="center">The purple spikes mean that you are having a real bad time right now.</figcaption>
</figure>










<figure class="center">
  <a href="/posts/2021/12/29/vr-vfio-latency/media/latencynative.jpg">
    <img src="/posts/2021/12/29/vr-vfio-latency/media/latencynative_hu_d9c371c91ecc08fe.webp"
     width="1067"
     height="800"
     loading="lazy"
     decoding="async"
     alt="For comparison: VR performance running natively on Windows 10.">

  </a>
  <figcaption class="center">For comparison: VR performance running natively on Windows 10.</figcaption>
</figure>

<p>Similar issues could be observed whenever I tried to run another VM that
shares the same cores.</p>
<p>I looked into alternative solutions as well, and it does seem to be possible
to also isolate those CPU cores from the kernel. They will probably work to
some extent, but implementing them feels a bit hacky at the moment. I&rsquo;m hoping
that in the future these kinds of tweaks will be exposed as a simple checkbox
in <code>virt-manager</code> itself.</p>
<p>At that point I had enough. If I&rsquo;m not going to be able to use the machine for
other purposes at the same time without experiencing all these issues and
having to work around them, then I&rsquo;ll just go back to a simpler setup. I&rsquo;ll lose
some of the benefits, but at least I don&rsquo;t have to spend time debugging all
these issues.</p>
<h2 id="conclusion">
  <a class="heading-anchor" href="#conclusion">Conclusion<svg class="heading-anchor__icon" viewBox="0 0 24 24" width="0.75em" height="0.75em" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg></a>
</h2>
<p>VFIO and virtualization are still interesting topics to learn about and try
out, but for my use case they are just too limiting. I&rsquo;d imagine that an use
case that didn&rsquo;t have such strict latency requirements would still be able to
run just fine, unfortunately gaming just isn&rsquo;t one of them.</p>
<p>This experience has been quite fun in general, but I&rsquo;m calling quits, at least
for now. The one machine that does it all turned out to be a jack of all
trades, master of none.</p>
]]></content:encoded></item></channel></rss>