File tree Expand file tree Collapse file tree
Sandpit/Exscientia/Process Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2037,6 +2037,9 @@ def _add_config_platform(self):
20372037 "'CUDA' platform selected but 'CUDA_VISIBLE_DEVICES' "
20382038 "environment variable is unset. Defaulting to '0'."
20392039 )
2040+ else :
2041+ num_devices = len (cuda_devices .split ("," ))
2042+ cuda_devices = "," .join ([str (x ) for x in range (num_devices )])
20402043 self .addToConfig ("properties = {'CudaDeviceIndex': '%s'}" % cuda_devices )
20412044 elif self ._platform == "OPENCL" :
20422045 opencl_devices = _os .environ .get ("OPENCL_VISIBLE_DEVICES" )
@@ -2046,6 +2049,9 @@ def _add_config_platform(self):
20462049 "'OpenCL' platform selected but 'OPENCL_VISIBLE_DEVICES' "
20472050 "environment variable is unset. Defaulting to '0'."
20482051 )
2052+ else :
2053+ num_devices = len (opencl_devices .split ("," ))
2054+ opencl_devices = "," .join ([str (x ) for x in range (num_devices )])
20492055 self .addToConfig (
20502056 "properties = {'OpenCLDeviceIndex': '%s'}" % opencl_devices
20512057 )
Original file line number Diff line number Diff line change @@ -1984,6 +1984,9 @@ def _add_config_platform(self):
19841984 "'CUDA' platform selected but 'CUDA_VISIBLE_DEVICES' "
19851985 "environment variable is unset. Defaulting to '0'."
19861986 )
1987+ else :
1988+ num_devices = len (cuda_devices .split ("," ))
1989+ cuda_devices = "," .join ([str (x ) for x in range (num_devices )])
19871990 self .addToConfig ("properties = {'CudaDeviceIndex': '%s'}" % cuda_devices )
19881991 elif self ._platform == "OPENCL" :
19891992 opencl_devices = _os .environ .get ("OPENCL_VISIBLE_DEVICES" )
@@ -1993,6 +1996,9 @@ def _add_config_platform(self):
19931996 "'OpenCL' platform selected but 'OPENCL_VISIBLE_DEVICES' "
19941997 "environment variable is unset. Defaulting to '0'."
19951998 )
1999+ else :
2000+ num_devices = len (opencl_devices .split ("," ))
2001+ opencl_devices = "," .join ([str (x ) for x in range (num_devices )])
19962002 self .addToConfig (
19972003 "properties = {'OpenCLDeviceIndex': '%s'}" % opencl_devices
19982004 )
You can’t perform that action at this time.
0 commit comments