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

GPUSPH creates a context on the first GPU system even if it's not in use #17

Oblomov opened this Issue Oct 19, 2016 · 0 comments


None yet
1 participant

Oblomov commented Oct 19, 2016

This is due to the main thread using cudaMallocHost to allocate pinned memory for the cell data. Since cudaMallocHost requires a CUDA context, and no context is active on the main thread at the time, the runtime automatically creates one on the first available device. This can cause issues if the first GPU is set to exclusive mode.

A possible solution is to do a standard (or possibly page-aligned) allocation from the main thread, and then pin it and register for CUDA from one of the GPUWorkers (cudaHostRegister).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment