nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

Adding lock for Viser Element callbacks

Open Satvik1701 opened this issue 1 year ago • 2 comments

I added a wrapper around the viser element callback so the render thread is blocked while the callback is called to avoid crashing. I also added a lock in run_viewer.py so this issue is addressed for both ns-train and ns-viewer.

Test: I added time.sleep() in the callback and confirmed the render thread was blocked.

Satvik1701 avatar Apr 11 '24 15:04 Satvik1701

What kinds of crash did you see? I also experienced crashes (#3064 ) in the viser viewer.

jb-ye avatar Apr 11 '24 17:04 jb-ye

This PR fixes a bug with a race condition in custom viewer element callbacks (eg a ViewerButton which renders the current view), previously this might clash with the standard rendering thread and crash the callback or main renderer.

kerrj avatar Apr 11 '24 17:04 kerrj

@kerrj I found this PR impacts the experience of ns-viewer when training gaussian splatting. The delay when I rotate the scene is so long that basically disallow me to interact with the scene. Do you observe similar issue?

jb-ye avatar Apr 30 '24 21:04 jb-ye

That's odd I don't notice any difference. In fact it shouldn't affect things since the only code that was added to the lock was viser element callbacks, which splatfacto doesn't have any of.

kerrj avatar May 01 '24 00:05 kerrj