doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
13.18k stars 849 forks source link

Windows 10: Using DXVK forces Windows to change the Refresh Rate of the monitor to 60Hz. #1928

Open Raydonn opened 3 years ago

Raydonn commented 3 years ago

Even though I've manually set my refresh rate to 120Hz and sometimes 144Hz for normal usage in Windows applications, whenever I run the DXVK wrapper on any game, it forces my refresh rate to 60Hz and it remains at 60Hz until I manually change it back to whatever refresh rate I had before.

Makes it kind of hard to enjoy DXVK when my refresh rate gets limited to 60Hz by the wrapper. Edit: If it helps, I have a dual monitor setup that has the second one set at 60Hz. However, even when disconnected, DXVK forces the main monitor to 60Hz.

Software information

Skyrim SE / Guild Wars 2, but I'll just use Skyrim SE as an example.

System information

Apitrace file(s)

Couldn't get APItrace to run alongside DXVK. Crashes everytime.

Log files

dxgi.log SkyrimSE_d3d11.log SkyrimSE_dxgi.log

doitsujin commented 3 years ago

And here's another reason why we don't support Windows. It's a known problem. EnumDisplaySettingsW just doesn't seem to work as expected but I'm not aware of any other way to query display modes (especially the current display more) without using Microsoft's DXGI.

Raydonn commented 3 years ago

Hmm.. Okay. I couldn't find a bug report about it.

Is there no way to do a manual workaround and just select a refresh rate and save it in a config file?

doitsujin commented 3 years ago

No, and I don't plan to add one. I'd rather like to know why this just doesn't work on Windows. I don't have a high refresh rate display and no multi-monitor setup, so I can't reproduce this problem and therefore also not debug it.

Can you run the dxgi-factory test app from DXVK and post the console output? Here's a build if you need: dxgi-factory.exe.zip

Raydonn commented 3 years ago

Sure. Here's the output:

< Adapter 0: AMD Radeon RX 5700 XT Vendor: 4098 Device: 29471 Dedicated RAM: 8185974784 Shared RAM: 17150607360 Output 0: \.\DISPLAY1 Coordinates: 0,0:2560x1440 640x480 @ 60 640x480 @ 60 (native) 640x480 @ 60 640x480 @ 100 640x480 @ 100 (native) 640x480 @ 100 640x480 @ 120 640x480 @ 120 (native) 640x480 @ 120 640x480 @ 144 640x480 @ 144 (native) 640x480 @ 144 720x480 @ 60 720x480 @ 60 (native) 720x480 @ 60 720x480 @ 100 720x480 @ 100 (native) 720x480 @ 100 720x480 @ 120 720x480 @ 120 (native) 720x480 @ 120 720x480 @ 144 720x480 @ 144 (native) 720x480 @ 144 800x600 @ 60 800x600 @ 60 (native) 800x600 @ 60 800x600 @ 100 800x600 @ 100 (native) 800x600 @ 100 800x600 @ 120 800x600 @ 120 (native) 800x600 @ 120 800x600 @ 144 800x600 @ 144 (native) 800x600 @ 144 1024x768 @ 60 1024x768 @ 60 (native) 1024x768 @ 60 1024x768 @ 100 1024x768 @ 100 (native) 1024x768 @ 100 1024x768 @ 120 1024x768 @ 120 (native) 1024x768 @ 120 1024x768 @ 144 1024x768 @ 144 (native) 1024x768 @ 144 1152x864 @ 60 1152x864 @ 60 (native) 1152x864 @ 60 1152x864 @ 100 1152x864 @ 100 (native) 1152x864 @ 100 1152x864 @ 120 1152x864 @ 120 (native) 1152x864 @ 120 1152x864 @ 144 1152x864 @ 144 (native) 1152x864 @ 144 1280x720 @ 60 1280x720 @ 60 (native) 1280x720 @ 60 1280x720 @ 100 1280x720 @ 100 (native) 1280x720 @ 100 1280x720 @ 120 1280x720 @ 120 (native) 1280x720 @ 120 1280x720 @ 144 1280x720 @ 144 (native) 1280x720 @ 144 1280x800 @ 60 1280x800 @ 60 (native) 1280x800 @ 60 1280x800 @ 100 1280x800 @ 100 (native) 1280x800 @ 100 1280x800 @ 120 1280x800 @ 120 (native) 1280x800 @ 120 1280x800 @ 144 1280x800 @ 144 (native) 1280x800 @ 144 1280x1024 @ 60 1280x1024 @ 60 (native) 1280x1024 @ 60 1280x1024 @ 100 1280x1024 @ 100 (native) 1280x1024 @ 100 1280x1024 @ 120 1280x1024 @ 120 (native) 1280x1024 @ 120 1280x1024 @ 144 1280x1024 @ 144 (native) 1280x1024 @ 144 1366x768 @ 60 1366x768 @ 60 (native) 1366x768 @ 60 1366x768 @ 100 1366x768 @ 100 (native) 1366x768 @ 100 1366x768 @ 120 1366x768 @ 120 (native) 1366x768 @ 120 1366x768 @ 144 1366x768 @ 144 (native) 1366x768 @ 144 1600x900 @ 60 1600x900 @ 60 (native) 1600x900 @ 60 1600x900 @ 100 1600x900 @ 100 (native) 1600x900 @ 100 1600x900 @ 120 1600x900 @ 120 (native) 1600x900 @ 120 1600x900 @ 144 1600x900 @ 144 (native) 1600x900 @ 144 1600x1200 @ 60 1600x1200 @ 60 (native) 1600x1200 @ 60 1600x1200 @ 100 1600x1200 @ 100 (native) 1600x1200 @ 100 1600x1200 @ 120 1600x1200 @ 120 (native) 1600x1200 @ 120 1600x1200 @ 144 1600x1200 @ 144 (native) 1600x1200 @ 144 1680x1050 @ 60 1680x1050 @ 60 (native) 1680x1050 @ 60 1680x1050 @ 100 1680x1050 @ 100 (native) 1680x1050 @ 100 1680x1050 @ 120 1680x1050 @ 120 (native) 1680x1050 @ 120 1680x1050 @ 144 1680x1050 @ 144 (native) 1680x1050 @ 144 1920x1080 @ 60 1920x1080 @ 60 (native) 1920x1080 @ 60 1920x1080 @ 100 1920x1080 @ 100 (native) 1920x1080 @ 100 1920x1080 @ 120 1920x1080 @ 120 (native) 1920x1080 @ 120 1920x1080 @ 144 1920x1080 @ 144 (native) 1920x1080 @ 144 1920x1200 @ 60 1920x1200 @ 60 (native) 1920x1200 @ 60 1920x1200 @ 100 1920x1200 @ 100 (native) 1920x1200 @ 100 1920x1200 @ 120 1920x1200 @ 120 (native) 1920x1200 @ 120 1920x1200 @ 144 1920x1200 @ 144 (native) 1920x1200 @ 144 2560x1440 @ 60 2560x1440 @ 100 2560x1440 @ 120 2560x1440 @ 144 Adapter 1: Microsoft Basic Render Driver Vendor: 5140 Device: 140 Dedicated RAM: 0 Shared RAM: 17150607360

doitsujin commented 3 years ago

Ah, sorry, I should have been clearer - please run it with DXVK, i.e. with dxgi.dll next to the executable.

Also, multiline code blocks on github work with three backticks, see here.

Raydonn commented 3 years ago

ah, okay. One moment then

Raydonn commented 3 years ago
info:  Game: dxgi-factory.exe
info:  DXVK: v1.7.3
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
warn:  OpenVR: Failed to locate module
info:  Enabled instance extensions:
info:    VK_KHR_get_surface_capabilities2
info:    VK_KHR_surface
info:    VK_KHR_win32_surface
info:  AMD Radeon RX 5700 XT:
info:    Driver: 2.0.168
info:    Vulkan: 1.2.162
info:    Memory Heap[0]:
info:      Size: 7920 MiB
info:      Flags: 0x3
info:      Memory Type[0]: Property Flags = 0x1
info:      Memory Type[4]: Property Flags = 0xc1
info:    Memory Heap[1]:
info:      Size: 16100 MiB
info:      Flags: 0x0
info:      Memory Type[1]: Property Flags = 0x6
info:      Memory Type[3]: Property Flags = 0xe
info:      Memory Type[5]: Property Flags = 0xc6
info:      Memory Type[7]: Property Flags = 0xce
info:    Memory Heap[2]:
info:      Size: 256 MiB
info:      Flags: 0x3
info:      Memory Type[2]: Property Flags = 0x7
info:      Memory Type[6]: Property Flags = 0xc7
Adapter 0:
 AMD Radeon RX 5700 XT
 Vendor: 4098
 Device: 29471
 Dedicated RAM: 8573157376
 Shared RAM: 16882073600
 Output 0:
  \\.\DISPLAY1
  Coordinates: 0,0:2560x1440
  640x480 @ 60
  640x480 @ 60
  640x480 @ 60
  640x480 @ 100
  640x480 @ 100
  640x480 @ 100
  640x480 @ 120
  640x480 @ 120
  640x480 @ 120
  640x480 @ 144
  640x480 @ 144
  640x480 @ 144
  720x480 @ 60
  720x480 @ 60
  720x480 @ 60
  720x480 @ 100
  720x480 @ 100
  720x480 @ 100
  720x480 @ 120
  720x480 @ 120
  720x480 @ 120
  720x480 @ 144
  720x480 @ 144
  720x480 @ 144
  800x600 @ 60
  800x600 @ 60
  800x600 @ 60
  800x600 @ 100
  800x600 @ 100
  800x600 @ 100
  800x600 @ 120
  800x600 @ 120
  800x600 @ 120
  800x600 @ 144
  800x600 @ 144
  800x600 @ 144
  1024x768 @ 60
  1024x768 @ 60
  1024x768 @ 60
  1024x768 @ 100
  1024x768 @ 100
  1024x768 @ 100
  1024x768 @ 120
  1024x768 @ 120
  1024x768 @ 120
  1024x768 @ 144
  1024x768 @ 144
  1024x768 @ 144
  1152x864 @ 60
  1152x864 @ 60
  1152x864 @ 60
  1152x864 @ 100
  1152x864 @ 100
  1152x864 @ 100
  1152x864 @ 120
  1152x864 @ 120
  1152x864 @ 120
  1152x864 @ 144
  1152x864 @ 144
  1152x864 @ 144
  1280x720 @ 60
  1280x720 @ 60
  1280x720 @ 60
  1280x720 @ 100
  1280x720 @ 100
  1280x720 @ 100
  1280x720 @ 120
  1280x720 @ 120
  1280x720 @ 120
  1280x720 @ 144
  1280x720 @ 144
  1280x720 @ 144
  1280x800 @ 60
  1280x800 @ 60
  1280x800 @ 60
  1280x800 @ 100
  1280x800 @ 100
  1280x800 @ 100
  1280x800 @ 120
  1280x800 @ 120
  1280x800 @ 120
  1280x800 @ 144
  1280x800 @ 144
  1280x800 @ 144
  1280x1024 @ 60
  1280x1024 @ 60
  1280x1024 @ 60
  1280x1024 @ 100
  1280x1024 @ 100
  1280x1024 @ 100
  1280x1024 @ 120
  1280x1024 @ 120
  1280x1024 @ 120
  1280x1024 @ 144
  1280x1024 @ 144
  1280x1024 @ 144
  1366x768 @ 60
  1366x768 @ 60
  1366x768 @ 60
  1366x768 @ 100
  1366x768 @ 100
  1366x768 @ 100
  1366x768 @ 120
  1366x768 @ 120
  1366x768 @ 120
  1366x768 @ 144
  1366x768 @ 144
  1366x768 @ 144
  1600x900 @ 60
  1600x900 @ 60
  1600x900 @ 60
  1600x900 @ 100
  1600x900 @ 100
  1600x900 @ 100
  1600x900 @ 120
  1600x900 @ 120
  1600x900 @ 120
  1600x900 @ 144
  1600x900 @ 144
  1600x900 @ 144
  1600x1200 @ 60
  1600x1200 @ 60
  1600x1200 @ 60
  1600x1200 @ 100
  1600x1200 @ 100
  1600x1200 @ 100
  1600x1200 @ 120
  1600x1200 @ 120
  1600x1200 @ 120
  1600x1200 @ 144
  1600x1200 @ 144
  1600x1200 @ 144
  1680x1050 @ 60
  1680x1050 @ 60
  1680x1050 @ 60
  1680x1050 @ 100
  1680x1050 @ 100
  1680x1050 @ 100
  1680x1050 @ 120
  1680x1050 @ 120
  1680x1050 @ 120
  1680x1050 @ 144
  1680x1050 @ 144
  1680x1050 @ 144
  1920x1080 @ 60
  1920x1080 @ 60
  1920x1080 @ 60
  1920x1080 @ 100
  1920x1080 @ 100
  1920x1080 @ 100
  1920x1080 @ 120
  1920x1080 @ 120
  1920x1080 @ 120
  1920x1080 @ 144
  1920x1080 @ 144
  1920x1080 @ 144
  1920x1200 @ 60
  1920x1200 @ 60
  1920x1200 @ 60
  1920x1200 @ 100
  1920x1200 @ 100
  1920x1200 @ 100
  1920x1200 @ 120
  1920x1200 @ 120
  1920x1200 @ 120
  1920x1200 @ 144
  1920x1200 @ 144
  1920x1200 @ 144
  2560x1440 @ 60
  2560x1440 @ 100
  2560x1440 @ 120
  2560x1440 @ 144
doitsujin commented 3 years ago

Yeah, so, it does actually detect the 120 and 144 Hz modes correctly. Note that we currently only report one monitor because wine used to have issues with multi-monitor setups in the past and we haven't enabled multi-monitor stuff in DXGI yet.

So yeah, no idea why it would switch to a 60 Hz mode, but I cannot debug this any further.

Raydonn commented 3 years ago

That's unfortunate, but understandable.

As my own workaround, I just deleted the other lower refresh rates reported by my monitor's EDID to get it to stay at 120Hz for now. That seems to keep it at whatever refresh rate Windows reports as the lowest.

Ryusennin commented 3 years ago

This is a long standing unresolved bug of Windows 10, which does not happen on Windows 7.

On Win10, Vulkan is locked to 60 Hz. Forcing another refresh rate (via Hotkey Resolution Changer for example) will result in a blank screen and the game/app trying to switch back to 60 Hz.

For info, it is not specific to dxvk, it occurs in all native Vulkan apps (RDR2, Detroit, RPCS3...).

Raydonn commented 3 years ago

Yeah, I've been reading about it too. Doesn't look like a way to expose the current refresh rate to Vulkan in Windows currently.

I've not been getting a blank screen when I deleted the 60Hz from my EDID for my monitor. Checking the OSD of the monitor confirms that it's still boosting to 120Hz while in game with DXVK as well, so the solution works but maybe only for my configuration.

It does flicker, but I assumed Vulkan is refreshing the screen whenever it gets in/out of focus, as I can alt-tab out of it and still see the game running in the background but whenever I alt-tab in or out, the screen flickers.

K0bin commented 3 years ago

For info, it is not specific to dxvk, it occurs in all native Vulkan apps (RDR2, Detroit, RPCS3...).

No it doesn't. I played Doom Eternal at 120hz just fine and I've also had DXVK games running at 120hz on Windows.

Ryusennin commented 3 years ago

It doesn't for you, you're lucky. It happens to most Win10 users.

mozo78 commented 3 years ago

Windows is a crap. Just leave this leaky ship.

K0bin commented 3 years ago

@mozo78 Can you please stop shitting on Windows in every single Windows related issue? It adds absolutely nothing to the discussion and is frankly just annoying.

mozo78 commented 3 years ago

It's annoyng but it's true. Windows threads in a Linux project are also very irritating. If they are want to use DXVK - they are very welcome - install Linux and go!

pchome commented 3 years ago

@K0bin

No it doesn't. I played Doom Eternal at 120hz just fine ...

@mozo78 Can you please stop shitting on Windows in every single Windows related issue? It adds absolutely nothing to the discussion and is frankly just annoying.

You know what else annoying? Your "works for me, not our problem" comments (while using Windows all the time).

p.s. I know Windows is fake, because I use Linux. I know PE builds are useless, because I played no single game with PE build. Trust me. jk, I know mileage may vary for every single user.

Pfoiffee commented 3 years ago

You could try forcing a higher refresh rate by adding a custom resolution, and make it have only one refresh option available.

DaRkL3AD3R commented 3 years ago

Interesting to see confirmation of the 3x refresh rate listing on an AMD GPU as well. I get this on an Nvidia 1080 Ti with my 144hz monitor. Every resolution and refresh rate listing gets 3 entries in the reported display modes list. This is a major problem for specific games that have a limited entry table capacity and you end up being stuck at a lower resolution, for me it's typically 1280x1024 @ 100hz on my 2560x1440 144hz monitor.

Also, this 60hz bug can happen on Nvidia however the Nvidia driver has an option to override the application requested refresh rate and force it to operate at max available one instead. This is automatically configured on a G-Sync display, but can be manually configured without one. I am not familiar with modern AMD/ATi graphics cards so I'm not sure if they have a similar option in the driver but if they do that should resolve this issue.

ant-sh commented 2 years ago

As a workaround use custom display resolution created in CRU. I had similar issue playing GTA IV with DXVK 1.10.1 on Windows 11, RX580 with Adrenalin 22.4.1. I created a custom 1920x1080 71Hz resolution for my desktop in Radeon Software. This resolution is detected by GTA IV but when it is selected the monitor is switched to 1920x1080 60Hz instead as reported by monitor's OSD and this incorrect 60Hz refresh rate is retained for desktop upon game exit. However when I create custom resolution in CRU, restart driver, select it for desktop and select it in GTA IV then this custom CRU refresh rate is correctly applied in the game and retained for desktop. What is even more important all VSR modes within the game become selectable with new improved refresh rate instead of 60Hz.

Ryusennin commented 2 years ago

For the record, Freesync completely solves this problem.

ComradeHX commented 2 years ago

Ran into this problem after installing nimeZ drivers, solved it with CRU(set a "custom" resolution with automatic timings + proper native res/refresh and left it as the only "detailed resolution").

Tiagoquix commented 4 months ago

Maybe the problem is fixed with the update to the maxFrameRate option:

https://github.com/doitsujin/dxvk/blob/8573190c7dbda89528ec6ae5f6b650909c4d4151/dxvk.conf#L42-L53

vlad54rus commented 2 months ago

From what i can see - this is a bug with Windows' ChangeDisplaySettings function, appearing not only in DXVK but many other OpenGL/Vulkan games where it's used to setup fullscreen. When calling it - Windows will reset display refresh rate to what's configured in the monitor's EDID as the "default" refresh rate, and many monitors default to 60 Hz for compatibility purposes. The only workaround for now is to use CRU to make an EDID override. I can also confirm this issue happens to Windows 7, so it's not specific to newer versions.