diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-01-06 16:49:56 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-01-19 16:50:17 +0100 |
commit | 5bc9c23c84a3e7f079b75d0bee50c570a7372920 (patch) | |
tree | 4dd832189ce5bdde2bcace69aaa6bc31df0dfd51 /python/astra | |
parent | 76d182ace088b7ab6d64019079c049a0f9a29e69 (diff) | |
download | astra-5bc9c23c84a3e7f079b75d0bee50c570a7372920.tar.gz astra-5bc9c23c84a3e7f079b75d0bee50c570a7372920.tar.bz2 astra-5bc9c23c84a3e7f079b75d0bee50c570a7372920.tar.xz astra-5bc9c23c84a3e7f079b75d0bee50c570a7372920.zip |
Allow multiple GPUs in ASTRA_GPU_INDEX envvar
Diffstat (limited to 'python/astra')
-rw-r--r-- | python/astra/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/astra/__init__.py b/python/astra/__init__.py index 10ed74d..515d9a2 100644 --- a/python/astra/__init__.py +++ b/python/astra/__init__.py @@ -39,7 +39,7 @@ from . import log from .optomo import OpTomo import os -try: - astra.set_gpu_index(int(os.environ['ASTRA_GPU_INDEX'])) -except KeyError: - pass + +if 'ASTRA_GPU_INDEX' in os.environ: + L = [ int(x) for x in os.environ['ASTRA_GPU_INDEX'].split(',') ] + astra.set_gpu_index(L) |