-
Notifications
You must be signed in to change notification settings - Fork 199
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
Add NV low latency support #1739
Add NV low latency support #1739
Conversation
Nice.. Quick question: seems no Nv driver for Linux currently supporting that low latency 2 extension.. even missing on Nvidia Vulkan dev drivers.. so hoping NV can expose before 550.xx branch, ideally both on NV VK dev drivers and also upcoming(?) 545.xx driver series.. |
Support for the low-latency extensions just got released in the 545.23.06 NVIDIA driver so this is usable/testable now. (Propagating this note to all three project PRs, apologies for any duplication! 😸 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits aside, the synchronization strategy here seems pretty dodgy and I think that needs to be explained in more detail.
From spec:
I think LL2 needs to specify that setting latency markers is explicitly atomic within the implementation to bypass this issue: From vkWaitForPresentKHR:
|
Thanks for the review, I will get the feedback addressed later today. I really appreciate it. Let me know if you have any additional thoughts, questions, or concerns for this PR. |
In parallel, it would be good if you could update the Vulkan spec to explicitly state the externsync exception. That guarantee will remove a lot of my concerns with the feature. |
Will do, thanks for pointing that out. I will get that kicked off today as well. |
Found another issue, VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV is not queried, which I think is required to use the feature? I tried using this struct in Granite, and the driver seems to completely ignore this struct when I pass it to GetSurfaceCapabilities2KHR. If it's not required, will we have the same problem as VK_KHR_present_wait all over again w.r.t. wayland vs x11 feature query? |
Requires at least Nvidia 545.xx drivers. The patches are from the following pull requests: [wine](ValveSoftware/wine#200) [dxvk-nvapi](jp7677/dxvk-nvapi#147) [vkd3d-proton](HansKristian-Work/vkd3d-proton#1739) [dxvk](doitsujin/dxvk#3690) Thanks also goes to @ptr1337 for initially building and testing the patchset.
Requires at least Nvidia 545.xx drivers. The patches are from the following pull requests: [wine](ValveSoftware/wine#200) [dxvk-nvapi](jp7677/dxvk-nvapi#147) [vkd3d-proton](HansKristian-Work/vkd3d-proton#1739) [dxvk](doitsujin/dxvk#3690) Thanks also goes to @ptr1337 for initially building and testing the patchset.
We are testing the Nvidia Reflex Implementation since a while. It is running quite well. |
Is there any progress planned on this PR? There are outstanding concerns from the review that have not been addressed yet, so I assume we're waiting for NV to update the PR. |
Yes, I am still planning on updating this PR. Sorry for the delay. I had some other tasks that unfortunately took precedent over this work. Those are done now and I should be able to send an update soon. |
Requires at least Nvidia 545.xx drivers. The patches are from the following pull requests: [wine](ValveSoftware/wine#200) [dxvk-nvapi](jp7677/dxvk-nvapi#147) [vkd3d-proton](HansKristian-Work/vkd3d-proton#1739) [dxvk](doitsujin/dxvk#3690) Thanks also goes to @ptr1337 for initially building and testing the patchset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More comments.
934e4dd
to
495c249
Compare
Getting there now ... |
45ceb29
to
2231497
Compare
This commit add support for the VK_NV_low_latency2 extension, and implements the ID3DLowLatencyDevice, and ID3D12CommandQueueExt interfaces.
2231497
to
152adc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bunch of smol nits, but I think this is good now. I'll do some targeting testing to make sure nothing explodes.
Just committed the changed I wanted. I'll squash before merge. |
@esullivan-nvidia I tested this PR today and it doesn't seem like the NV impl actually sleeps based on GPU load. https://github.com/HansKristian-Work/vkd3d-proton/tree/ll2-merge-testing has an ad-hoc test for demos/gears (-Denable_extras=true to build). Using VKD3D_QUEUE_PROFILE (load with Chromium chrome://tracing) I get this result on NV 550.40.07 on a 4070. This is on GNOME Wayland with PRIME, but that shouldn't matter since the NV impl only considers CPU <-> GPU overlap atm I think, not presentation latency. There is a 67ms latency between submit and GPU starting process. I tested @ishitatsuyuki 's LFX2 implementation on RADV and it does sleep, so that probably rules out a test bug. The frame limiter aspect works though. If FPS goes above 60 then it locks to 60 in the test. |
I pushed another commit that should fix what you were seeing. It was a mistake on my part to preemptively notify the driver that the additional queue was out of band. |
It is not fixed with that commit for me. Pushed update to ll2-merge-testing branch. |
The issue you are seeing with the sample gears application is a driver bug, and we have a fix. I will let you know when it releases in a public driver. Hopefully it can go out in the developer beta branch soon. Would you be willing to use an application that supports Reflex like Cyberpunk 2077 (or any title you can make GPU bound) for testing on your end? No need to merge anything until the low latency gears test passes, I just want to confirm you can see that is working correctly. |
Should Reflex apps like CP77 just work right now with existing dxvk-nvapi? I can try that, sure. EDIT: @jp7677 pointed out jp7677/dxvk-nvapi#147 is needed as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now. I tested some Reflex games and it seems to work as expected with actual games. I'll merge in a separate PR since I'll be doing some squashing of my nit commits, etc.
LL2 is finally merged 🥳 |
It is great to see this merged, sorry for all the delays on my part. Thanks again to everyone for all of the feedback on this PR, I really appreciate it. |
* nvidia reflex merged jp7677/dxvk-nvapi#147 (comment) HansKristian-Work/vkd3d-proton#1739 (comment) Signed-off-by: Gonçalo Negrier Duarte <[email protected]>
This pull request implements a new device interface called ID3DLowLatencyDevice, and ID3D12CommandQueueExt using the VK_NV_low_latency2 extension. The purpose of these interfaces, is to give dxvk-nvapi a way to implement the nvapi Reflex interface.