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

Is there a way to avoid the thread lock in cuda driver? #169

Open
coreylowman opened this issue Jul 10, 2023 · 0 comments
Open

Is there a way to avoid the thread lock in cuda driver? #169

coreylowman opened this issue Jul 10, 2023 · 0 comments

Comments

@coreylowman
Copy link
Owner

coreylowman commented Jul 10, 2023

Okay, after too much time investigating. It seems the Cuda Driver (not NCCL) is using a global MUTEX which makes multithread/multigpu quite useless.
https://forums.developer.nvidia.com/t/cuda-wont-concurrently-run-kernels-on-multiple-devices-from-within-same-process/240388
https://forums.developer.nvidia.com/t/multithreaded-tensorrt-performance-drops-dramatically/184882/8
https://forums.developer.nvidia.com/t/cuda-introduces-heavy-locks/61357

Basically all threads will contend for that lock not enabling the CPU to send kernels fast enough.

If there's any way to avoid that mutex as it makes the code significantly simpler to be multi thread rather than multiprocess.
But the tone in the related issues makes me think it's a known issue and nothing is going to be done about it.

Edit: I updated the code and internals to reflect that hopefully saving future devs from being bitten in the same way.

Originally posted by @Narsil in #164 (comment)

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

1 participant