Skip to content

Commit acdfa96

Browse files
authored
fix CUDA_VISIBLE_DEVICE=-1 bug
1 parent c67e05f commit acdfa96

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dygraph/paddleseg/utils/env/sys_env.py

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ def get_sys_env():
103103

104104
env_info['CUDA_VISIBLE_DEVICES'] = os.environ.get(
105105
'CUDA_VISIBLE_DEVICES')
106+
if gpu_nums == 0:
107+
os.environ['CUDA_VISIBLE_DEVICES'] = ''
106108
env_info['GPU'] = _get_gpu_info()
107109

108110
try:

0 commit comments

Comments
 (0)