mirror of
https://github.com/clearml/clearml-agent
synced 2025-04-24 08:04:41 +00:00
CUDA_VISIBLE_DEVICES should not be set to "all"
This commit is contained in:
parent
22c5f043aa
commit
5f112447f7
@ -78,6 +78,11 @@ class Session(_Session):
|
|||||||
os.environ['CUDA_VISIBLE_DEVICES'] = os.environ['NVIDIA_VISIBLE_DEVICES'] = 'none'
|
os.environ['CUDA_VISIBLE_DEVICES'] = os.environ['NVIDIA_VISIBLE_DEVICES'] = 'none'
|
||||||
if kwargs.get('gpus') and not os.environ.get('KUBERNETES_SERVICE_HOST') \
|
if kwargs.get('gpus') and not os.environ.get('KUBERNETES_SERVICE_HOST') \
|
||||||
and not os.environ.get('KUBERNETES_PORT'):
|
and not os.environ.get('KUBERNETES_PORT'):
|
||||||
|
# CUDA_VISIBLE_DEVICES does not support 'all'
|
||||||
|
if kwargs.get('gpus') == 'all':
|
||||||
|
os.environ.pop('CUDA_VISIBLE_DEVICES', None)
|
||||||
|
os.environ['NVIDIA_VISIBLE_DEVICES'] = kwargs.get('gpus')
|
||||||
|
else:
|
||||||
os.environ['CUDA_VISIBLE_DEVICES'] = os.environ['NVIDIA_VISIBLE_DEVICES'] = kwargs.get('gpus')
|
os.environ['CUDA_VISIBLE_DEVICES'] = os.environ['NVIDIA_VISIBLE_DEVICES'] = kwargs.get('gpus')
|
||||||
if kwargs.get('only_load_config'):
|
if kwargs.get('only_load_config'):
|
||||||
from trains_agent.backend_api.config import load
|
from trains_agent.backend_api.config import load
|
||||||
|
Loading…
Reference in New Issue
Block a user