protonscr

Framerate locked at 59 FPS.

dxvkclosed windows
doitsujin/dxvk#4548 · opened 2024-12-24 by TheDeeGee · updated 2025-02-11 · 33 comments · github
1 matching comments, n / p to jump
TTheDeeGee 2024-12-24 github

Framerate is locked at 59 FPS regardless of settings.

Disabling the FPS limiter and V-Sync in the NVIDIA Control Panel does nothing, nor does setting the game to Unlimited and disabling V-Sync there.

Software information

Borderlands 2, maximum settings.

System information

  • GPU: 4070 Ti
  • Driver: 566.36
  • DXVK version: 2.5.2
  • OS: Windows 10 Pro 22H2
BBlisto91 2024-12-24 github

Hi there. Please attach the log that appears next to the exe

Qqinlili23333 2024-12-26 github

You are using 60HZ display as main display on Windows, right? That should be the normal behavior. On my 64hz display it runs at 63.9fps which is the same behavior. And if I set my 240hz display as main display it can go up to 241fps.
Currently, DXVK only use DWM GDI Copy compose for d3d9 since #4485. In this mode, the frame is rendered and then copied by DWM to display. DWM copy rate is limited by refresh rate, so sometimes DWM may also limit the application to its copy rate since all frames exceed DWM copy rate are dropped and useless.

If your system has multiple displays with different refresh rate and you are using the highest one for gaming, ensure you set the one with highest refresh rate as main display in system settings. Main display is the default display for your system. Your current main display should have a grey tick for "Mak this my main display".
image

If you are using the system I said above, then this is not DXVK's bug and this issue can be closed.

TTheDeeGee 2024-12-26 github

You are using 60HZ display as main display on Windows, right? That should be the normal behavior. On my 64hz display it runs at 63.9fps which is the same behavior. And if I set my 240hz display as main display it can go up to 241fps. Currently, DXVK only use DWM GDI Copy compose for d3d9 since #4485. In this mode, the frame is rendered and then copied by DWM to display. DWM copy rate is limited by refresh rate, so sometimes DWM may also limit the application to its copy rate since all frames exceed DWM copy rate are dropped and useless.

If your system has multiple displays with different refresh rate and you are using the highest one for gaming, ensure you set the one with highest refresh rate as main display in system settings. Main display is the default display for your system. Your current main display should have a grey tick for "Mak this my main display". image

If you are using the system I said above, then this is not DXVK's bug and this issue can be closed.

My Display is 60 HZ (59.950) yes, it's a EIZO CX240.

NVIDIA RTX Remix also uses Vulkan and does not have this behaviour.

If this is the default behaviour of the wrapper, then i'll just ignore that this wrapper exists as it's pretty useless for me then.

Thanks anyway for the explanation.

BBlisto91 2024-12-26 github

It isn't unless vsync is enabled.

Edit: I did a quick check here on Windows with Intel and it seems to be working fine.

Screenshot

image

TTheDeeGee 2024-12-26 github

It isn't unless vsync is enabled.

Edit: I did a quick check here on Windows with Intel and it seems to be working fine.

Screenshot
image

Maybe it's an NVIDIA issue then.

BBlisto91 2024-12-26 github

You can force vsync off by putting d3d9.presentInterval = 0 in a dxvk.conf file next to the exe

TTheDeeGee 2024-12-26 github

You can force vsync off by putting d3d9.presentInterval = 0 in a dxvk.conf file next to the exe

Yeah well, that will mean screen tearing anyways, which is even worse.

I'll just stick to DX9, i have a 4070 Ti anyways, it runs just fine in 4K.

Qqinlili23333 2024-12-27 github

Maybe it's an NVIDIA issue then.

Probably. I can reproduce same behavior on my two NVIDIA devices.
NVIDIA drivers will detect DXVK and apply some "optimization" (you can find DXVK strings in driver files), maybe that's why Intel systems won't have same behavior.
I didn't test on Intel systems as my Intel device is heavily throttled and cannot reach 60 FPS.

BBlisto91 2024-12-27 github

I am not reproducing any issues on Nvidia Windows either fwiw

Screenshot

image

KK0bin maintainer 2024-12-27 github

Make sure you're not running any additional overlays or other applications that somehow hook into games.

TTheDeeGee 2024-12-27 github

Make sure you're not running any additional overlays or other applications that somehow hook into games.

When i first noticed (felt it) no overlay was running. Then the second time i used RTSS to confirm my findings.

Also Vulkan in GZDoom doesn't suffer from this either, it's purely this wrapper.

TTheDeeGee 2024-12-27 github

I think i found out the what the problem was/is.

A mod to change the viewmodel of weapons (make them smaller), which also comes with ddraw.dll in the Win32 folder.

It's not super smooth though, there is camera skipping with mouse movement, which isn't present in DX9.

Qqinlili23333 2024-12-28 github

I have found why I can reproduce this issue.
I am using GSYNC monitors for my system and I have enabled GSYNC support for both window and fullscreen mode. So NVIDIA driver actively limit DWM render rate to ensure GSYNC working in windowed mode since composition is done by DWM.
Move the window to another monitor without GSYNC or disable GSYNC for windowed mode can solve this.
GSYNC is not binded to normal vsync, so vsync off won't solve this issue. In exclusive fullscreen, GYSNC uses another way since DWM won't compose the output (hardware composed or legacy flip) so this limit won't appear.
After disabling GSYNC, the game can now reach over 100 fps on my system.
This won't happen on most native Vulkan games, since NVIDIA put Vulkan games on DXGI swapchain by default now, which makes these games in hardware composed output instead of GDI copy.
Reference: https://forums.blurbusters.com/viewtopic.php?t=10099

@TheDeeGee Are you also using GSYNC?

TTheDeeGee 2024-12-28 github

I have found why I can reproduce this issue. I am using GSYNC monitors for my system and I have enabled GSYNC support for both window and fullscreen mode. So NVIDIA driver actively limit DWM render rate to ensure GSYNC working in windowed mode since composition is done by DWM. Move the window to another monitor without GSYNC or disable GSYNC for windowed mode can solve this. GSYNC is not binded to normal vsync, so vsync off won't solve this issue. In exclusive fullscreen, GYSNC uses another way since DWM won't compose the output (hardware composed or legacy flip) so this limit won't appear. After disabling GSYNC, the game can now reach over 100 fps on my system. This won't happen on most native Vulkan games, since NVIDIA put Vulkan games on DXGI swapchain by default now, which makes these games in hardware composed output instead of GDI copy. Reference: https://forums.blurbusters.com/viewtopic.php?t=10099

@TheDeeGee Are you also using GSYNC?

EIZO CX240, which doesn't have any gaming features. It's 60 Hz photo editing minitor.

Anyways, the problem was a mod for Borderlands 2.

Still isn't smooth though, there is camera skipping with mouse movement, which doesn't happen in DX9.

DDe-M-oN 2025-01-01 github

You are using 60HZ display as main display on Windows, right? That should be the normal behavior. On my 64hz display it runs at 63.9fps which is the same behavior. And if I set my 240hz display as main display it can go up to 241fps. Currently, DXVK only use DWM GDI Copy compose for d3d9 since #4485. In this mode, the frame is rendered and then copied by DWM to display. DWM copy rate is limited by refresh rate, so sometimes DWM may also limit the application to its copy rate since all frames exceed DWM copy rate are dropped and useless.

If your system has multiple displays with different refresh rate and you are using the highest one for gaming, ensure you set the one with highest refresh rate as main display in system settings. Main display is the default display for your system. Your current main display should have a grey tick for "Mak this my main display". image

If you are using the system I said above, then this is not DXVK's bug and this issue can be closed.

this issue doesnt exist at exclusive fullscreen mode.
I've seen in changelog of 2.5.2 that you now force borderless. If that is the case I hope we can force it back to exclusive or we have to stay at 2.5.1

edit: I didnt read the thread fully yet. Ok apparently there might be still a chance to get uncapped fps despite borderless with the vulkan api?
I will check later then. At the moment my pc is busy with a video encode

Ddoitsujin maintainer 2025-01-01 github

Vulkan WSI is fundamentally broken on Windows (HDR does not work, VRR does not work, alt+tab does not work in fullscreen unless we prevent a mode switch, ...), issues like these are outside our control. The only way to improve this situation is to add a D3D12 backend for presentation, but that is not a priority right now.

Qqinlili23333 2025-01-02 github

If that is the case I hope we can force it back to exclusive

Exclusive fullscreen has already introduced tons of compatibility issues that cannot be fixed without complex workarounds which mess the code. That's why it's globally removed now.

Ok apparently there might be still a chance to get uncapped fps despite borderless with the vulkan api?

You can disable GSYNC to get uncapped fps, but with tears. For my own suggestion, uncapped fps only makes your system a heater, it's more important to minimize latency when your system can provide higher fps than refresh rate. An optimized 59fps actually is better than uncapped 300+fps if your monitor is only 60hz. My own tweak: 64.01hz GSYNC compatible monitor, low latency mode on, fps capped 63 with RTSS, vsync off, got 20-25ms latency only in most games.

And I agree with "Vulkan WSI is broken on WIndows", even native Vulkan games may suffer various issues, such as DOOM 2016, which is native Vulkan game without DXGI backend. Some games like RAGE 2 use DXGI backend by default. NVIDIA has some black magic in their driver to wrap Vulkan games on DXGI, but sadly this feature won't work with DXVK so NVIDIA disabled it when DXVK detected.

DDe-M-oN 2025-01-03 github

Vulkan WSI is fundamentally broken on Windows (HDR does not work, VRR does not work, alt+tab does not work in fullscreen unless we prevent a mode switch, ...), issues like these are outside our control. The only way to improve this situation is to add a D3D12 backend for presentation, but that is not a priority right now.

Thats so weird, because Alt+tab works for me in exclusive fullscreen perfectly fine on Windows 10.
Please just make it a config option in the dxvk.conf instead of brute forcing Borderless mode now. Because my NFS HP2 runs with worse fps at borderless and due to that I will stay at 2.5.1 until I can go back to exclusive. Because thats most likely indeed the reason why the fps is lower

@qinlili23333 Please make it optional 🙏

An optimized 59fps actually is better than uncapped 300+fps if your monitor is only 60hz

Thats absolutely not true. Especially on a 60hz monitor you really, really want the uncapped or at least much higher than 60fps

Yes the frames inbetween come teared to you, but you see always the most up to date frame, no matter how teared the frames are inbetween.
It will still be much smoother and much less input latency

Here also nice videos where this is explained

https://www.youtube.com/watch?v=uzp8z1i5-Hc
https://www.youtube.com/watch?v=msOWcvoIC8M&t=158s

Qqinlili23333 2025-01-03 github

Please make it optional

Actually, Windows itself is guadually dropping exclusive fullscreen. Since Windows 10, Windows puts compatible games in borderless window instead of traditional exclusive fullscreen, which is called fullscreen optimization. Windows uses hardware compose - independent flip for these games, so the performance can reach nearlly same as true exclusive fullscreen as the game is composed on dwm result instead of copy by dwm. However, this feature is only for DirectX.
In the future, dxgi d3d12 backend may become a new backend for dxvk on Windows, which can be similar to WIndows fullscreen optimization. But it needs a lot of work, and is not in priority.

Thats absolutely not true. Especially on a 60hz monitor you really, really want the uncapped or at least much higher than 60fps

That's just because some side effects brought by the high fps.
You feel smooth on high fps with 60hz monitor, it's due to the render and display latency is low. However, it's possible to keep low latency with capped fps.
Modern GPU can adjust freq based on the need. Let's consider a GPU model that can render 600fps under 600mhz, so 1mhz means 1fps for this GPU. If fps uncapped, the GPU runs at max freq, each frame needs 1.6ms. However when you cap to 60fps, the GPU thinks there's no need for such high freq, so it downgrades to 60mhz which provides just 60fps at 100% load, so the frame needs 16.6ms. This is why in normal condition you feel smooth with uncapped fps.
However, if you manually force the GPU running at max freq, it still can produce each frame in 1.6ms, then idle for 9*1.6ms, then 1.6ms for another frame. This is the first thing you need to do. This may even lower latency than uncapped on some heavily throttled device such as low-end laptops.

Another thing which produces lags when fps capped is the frame queue. To avoid sudden performance need, many games use a frame queue. Rendered frames are queued before display. This will add frame interval * queue length latency. For example, a 3 frame queue under 60fps means approx 50ms latency. If fps is uncapped, the frame interval is short so this latency can be lower. But if the game is well optimized which doesn't have sudden performance need frequently, or you prefer latency than stable fps, you can minimize this queue. Set low latency mode in Nvidia control panel to Ultra will eliminate this queue in most games, and for some games you may also need to tweak by game console such as Frostbite 3 engine games.

And for some very rare games, the game physics may have different behavior on different fps (may due to div calc precision issue), this may also make you feel different. But this should not happen for most modern games with uncapped fps.

You can use some games with internal latency tracker such as R6S, or use external tool like PresentMon to see your latency. Optimized 60fps should get very similar latency to uncapped fps. Hope these information can help you tweak your games, and enjoy a smooth experience while saving power.

DDe-M-oN 2025-01-03 github

NFS HP2 has the better performance in exclusive and when you dont make the borderless optional I obviously will stay at 2.5.1

I need the better fps for high poly cars where for example a full grid 8th place start with 8 Lamborghini Veneno (high polygon custom car) the fps goes down to 163 (which is AMAZING by dxvk. With dgvoodoo 2 D3D11 output you would have less than 20 in this scenario!!! What kind of magic is this? Its insane.
But I want to keep that 163fps and not getting worse just because you brute force borderless now :-/
As long as windows doesnt brute force borderless itself and I have the better fps in exclusive I will of course prefer it.
This really should be optional.

Also I observed that at least with dgvoodoo, but probably DirectX in general:
In borderless mode the fps rate is limited to screen refreshrate due to the dwm probably doing that.
With my 240hz monitor its not the end of the world, but for 60hz players this is awful too :-/

Qqinlili23333 2025-01-03 github

NFS HP2 has the better performance in exclusive and when you dont make the borderless optional I obviously will stay at 2.5.1

If you really need exclusive fullscreen, I would suggest you to compile your own modified version.
Locate this line: https://github.com/doitsujin/dxvk/blob/8b9b46dfff2130d43a497c3e08bdffb2716a72f7/src/dxvk/dxvk_presenter.cpp#L502
and change the value to VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT, then follow the build instruction as normal. Then you should get your own dlls with exclusive fullscreen enabled.

Sometimes it's not easy to improve performance without breaking compatibility to other games as dxvk is s general project which compatibility is more important. But if you just need it for some specific game, you can create a modified version that only prioritize performance. I sometimes bundle my modified and self compiled version of dxvk in patch when I make patches for some games.
If you want to build it on Windows, I suggest to refer to the Windows workflow file used currently. https://github.com/doitsujin/dxvk/blob/master/.github/workflows/test-build-windows.yml
You need vs2022 and meson, then follow this workflow file.

DDe-M-oN 2025-01-05 github

Why you cant make borderless the default, but possible to change in the dxvk.conf file? I dont understand

Kknock2one 2025-01-07 github

NFS HP2 has the better performance in exclusive and when you dont make the borderless optional I obviously will stay at 2.5.1

If you really need exclusive fullscreen, I would suggest you to compile your own modified version. Locate this line:

https://github.com/doitsujin/dxvk/blob/8b9b46dfff2130d43a497c3e08bdffb2716a72f7/src/dxvk/dxvk_presenter.cpp#L502

and change the value to VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT, then follow the build instruction as normal. Then you should get your own dlls with exclusive fullscreen enabled.
Sometimes it's not easy to improve performance without breaking compatibility to other games as dxvk is s general project which compatibility is more important. But if you just need it for some specific game, you can create a modified version that only prioritize performance. I sometimes bundle my modified and self compiled version of dxvk in patch when I make patches for some games. If you want to build it on Windows, I suggest to refer to the Windows workflow file used currently. https://github.com/doitsujin/dxvk/blob/master/.github/workflows/test-build-windows.yml You need vs2022 and meson, then follow this workflow file.

did this @De-M-oN
https://github.com/knock2one/dxvk_fse_github_actions/releases/tag/latest-butedited
(for my own use and ig for you)
gplasync version
https://gitlab.com/knock2one/dxvk-gplasync/-/releases/oak-a

DDe-M-oN 2025-01-09 github

Thank you. But if they dont make it a toggle, you probably need to rebuild it for every new version :-|

AAidanGG 2025-01-13 github

NVIDIA has some black magic in their driver to wrap Vulkan games on DXGI, but sadly this feature won't work with DXVK so NVIDIA disabled it when DXVK detected.

@qinlili23333 I was able to follow the instructions (https://www.pcgamingwiki.com/wiki/Nvidia_Profile_Inspector#Layer_Vulkan.2FOpenGL_on_DXGI_swapchain) to have DXVK work on DXGI.

This gives me G-Sync on Borderlands 2, using DXVK 2.5.2, with no FSE.

Are there any downsides to following these instructions?

Qqinlili23333 2025-01-13 github

@qinlili23333 I was able to follow the instructions (https://www.pcgamingwiki.com/wiki/Nvidia_Profile_Inspector#Layer_Vulkan.2FOpenGL_on_DXGI_swapchain) to have DXVK work on DXGI.

This gives me G-Sync on Borderlands 2, using DXVK 2.5.2, with no FSE.

Are there any downsides to following these instructions?

For games, in most times it works well. But it will make some applications that have transparent controls no longer transparent but have a black background. And a few vulkan applications may crash.
If you can set per game profile, use per game profile is pretty fine. I wouldn't suggest to enable it in global profile as it may bring unexpected compatibility issues which may be hard to analysis.

Kknock2one 2025-01-13 github

yeah, black ops 3 does not work with this work around :(

BBlisto91 2025-01-14 github

2.5.3 have made Fullscreen Exclusive support return as a opt in. See changelog for details

BBlisto91 2025-02-11 github

@TheDeeGee Friendly ping. Did the config option help your issue?

TTheDeeGee 2025-02-11 github

@TheDeeGee Friendly ping. Did the config option help your issue?

Did manage to fix the FPS, but this Vulkan Wrapper on Windows has framepacing issues and every 5 seconds or so there is a moment of stutter, which is rather distracting.

Or it simply can't handle my 59.95Hz display.

BBlisto91 2025-02-11 github

Are you able to make a video of what you see?

TTheDeeGee 2025-02-11 github

Are you able to make a video of what you see?

Highly doubt it can be obeserved unless you sit infront of my monitor.

Also don't have the game installed anymore, i got fed up with tinkering.

KK0bin maintainer 2025-02-11 github

Well, in that case...

DLLs