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

Does the debug device support ANARI_KHR_DEVICE_SYNCHRONIZATION? #227

Open
stukowski opened this issue Sep 1, 2024 · 2 comments
Open

Does the debug device support ANARI_KHR_DEVICE_SYNCHRONIZATION? #227

stukowski opened this issue Sep 1, 2024 · 2 comments

Comments

@stukowski
Copy link

It looks like the implementation of DebugDevice::newObjectHandle is not thread-safe. So I was wondering: Does the debug layer fully support the ANARI_KHR_DEVICE_SYNCHRONIZATION extension (given the wrapped device does support it)?

I am asking because I am observing occasional segfaults in multi-threaded application code that constructs ANARI scene objects.

@jeffamstutz
Copy link
Contributor

It currently isn't thread safe, but really should be. The visgl device takes an approach that would work generically by putting all ANARI calls on a background thread, but that would need to be ported to the debug device. It's actually possible for that to be a generic layer, making it usable in more contexts. This is a good request to prioritize -- we will see where this can be worked on, but no time estimate just yet.

@stukowski
Copy link
Author

Thanks. This is not urgent. I can continue without the debug layer for some time.

I had hoped that it would be sufficient to simply guard the DebugDevice::objects and DebugDevice::objectMap fields against concurrent accesses using an internal mutex. But maybe that would cost too much performance or the situation is more complicated than I think. I have not delved any deeper into the inner workings of the debug layer.

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

2 participants