protonscr

[hud] Divide by zero error in GhostRunner

dxvkclosed
doitsujin/dxvk#1843 · opened 2020-12-05 by alesliehughes · updated 2021-08-26 · 5 comments · github
Aalesliehughes 2020-12-05 github

Game: GhostRunnder via Wine+Steam
The issue appears as a LOST_DEVICE error, however its cause by a divide by zero error.

Commit 6814ad45d45406c2d2f1cc26360026aa58cc6cf2
[hud] Fix positioning of compiler item when scaled

Adds this line

  •    { position.x, renderer.surfaceSize().height / renderer.scale() - 20.0f },
    

Because m_scale value is initialized to zero, and isn't changed ingame, it causes a divide by zero error.

Initializing the value to 1 stops the error occurring but I'm not sure if that is the proper solution.

Either "renderer.scale() - 20.0f" needs brackets, or the function scale needs to return a non-zero value.

Ddoitsujin maintainer 2020-12-05 github

As mentioned, I can't reproduce this at all, and the question would be how scale can possibly be zero at the time this gets called, because we always set it to a non-zero value in HudRenderer::beginFrame, and we always call that before trying to render the HUD items. Under normal circumstances, this should be impossible.

I guess initializing it to 1 is some sort of band-aid that'll work for now, but there's a big problem somewhere.

Aalesliehughes 2020-12-06 github

Filling in some details
Debian (bullseye).
OpenGL renderer string: GeForce GTX 670/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 455.45.01
dmesg
[20047.150096] NVRM: Xid (PCI:0000:01:00): 31, pid=29194, Ch 00000022, intr 10000000. MMU Fault: ENGINE GRAPHICS GPCCLIENT_L1_0 faulted @ 0x0_2f70e000. Fault is of type FAULT_PDE ACCESS_TYPE_READ

Steam terminal output
err: DxvkSubmissionQueue: Failed to sync fence: VK_ERROR_DEVICE_LOST
err: DxvkDevice: waitForIdle: Operation failed

Aalesliehughes 2020-12-06 github

As of commit 03f11baf570cb0ca57e84c239695d3f083d96d31, GhostRunner works.

Ffeshs 2020-12-06 github

Just a wild guess, but maybe when you are living in Europe and are trying to use a comma as decimal separator like this:
DXVK_HUD=devinfo,fps,scale=0,5
which gets interpreted as scale=0

Aalesliehughes 2020-12-06 github

Good try, but I haven't explicitly set that.

Launch options