Skip to content
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

NVAPI causing huge constant stuttering regression #2253

Open
ethanh20009 opened this issue Dec 12, 2024 · 18 comments
Open

NVAPI causing huge constant stuttering regression #2253

ethanh20009 opened this issue Dec 12, 2024 · 18 comments

Comments

@ethanh20009
Copy link

ethanh20009 commented Dec 12, 2024

Running any DX12 title with
PROTON_LOG=1 LD_PRELOAD="" PROTON_HIDE_NVIDIA_GPU=0 PROTON_ENABLE_NVAPI=1 mangohud %command%
now results in a huge amount of stuttering. On my VA panel, it causes my screen to flicker with VRR.
Had no issues before on ProtonGE 18 (the most recent version without this issue).

With stutter:

2024-12-12.15-53-10.mov

Without (using protonge18):

2024-12-12.15-56-51.mov

I can fix stutters by PROTON_HIDE_NVIDIA_GPU=1 or by using older version.

Software information

Marvel Rivals (for example)
Ultra settings,
No frame gen
Dlss quality

System information

  • GPU: Nvidia 4080
  • Driver: 565.77
  • Wine version: 680d20a
  • VKD3D-Proton version: 45e4453

Log files

steam-2767030.log

From looking at the logs I see a likely culprit being spammed...
dxvk-nvapi:<-NvAPI_D3D12_SetAsyncFrameMarker: No implementation

@ethanh20009
Copy link
Author

Using VKD3D_DISABLE_EXTENSIONS=VK_NV_low_latency2
Does not fix the issue

@jp7677
Copy link
Contributor

jp7677 commented Dec 12, 2024

Do you have LatencyFlex set up on your system?
(Currently on mobile, I haven’t looked in the logs yet)

@jp7677
Copy link
Contributor

jp7677 commented Dec 12, 2024

Could you also switch to normal Proton Experimental and see what happens using that?

@ethanh20009
Copy link
Author

ethanh20009 commented Dec 12, 2024

Could you also switch to normal Proton Experimental and see what happens using that?

Tried using proton experimental just now, same issue.

Do you have LatencyFlex set up on your system? (Currently on mobile, I haven’t looked in the logs yet)

I haven't set up anything extra so if it's not setup by proton automatically or by kernel / cachy tweaks I don't think I have it.
Will try see if I've got it set up, if not install it and see.

@ethanh20009
Copy link
Author

ethanh20009 commented Dec 12, 2024

I installed https://aur.archlinux.org/packages/latencyflex-proton-ge-custom
and ran with that protonge.
Still getting the stutter.

Also tried with reflex setting ingame enabled and disabled and same result either way.

@Saancreed
Copy link
Contributor

Saancreed commented Dec 12, 2024

Friendly reminder that if you're on Proton 9+, PROTON_ENABLE_NVAPI variable does not exist and PROTON_HIDE_NVIDIA_GPU=0 is already the default.

I have a few things for you to try (preferably while running Proton Experimental):

  • First, DXVK_NVAPI_GPU_ARCH=GA100.
  • If that doesn't help, try DXVK_NVAPI_DISABLE_ENTRYPOINTS=NvAPI_D3D_GetLatency.
  • If that also doesn't change anything try the nuclear option: DXVK_NVAPI_DISABLE_ENTRYPOINTS=NvAPI_D3D_Sleep,NvAPI_D3D_SetSleepMode,NvAPI_D3D_GetSleepStatus,NvAPI_D3D_GetLatency,NvAPI_D3D_SetLatencyMarker,NvAPI_D3D12_SetAsyncFrameMarker,NvAPI_D3D12_NotifyOutOfBandCommandQueue (possibly combined with DXVK_NVAPI_GPU_ARCH=GA100 from first attempt) but be aware it will also make Reflex nonfunctional.

@ethanh20009
Copy link
Author

ethanh20009 commented Dec 12, 2024

Thanks, DXVK_NVAPI_GPU_ARCH=GA100 worked,
but now there's no frame generation support.

@jp7677
Copy link
Contributor

jp7677 commented Dec 12, 2024

I installed https://aur.archlinux.org/packages/latencyflex-proton-ge-custom and ran with that protonge.

Sorry, I didn’t wanted you to install lfx, I just wanted to be sure that haven’t set it up. Please remove lfx if you have it installed now. You don’t need it with an NVIDIA gpu.

Thanks, DXVK_NVAPI_GPU_ARCH=GA100 worked, but now there's no frame generation support.

Yes, this is expected. This switch lets your GPU appear as Ampere generation which doesn’t support frame generation.

@ethanh20009
Copy link
Author

Sorry, I didn’t wanted you to install lfx, I just wanted to be sure that haven’t set it up. Please remove lfx if you have it installed now. You don’t need it with NVIDIA gpu.

Cool, uninstalled

Yes, this is expected. This switch lets your GPU appear as Ampere generation which doesn’t support frame generation.

Yes, makes sense.
So when appearing as 4000 series, I'll always get the stuttering on new versions of vkd3d-proton.
This is even without frame generation enabled.
Trying to find a best case solution where I can use dlss frame generation without the stuttering and flickering.

@Saancreed
Copy link
Contributor

Thanks, DXVK_NVAPI_GPU_ARCH=GA100 worked,
but now there's no frame generation support.

Right, I've seen a very similar issue with Ghost of Tsushima before which prompted me to apply the same workaround there: jp7677/dxvk-nvapi#186, but that was before Proton had Frame Generation so nothing of value was lost anyway when we disabled reporting Ada GPUs for this game.

But the thing with GoT is that it was bugged only when DLFG would be nonfunctional anyway. Now that Proton supports it, this workaround was reverted and GoT does not exhibit this problem anymore. Can you try removing the variable, enabling Frame Generation, and checking then if the issue still persists? If yes, please get me a log from such a run.

(And please restart the game after enabling DLFG, it's known to behave quite… janky otherwise.)

@ethanh20009
Copy link
Author

Okay so did with Cyberpunk (marvel rivals just gives me a black screen with frame generation)
Stutter persists.

Log was getting spammed, so had to only have a run for like 20 seconds.

steam-1091500.log

@ethanh20009
Copy link
Author

Actually got Marvel Rivals frame generation to work, but the stutter still exists.
Restarted game then tested as recommended.

Log here:

steam-2767030.log

@Saancreed
Copy link
Contributor

Welp. That's… not good, but also not something that I'd consider actionable for us, after all we're just forwarding the calls to Nvidia driver. If you are okay with losing DLFG, you can keep using the environment variable but it's not a good long term solution by any mean.

I guess we should try to have someone reproduce your findings, and with enough points of data attract some attention from Nvidia engineers.

@ethanh20009
Copy link
Author

Thanks for your help. And yes sounds good. I'm happy to provide any more info if you need help reproducing.

@jp7677
Copy link
Contributor

jp7677 commented Dec 13, 2024

Note that there is still something specific for your setup. Especially CP2077 gets a lot of attention and should just work just fine with all whistles and bells on your GPU generation.

@ethanh20009
Copy link
Author

Any thoughts on what it could be or things I could try?
I've attached my log for Cyberpunk.

I've tried different kernels, switching from Nvidia open to closed and then turning off GSP.

@jp7677
Copy link
Contributor

jp7677 commented Dec 13, 2024

Did you already tried with the most basic setup and a well known title (e.g. CP2077)? So e.g. a plain Gnome Desktop (X11 or Wayland) without tweaks (e.g starting without VRR or tearing), with regular Proton (Experimental) with a clean prefix, no overlays, no configuration settings, fresh restart (thus no resume from suspend) etc? Once this gives desired results, you could work forward one step at a time and hopefully detect what introduced your issue.

PS: Very likely unrelated, but i want to mention this one as well: doitsujin/dxvk#4436 (comment)

@ethanh20009
Copy link
Author

Just tried starting as clean as possible:

  • Tearing disabled
  • VRR disabled
  • No environment variables (e.g. removed __GL_VRR_ALLOWED,1)
  • Removed and regenerated Cyberpunk's wine prefix folder
  • Used proton experimental
  • No overlays
  • Fresh runs

Still not getting the desired results.
I've tried in the past running KDE plasma and I got the same behavior there too.

PS: Very likely unrelated, but i want to mention this one as well: doitsujin/dxvk#4436 (comment)

Thanks for this, I used this to get mangohud and LD_PRELOAD="" to work together.
I've had issues with some games lagging after extended periods (a separate issue) which this fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants