dxvk icon indicating copy to clipboard operation
dxvk copied to clipboard

[d3d9] Need for Speed Underground 2 performance problems

Open BareGamer opened this issue 2 months ago • 6 comments

There are 2 issues really. The first is, when running the game through dxvk on linux, the game often has weird hitches. Compared to playing the game natively on windows for example, which makes the fps about 20 lower, but the game feels much smoother. And the second issue is not unique to dxvk: when drifting and a lot of smoke appears, the fps falls drastically - from 60-80 to 37. That happens natively on windows too. At first I thought that there is not enough memory bandwidth for the iGPU, but to my surprise, such a catastrophic performance loss doesn't happen on windows both when running on dgVoodoo and even 9 auf 12. Unfortunately, I can't test the game with dxvk on windows because the last driver release was in january of 2024, and my GPU doesn't support Vulkan 1.3 on it. Also, funnily enough, wined3d on wine 8 (with native 32-bit support) offers the smoothest experience on linux (unplayable on 9 and 10 because of 32-bit OpenGL).

If you use Windows, please check the following page: https://github.com/doitsujin/dxvk/wiki/Windows

Software information

Name of the game, settings used etc. If using mods or addons, list them aswell.

Need for Speed Underground 2, max settings

System information

  • GPU: AMD Radeon Renoir integrated graphics
  • Driver: RADV 25.2.3
  • Wine version: 10.15
  • DXVK version: 2.7.1

Apitrace file(s)

https://drive.google.com/file/d/1NlHHFDthRS0a7t45qsZ0FepSfdhPjKM4/view?usp=sharing

For instructions on how to use apitrace, see: https://github.com/doitsujin/dxvk/wiki/Using-Apitrace

Log files

Wine does not output anything, dxvk outputs only the GPU info. d3d9.log (also, I tried enabling dynamic buffers to improve performance, but there was not too much difference)

BareGamer avatar Nov 18 '25 15:11 BareGamer

There isn't anything obviously wrong with it and unfortunately apitraces can't be used to judge performance.

The game is also no longer available, so I can't really look into this.

K0bin avatar Nov 19 '25 16:11 K0bin

There isn't anything obviously wrong with it and unfortunately apitraces can't be used to judge performance.

Is there any other data I can provide?

The game is also no longer available, so I can't really look into this.

It wasn't ever available digitally, so like Most Wanted it is abandonware.

BareGamer avatar Nov 19 '25 19:11 BareGamer

I have a retail copy of the game which I've played quite a lot on dxvk, and I never did notice any performance issues on Nvidia at least. I'll give it a go on my Lunar Lake thin-and-light to see if I can reproduce this, but, if anything, UMA systems are unaffected by the usual reBAR/cachedDynamicBuffers shenanigans, so this could just be down to a driver issue.

WinterSnowfall avatar Nov 20 '25 09:11 WinterSnowfall

when drifting and a lot of smoke appears, the fps falls drastically - from 60-80 to 37

This part is actually somewhat expected since alpha-blending with MSAA is extremely expensive, but I'm seeing a potential optimization here since the game sets up blending in a weird way and also doesn't enable alpha-testing, so maybe that's the reason why it's faster on other implementation. This will have to wait until we integrate the new shader compiler though.

Not seeing any stutter with the apitrace or any reason why the game would stutter though, there's not even a lot of fixed-function processing going on which could have explained that.

doitsujin avatar Nov 20 '25 09:11 doitsujin

Not seeing any stutter with the apitrace or any reason why the game would stutter though, there's not even a lot of fixed-function processing going on which could have explained that.

Not even sure if the stuttering is that bad as to even show up on something like a frame time graph, but it at least feels like there are a lot of hitches, and pretty much only on dxvk. The game often drops frames on windows on my gpu, but it feels much smoother.

BareGamer avatar Nov 20 '25 12:11 BareGamer

While I can't say anything about the smoke effects causing frame rate drops, there is something peculiar I have noticed in d3d8/d3d9 games.

I don't have any AMD hardware, so take this with a grain of salt, but apparently Nvidia drivers don't cache shaders in d3d8/d3d9 games. For the most part these old games have rather simple shaders and the shader creation process finishes almost instantly on Windows, so you don't get any hitches caused by shader compilation (except for the more complex shaders which are somewhat rare in these old games).

When you install DXVK on Windows it successfully caches all the shaders encountered in d3d8/d3d9 games.

The funny thing is that for some odd reason some (not all?) d3d8/d3d9 shaders take tens to hundreds times longer to compile/get cached when being translated to Vulkan via DXVK.

I don't own the game, so this might be not indicative of an actual final game performance, but judging by what I can see from the game demo, I get exactly that behavior:

Scenario 1 - d3d9; shader caching doesn't work; after loading into the game the frame time graph stays completely flat throughout the entire play session: https://youtu.be/xsaX72SqSuc

Scenario 2 - DXVK; cold boot with no shader cache generated; the frame time graph stays flat for the most part, but there were ~3-4 stutters (and frame time spikes) during the play session: https://youtu.be/CxCxja5dLzM

Scenario 3 - DXVK; shader cache generated from the previous play session; the frame time graph stays completely flat throughout the entire play session: https://youtu.be/Hos4pUmbXj8

I am not a dev, so I can't be 100% sure. but I highly suspect that "barely noticeable" hitching you are describing when using DXVK is caused by shader compilation/caching/both.

rrPKrr avatar Nov 20 '25 16:11 rrPKrr