-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Reflex support possible? #52
Comments
What does Reflex even do? I can't find anything specific. |
I don't know anything more than what they state on the Reflex dev site, which unfortunately is not much: https://developer.nvidia.com/reflex/get-started The interesting part would be the low latency mode, the tooling stuff for latency measurements imho not so much. |
On the D3D9-11 side you could reduce the amount of prepared frames which would help to reduce latency. (DXVK has config options for that). I think one mode in the Nvidia Windows driver also synchronizes with the GPU every frame. No idea about anything else. |
Yeah, we don't have an equivalent in vkd3d-proton. :( |
Because that's up to the application to decide with D3D12 and Vulkan. The concept of prerendered frames doesn't exist in D3D12. |
I don't dispute that, yet AMD driver devs somehow managed to implement it for D3D12. I tested Anti-Lag in a bunch of D3D12 games like Hitman 2, Shadow of the Tomb Raider or Horizon Zero Dawn and it worked really well. If this would be doable for vkd3d-proton in a similar fashion? I have no idea. Of course I won't disagree that this by far shouldn't be the top priority. Hopefully Reflex support is more doable. :) |
My point is that as long as no one even knows what exactly it does, it can't be implemented. |
Although seemingly very interesting, i looked at a youtube video i found on nvidia https://www.youtube.com/watch?v=-cXg7GQogAE, i could not immediately find that this was like a "plug-in-dll-that-makes-less-latency" thing... Rather it seemed (to me) it was some sort of "how-to-optimize-your-game" kind of thing that meassure latency and would provide game developers with means to optimize games for this. (was listed some games using this like Fortnite and Apex Legends). I might have misunderstood the concept ofc, and this being something nVidia has invented that would magically improve latency, but i highly doubt it is that easy. We do not have the concept of "Low Latency Mode" in the Linux driver afaik, and it seems as it is somewhat intended to be used together with games developed for this + possible nVidia gaming monitors that support this feature? nVapi does not seem to have any documented functions for this atm in the public headers, so the guesswork would be reaching pretty far atm. Certainly interesting, i must admit that, but i think with what we got atm, tweaking dxvk and further optimizing vkd3d and wine is the only thing we can do. Rémi Bernon has contributed many patches towards directinput for Proton/wine, so it is a constant WIP there i would say when it comes to improving stuff especially for latency (wineserver calls and whatnot). Just my quick 2 cents :) |
When switching it on and off, it really makes a lot of a difference for input lag (without any special display device). Especially when fps are lower and games would have CPU prerender of 3 frames otherwise (completely bonkers). Afaik Anti-Lag & "NULL" limit to ~0.5 frames of CPU prerender, whereas Reflex is ~0. Deathloop has an option to reduce latency apart from Reflex, which probably is prenderlimit 1, but Reflex really still makes a noticeable difference on top. I don't know if it also optimizes input processing in some additional way. Well, hopefully Nvidia can shed some light on Reflex Linux support at some point. :( |
Is this an ingame option that is "grayed out" when running the game through Wine/Proton? (And thus would somehow require a NvAPI call?) Just watched Linus https://www.youtube.com/watch?v=aL5YTWRpzoA and it seems that what you use this for - when having the available hardware like mouse, monitor and gpu - is to measure the latency, and then enable/disable various options until you find what gives you the best (least) inputlag. Games having pre-defined "optimum settings" or options, would probably work just aswell for us.. unless ofc it is like i asked above, something unavailable as an option when running under wine/proton. (I don't own any of the games in question, so i cant test this). I do agree that it would be awesome to be able to view this when playing a game under wine/proton, cos the same settings in windows might need other/different options for Linux... however it very much seems like it is really connected to the driver's overlay functions, something that is not really available for the Linux driver at all. I cannot imagine in any near future where this would be available for Linux tbh. Just to conclude my (mis)understanding of this:
The following questions is raised:
I tend to get a bit long winded at times, but i can see quite a few elements completely out of scope from what "we" do with DXVK-NVAPI atm tho... Unless ofc the answer to the first question is "It is grayed out, and probably requires a positive NvAPI call to be enabled", cos faking a reply would probably be easy enough if it would mean the options tweaked some game related settings under the hood (that does not require the driver to drastically change something). |
Interesting 😄 Atleast it is feasible that it should be a NvAPI call rather than a pure "driver funcion", unless it is yet another one of those "mistaken driver version" things that requires a certain driver that the game just dont get correctly. |
Hmm.. That list was a lot shorter than expected. That leaves my next suspect - the NvAPI_DRS_ system "Nvidia Driver Settings". I kinda thought/believed it was only for loading those gameprofiles (ie. you set Game.exe to run without vsync and whatnot), but it COULD be more involved somehow. Will it "fail" if absolutely NO gameprofiles is found (and the api reports ERROR)? Thanks tho.. will do some experimentation. I have Escape from Tarkov game, and that got nVidia Reflex support not long ago.. Could enable it on my win10 box with GTX970, but currently dont have it installed on my Linux box due to BattlEye (but that might be close to working now, so maybe i should look into it again). |
I just added |
The Reflex option now is available in the game's menu. :) |
Hmm.. i see 3 new calls now:
From the headers, these absolutely seem related, as the text indicates stuff like LowLatencyBoost and other stuff.
Worth investigating, but i would think this controls some driver aspect of things - that i thought would be negated when running in "performance mode", but these days "performance mode" might be more involved (powerlimits+++) than just running at full gpu clock. |
This was slightly harder then expected to "test". It may be that i need the I still lean a wee bit towards this being a "hardware driver control" kind of thing, and since nvml does not really have anything looking like this, i do not think it is directly possible to implement atm. However, it is kind of hard (as previously said) to figure out if any benefits is to be gained from this in the first place.. Playing through wine/proton is likely adding latency anyway, and i am unsure if it would help much. Until there is a way to actually measure this latency (ref. earlier post about driver overlay stuff and whatnot), for all we know Linux is doing a much better job at this than windows does natively already 😏 I do not really play any competitive games anymore, and have not gamed on anything new when it comes to hardware in years, so cant really compare perceived latency from windows <-> Linux. You are most likely bound to be loosing fps from any sort of translation (dxvk/vkd3d -> vulkan) and you will loose latency and fps from wine anyway. I will keep digging around more for this, but i am sad to say "Don't hold your breath" 😄 |
I don't notice any additional lag when playing on Xorg without vsync vs. Windows. I'm pretty sure ~90% of lag is caused by the games themselves, i.e. stupid CPU prerender of 3 frames or even more (limiting to 1 in DXVK usually makes a hell of a difference). If Reflex on Linux would be limited to keeping CPU prerender queue emtpy to short, it should already be a major benefit. Well, just guessing here, as we don't really know in detail what Reflex does... |
Yeah, it is quite unknown so far since no public headers with the functions is released.
Stuff similar to this will atleast seemingly make sure we limit as much as possible pre-rendered frames, and should avoid as much as possible throttling gpu unnecessary (within limits of temp and power). You can also increase powerlimit for the gpu with I suspect that this Reflex thing does a bit more too.. like setting maxFrameLatency < 1 perhaps, something dxvk cant do atm. For D3D12, this option does nothing i think, since it is a wee bit different for D3D12, so it could be some NvAPI function for D3D12 for this function alone maybe? Unless we can get a direct comparison between windows (+reflex) <-> wine/proton for latency, it is kinda hard to determine how great the difference is. The video i linked a few posts up from Linux tech tips, he was showing some type of gear that they used "before Reflex", that was wired up to the mouse, and possibly some camera thing that detected something on the screen to measure this. Not sure if that is something that would work in Linux at all, but would be interesting to see if one could meassure something similar? |
All three methods are in the public headers. |
Assuming this actually IS related to "Reflex"...? 😏 EDIT: "SleepMode"? Is not exactly self-explanatory that it is the same as "Reflex" (was more or less my meaning). |
Do i understand the dxvk-nvapi testsuite so that it creates a D3D device (via dxgi) when testing some of the NvAPI_D3D12_ calls? If so.. i wonder if a test for those 3 "suspected" calls could be written that would provide SOME useful reply when run in windows? It would fail (for now) when run with wine/proton, but perhaps it could be used for figuring out how they work in windows with the actual nvapi lib? |
No, the unit-tests use mocks, those instances just pretend to be d3d12devices and are only useful to validate which methods have been called by the tests itself. If you want a test that uses actual d3d12devices, I guess you could look at the vkd3d-proton tests. |
For anyone who is interested in Reflex support on Linux, please take a look at my project https://github.com/ishitatsuyuki/LatencyFleX, hooked up into games through NvAPI. It can be installed by replacing and adding a few wine libraries, including DXVK-NVAPI. It does not use any NVIDIA SDK or proprietary code apart from the binding interface. It's possible that it's better or worse than Reflex, but so far as it has been providing satisfactory results for me. (I'm testing on an AMD graphics card with DXVK vendor ID overrides, so let me know if there are any NVIDIA specific issues.) |
Thanks a lot. This looks certainly promising, I’ll keep your project in the back of my mind! |
The LatencyFlex PR is merged, enabling Reflex should now make a difference when LatencyFlex (https://github.com/ishitatsuyuki/LatencyFleX) is properly set up. |
All credits to @ishitatsuyuki ! |
Is Reflex support possible within dxvk-nvapi's scope, or would there be additional work (like the shim DLLs for DLSS by Nvidia) required to make it work on Linux?
The text was updated successfully, but these errors were encountered: