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.
during
nipet.mmrchain
, unpredictably (could be after any number of iterations), the program often crashes despite having ample free memory.This seems to be fixed by running
export OMP_NUM_THREADS=1
before launch. Unfortunately runningos.environ["OMP_NUM_THREADS"] = "1"
does not work as an alternative.Easiest fix is to add this to NiftyPET:
Otherwise (proper fix) would involve passing in that environ flag somehow when calling the crashing libraries.