wgpu-py icon indicating copy to clipboard operation
wgpu-py copied to clipboard

Windows fatal exception: stack overflow during passing tests

Open Vipitis opened this issue 1 year ago • 3 comments

I was running the tests from wgpu-shadertoy and saw a Windows fatal exception: stack overflow followed by a stacktrace originating from this line: https://github.com/pygfx/wgpu-py/blob/12544872f178860e1b9d7fd4344818188da0c1c6/wgpu/backends/wgpu_native/_helpers.py#L90 I managed to get the same behaviour during the tests in wgpu-py

Here is the crazy bit: the tests actually passed just fine. And it doesn't seem like running any examples triggers this. Leading me to believe it's due to pytest. Not sure if this is an issue with wgpu-py even.

To Reproduce

pytest tests -vvsk "backends" (also happens without those flags)

Observed behavior

error trace but pass during test_diagnostics.py::test_diagnostics_with_backends

Screenshots

image

You Environment

I synced my fork, reinstalled it in pip, run download-wgpu-native.py and even installed dev requirements with -U; not sure what actually changed - maybe my Intel GPU drivers which are now 5444. Issue persist after system reboot

Vipitis avatar Apr 27 '24 21:04 Vipitis

You can rule out pytest by calling the test function directly in a throwaway script?

Korijn avatar Apr 27 '24 23:04 Korijn

I run a script like this

import wgpu.backends.wgpu_native

text = wgpu.diagnostics.get_report()

assert "Device" in text
assert "RenderPipeline" in text
assert "ShaderModule" in text

(copy and pasted the body of that test) and get no such error.

Additionally running pytest examples will also print the same trace during the second test examples/tests/test_examples.py::test_examples_screenshots[cube]. Which actually gets skipped on my system. This error also traces back to this same line. But subsequent tests, which also create an instance - do not trigger this.

So I think it's a combination of pytest and my system. Nothing actually breaks - but this seems concerning. And I am not sure how to dig deeper.

Vipitis avatar Apr 28 '24 16:04 Vipitis

I did not observe this on my windows laptop. This might be GPU specific. I will try to dig a little deeper and raise it with Intel

Vipitis avatar Apr 29 '24 14:04 Vipitis

I have since updated to driver 5594 and this no longer shows up. So I assume it has been fixed on the intel side and we will likely never know why that was an issue with pytest - closing.

Vipitis avatar Jul 08 '24 18:07 Vipitis

That's crazy! 🤣 Happy to hear the driver update resolved the issue.

Korijn avatar Jul 08 '24 18:07 Korijn