V-Sync oddity with Rivatuner installation and RetroArch with Vulkan driver

Discussion in 'Rivatuner Statistics Server (RTSS) Forum' started by Ryunam, Jun 1, 2020.

  1. Ryunam

    Ryunam New Member

    Messages:
    7
    Likes Received:
    1
    GPU:
    RTX 2070 Super
    Hello, I would like to first of all thank Unwinder for developing and maintaning RTSS. Like many others, I have to say that Scanline Sync especially is a terrific feature and I have been using it ever since it was first implemented to reduce input latency to a satisfying degree on a non-Gsync monitor. I'm very grateful for that and for the amount of work that it most certainly required.

    I've decided to register and post here because of an issue that me and a few others are desperately trying to wrap our head around.

    What happens is that there is apparently a conflict between RetroArch, a popular frontend for the libretro emulator API, and Rivatuner Statistics Server that is causing its Vulkan renderer specifically (and only the Vulkan one) to drop Vsync when performing certain steps:
    • switching in RA from Fullscreen mode to Windowed mode, then back into Fullscreen mode;
    • loading some content in RA with the Vulkan video driver, then closing it and loading a second piece of content.
    What happens on a few Windows 10 installations (as reported by other users as well) is that when doing the steps above Fullscreen Vsync is dropped, the RA Menu starts running at an unthrottled framerate and gameplay starts showing stutter and frametime deviation. As previously mentioned, this only happens with the Vulkan renderer: RetroArch has several other internal video drivers (for example OpenGL) and the issue does not come up with those.

    You can also notice that the issue is happening by pressing the Volume Mute keyboard button. Normally the volume widget would not appear over the RA window, indicating that it's running in Exclusive Fullscreen, but when this problem occurs the widget shows up over the window in fullscreen mode.

    Now, after a lot of trial and error on my system I have narrowed it down to a problem with RTSS, but here is the weirdest thing that led me to open a thread here.

    This happens even by just installing MSI Afterburner or standalone RTSS, regardless of whether the software is running in the background or starting automatically with Windows.

    If I uninstall RTSS completely (removing also the profiles) then the problem will not occur and I will get perfect Vulkan performance.
    If I just install RTSS, even if I manually exclude the RetroArch executable afterwards, or terminate the RTSS process and prevent it from autostarting with Windows, the issue will still resurface everytime with Vulkan. I have tried every single option in RTSS, but no results so far.

    So, long story short (sorry for the long explanation!): is there a way to manually block / allow whichever injection / installation RTSS may be doing that is causing this Vulkan renderer to lose its mind?

    Thank you in advance, hopefully something can be figured out about this.

    --------------------------

    My specs:
    CPU - i7 4790K
    GPU - RTX 2070 Super with Nvidia driver version 445.98
    OS - Windows 10 x64 2004, recently clean-installed

    Versions of Rivatuner tested: 7.2.2 with MSI Afterburner and standalone 7.3.0 beta 4
     
    Last edited: Jun 1, 2020
  2. Ryunam

    Ryunam New Member

    Messages:
    7
    Likes Received:
    1
    GPU:
    RTX 2070 Super
    Adding another detail that I just noticed. I'm currently using version 7.3.0 beta 4 of RTSS and, if I rename the "Vulkan" folder under C:\Program Files (x86)\RivaTuner Statistics Server to something else, the problem goes away. It resurfaces when I rename that folder back to "Vulkan". So perhaps the RTSSVkLayer DLL files and RetroArch are not playing nicely together.
     
  3. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    15,737
    Likes Received:
    3,187
    Cannot help with that, sorry. RTSSVkLayer are passive bootstrap layers that do nothing but passing through and saving Vulkan device/swapchain creation parameters. I have no ideas what RetroArch is doing and why standard Vulkan layer break its functionality (if they do).
     
  4. Ryunam

    Ryunam New Member

    Messages:
    7
    Likes Received:
    1
    GPU:
    RTX 2070 Super
    I understand, thank you. I'm passing the word on to the RetroArch developers to hopefully understand what is causing this.

    Just a partially related question: is there any other workaround you would suggest for now to prevent RTSSVkLayer from being called at all with RA? Like I said before, I'm currently renaming the Vulkan folder on 7.3.0 beta 4 of RTSS and this seems to do the trick, but I'm wondering if there's a cleaner and more appropriate way while this is investigated further.
     

  5. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    15,737
    Likes Received:
    3,187
    Implicit Vulkan layers are inntended to be permanently active by design of API, so there is no cleaner and appropriate way. Alternate way to restrict a layer is disable_environment variable referenced in corresponding JSON.
     
    Ryunam likes this.
  6. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    15,737
    Likes Received:
    3,187
    I think I nailed it down. That's definitively a bug in that tiny RTSS Vulkan bootstrap layer, which resulted in leaking Vulkan instance & device handles. So the application performing full Vulkan context reinit on display mode switch like RetroArch couldn't get true exclusive fullscreen mode after entering it once and destoying that Vulkan context. New beta with a fix will be available in the next couple days.
     
    Last edited: Jun 3, 2020
  7. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    15,737
    Likes Received:
    3,187

Share This Page