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

BLAS : Program is Terminated. Because you tried to allocate too many memory regions. #21

Open
casperdcl opened this issue Aug 1, 2020 · 0 comments

Comments

@casperdcl
Copy link
Member

casperdcl commented Aug 1, 2020

during nipet.mmrchain, unpredictably (could be after any number of iterations), the program often crashes despite having ample free memory.

i> using CUDA device #0
i> put gaps in and reorder sino...DONE in 0.001838s.
BLAS : Program is Terminated. Because you tried to allocate too many memory regions.
...
BLAS : Program is Terminated. Because you tried to allocate too many memory regions.

This seems to be fixed by running export OMP_NUM_THREADS=1 before launch.
Unfortunately running os.environ["OMP_NUM_THREADS"] = "1" does not work as an alternative.

Easiest fix is to add this to NiftyPET:

if os.getenv("OMP_NUM_THREADS", None) != "1":
    raise EnvironmentError("should run `export OMP_NUM_THREADS=1` before launch")

Otherwise (proper fix) would involve passing in that environ flag somehow when calling the crashing libraries.

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

No branches or pull requests

1 participant