scenerygraphics / sciview

sciview is a tool for visualization and interaction with ND image and mesh data
BSD 2-Clause "Simplified" License
66 stars 17 forks source link

Verbose crashing when Renderer fails #219

Closed kephale closed 5 months ago

kephale commented 4 years ago

There have been multiple reports (and I have had the same issue) where doing something crashes the renderer but not the SciView window (e.g. renderer goes black and nothing seems to show). However, no exception is emitted and there is no indication about what went wrong.

@skalarproduktraum I wonder if something is being caught in scenery and not propagated?

skalarproduktraum commented 4 years ago

So I just saw a similar issue myself, which happened because there were some old spirvcrossj binaries still in the classpath. Does the problem you are describing only happen during startup or in general?

kephale commented 4 years ago

Startup

skalarproduktraum commented 4 years ago

Okay, then this is probably the same issue I was seeing. I suppose also inspector etc. was not showing up? I could however only reproduce the behaviour with the Vulkan renderer, OpenGL crashes verbosely.

During startup, sciview waits for the renderer to initialise (see https://github.com/scenerygraphics/sciview/blob/0cb4349942291d434605781eac42354807076525/src/main/java/sc/iview/SciView.java#L455) -- I propose adding a timeout there, with verbose error messages.

kephale commented 4 years ago

:+1: great solution

skalarproduktraum commented 4 years ago

Although I have to admit that the timeout again kind of hides the problem. The issue I was seeing was caused by an older spirvcrossj version in the classpath, which triggered an UnsatisfiedLinkError. That should be logged, and the alternative renderer tried, which in this case, would also fail, causing the exception to be rethrown... I have no idea atm why that is not happening.

kephale commented 4 years ago

Well, it doesn't solve the problem, but it does at least kind of reveal that there is a problem.

The bigger concern was that users were suuuuuuper frustrated by getting a black render view and no error message, so they couldn't even figure out if it was because their hardware was too slow, how long they should wait before assuming it is an error, etc. So this timeout would reduce user frustration, which is valuable.

kephale commented 5 months ago

I do not think this is relevant anymore.