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

Final Fantasy XVI freeze and performance issues #2282

Open
o-schneider opened this issue Jan 13, 2025 · 4 comments
Open

Final Fantasy XVI freeze and performance issues #2282

o-schneider opened this issue Jan 13, 2025 · 4 comments

Comments

@o-schneider
Copy link

o-schneider commented Jan 13, 2025

Hi! First thank to everyone working on this, you're the wizards making gaming on Linux possible and my gratitude for this knows no bounds.

I open this thread for two issues I encounter with Final Fantasy XVI. The game is actually quite a mess of a port so it's hard to tell if the issues come from Proton, VKD3D-Proton or the game itself and I don't have any Windows to test it. Anyways, here's what I found:

Freezing issue

The game freezes systematically when loading a save within seconds after the loading is finished. The issue seems to occur only when the GPU is maxed out or above 90-95%. With VKD3D-Proton 2.14 bundled with Proton GE 9-22 (at c965c13), I found two workarounds :

  • The first one was to reduce the graphic settings to ensure that the GPU load stays moderate, like locking the framerate to 40FPS. After a few minutes of gaming (I don't know how many), I'd try to go back to 60FPS to see if the game freezes or not (both happened)
  • The second which is always working but is quite surprising: I found out that the game would never freeze at its very beginning, so I made a save there and when a start the game again, I load this save at the beginning ensure the GPU load reaches 100%, move around a bit to the trigger of a cutscene and then load my actual save. The game doesn't freeze immediately this way, but can eventually freeze at a later point randomly (which is somewhat less annoying).

I found out that the second workaround doesn't work anymore when I swap Proton GE 9-22's VKD3D-Proton to the 2.14.1 release. It seemed to work properly the first time the game has been started (where it compiles shaders), but any subsequent start would end up freezing on loading, be it at the start of the game or the actual save. Rolling back to the bundled version restores the behavior explained previously.

This discrepancy between 2.14 and 2.14.1 decided me to post this issue even though the port is of uneven quality as I guess this may point to a VKD3D-Proton issue after all. From what I could find, this issue seem to plague nvidia cards only. Please note that the game also seems to freeze randomly on Windows too if the people on Steam forums and elsewhere can be believed.

Unstable performance in open or crowded area

The other issue, not game breaking, is that I experience horrendous performance in more open or crowded area (like the first town we get to named Lostwing, or Martha's Rest later in the game if that helps). The behavior is kind of strange as the framerate is normal when the scene is static (camera not moving in any way) but plummet to a crawl when just rotating the camera to then slowly return to the initial framerate when stopping to move the camera. We can see that the GPU load is decreasing when the framerate goes down. It looks like there's something holding the rendering when rotating the camera that somehow stacks until the movement stops and slowly resolves itself. Nothing special seen on the CPU front though. This issue seems to plague AMD cards as well. I have no idea if it occurs on Windows too.

System information

  • GPU: Nvidia RTX 2080 Ti
  • Driver: 565.77
  • Wine version: Proton GE 9-22
  • VKD3D-Proton version: 2.14.1

Log files

Also:

If I may be of further help in any way (more logs, providing saves, whatever), please ask!

@HansKristian-Work
Copy link
Owner

Terrible performance on NV is known and last time I looked at it, it didn't look like anything directly related to vkd3d-proton, so it's unclear how we progress on the issue.

As for freezes, I'm not aware of that.

@esullivan-nvidia
Copy link
Contributor

Looking through the proton log file you provided the only thing of note that I see is the following section:

6973.029:0128:0428:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.029:0128:0428:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.035:0128:03fc:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.035:0128:03fc:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.041:0128:040c:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.041:0128:040c:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.046:0128:03fc:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.046:0128:03fc:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.070:0128:0400:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "ffb0fc6b04cf43d3" already exists.
6973.098:0128:041c:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "e3b7e00aa90101c3" already exists.
6973.111:0128:0414:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.111:0128:0414:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.146:0128:0404:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "9bb7c02897629aa6" already exists.
6973.152:0128:0410:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "9bb7c026034d49a3" already exists.
6973.156:0128:0408:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "ef85152b4356f0a0" already exists.
6973.160:0128:03f8:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.160:0128:03f8:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.163:0128:042c:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "2515f8eca58c0c9d" already exists.
6973.188:0128:03f4:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "1d09045c491e718d" already exists.
6973.190:0128:042c:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "215e73e71a5d828c" already exists.
6973.216:0128:0414:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.216:0128:0414:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.234:0128:0404:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.234:0128:0404:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.254:0128:041c:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.254:0128:041c:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.283:0128:0428:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.283:0128:0428:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.295:0128:0428:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "215e73e3e714234c" already exists.
6973.298:0128:0428:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.298:0128:0428:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.312:0128:041c:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "2515f8e8782c9742" already exists.
6973.338:0128:0428:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.338:0128:0428:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.
6973.350:0128:0404:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "9bb7c02bcf87042b" already exists.
6973.373:0128:0408:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "fd9809f18aa44d1e" already exists.
6973.374:0128:0418:warn:vkd3d-proton:d3d12_pipeline_library_StorePipeline: Pipeline "e23569700992991d" already exists.
6973.397:0128:0414:err:vkd3d-proton:d3d12_device_validate_shader_meta: Required WaveSize range [64, 64], but supported range is [32, 32].
6973.397:0128:0414:warn:vkd3d-proton:d3d12_pipeline_state_init_compute: Failed to create Vulkan compute pipeline, hr 0x80070057.

I ran the game locally and it results in the same logs being produced but I don't see the game freeze. So I think it must be correctly handling the E_INVALIDARG return code that is produced by vkd3d-proton for those shaders.

Could you provide the output from dmesg after the freeze occurs? This will help determine if you are hitting a GPU hang or if something else is happening. Providing a save file would also be helpful as I have not been able to reproduce the freeze with the local save I have.

@o-schneider
Copy link
Author

o-schneider commented Jan 15, 2025

Here is the dmesg output for the session I just had where it ended up freezing. I guess that part will be the most interesting:

[ 2081.404826] NVRM: GPU at PCI:0000:01:00: GPU-e82bbd13-2c21-cb38-8ba2-b6aac2fe8cfb
[ 2081.404830] NVRM: Xid (PCI:0000:01:00): 109, pid=54787, name=ffxvi.exe, Ch 00000036, errorString CTX SWITCH TIMEOUT, Info 0x5c03a

[ 2104.455095] NVRM: Xid (PCI:0000:01:00): 16, pid='<unknown>', name=<unknown>, Head 00000003 Count 00016dc9
[ 2104.455103] NVRM: krcWatchdogCallbackVblankRecovery_IMPL: NVRM-RC: RM has detected that 7 Seconds without a Vblank Counter Update on head:D0
[ 2106.206494] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32de7985543551 >= 32de79557254b4
[ 2106.206499] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 2106.206502] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32de7985543551 >= 32de79557254b4
[ 2106.206503] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 2106.209968] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32de7985871226 >= 32de79557254b4
[ 2106.209970] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 2106.209972] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32de7985871226 >= 32de79557254b4
[ 2106.209973] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 2106.216312] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32de7985b9eefb >= 32de79557254b4
[ 2106.216331] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 2106.216334] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32de7985eccbd0 >= 32de79557254b4
[ 2106.216335] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 2106.217437] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32de7985eccbd0 >= 32de79557254b4
[ 2106.217438] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 2106.217440] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32de7985eccbd0 >= 32de79557254b4
[ 2106.217441] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!

Strangely enough, I switched back to 2.14.1 to get you the trace and the freeze wasn't as reliable as I explained in my initial post with the same version, I'm not sure why. For the log I joined here, I played for about 10 minutes fighting mobs in the Royal Meadows location of the game until it froze. Could it be that a given freeze would corrupt the shader cache or something and then only the game would freeze systematically?

So no save where it's sure to freeze, but I don't think this issue is related to a specific scene as it would always freeze as long as GPU usage reaches 100%. If I understand better how it triggers and becomes systematic, I'll follow up.

EDIT: The game freezes systematically again and I have no idea why it does it now, I just shut down the computer and restarted it a few hours later in between. Here is the log with NVRM crash, like the other one, the _threadNodeCheckTimeout lines are repeated until the process was killed.

[ 7255.476643] NVRM: GPU at PCI:0000:01:00: GPU-e82bbd13-2c21-cb38-8ba2-b6aac2fe8cfb
[ 7255.476647] NVRM: Xid (PCI:0000:01:00): 16, pid='<unknown>', name=<unknown>, Head 00000003 Count 000efdb7
[ 7255.476650] NVRM: krcWatchdogCallbackVblankRecovery_IMPL: NVRM-RC: RM has detected that 7 Seconds without a Vblank Counter Update on head:D0
[ 7263.509161] NVRM: Xid (PCI:0000:01:00): 16, pid='<unknown>', name=<unknown>, Head 00000003 Count 000efdb8
[ 7263.509165] NVRM: krcWatchdogCallbackVblankRecovery_IMPL: NVRM-RC: RM has detected that 7 Seconds without a Vblank Counter Update on head:D0
[ 7263.732932] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32e32a53e1f35d >= 32e328a091f44a
[ 7263.732934] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 7263.732938] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32e32a53e1f35d >= 32e328a091f44a
[ 7263.732939] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 7263.733278] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32e32a53e1f35d >= 32e328a091f44a
[ 7263.733279] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 7263.733282] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32e32a53e1f35d >= 32e328a091f44a
[ 7263.733283] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: Timeout was set to: 30000 msecs!
[ 7263.738993] NVRM: _threadNodeCheckTimeout: _threadNodeCheckTimeout: currentTime: 32e32a5447ad07 >= 32e328a091f44a

@ryzendew
Copy link

ryzendew commented Jan 26, 2025

i have not gotten any crash on the game but this PR #2307 seems to fix the stutters at least Tested with an RTX 4070

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

4 participants