你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 04:56:51 +08:00
Updated method for detecting available GPUs.
这个提交包含在:
@@ -370,7 +370,7 @@ def detect_check_gpus(deviceIDs):
|
|||||||
"""Get information about Nvidia GPU(s).
|
"""Get information about Nvidia GPU(s).
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
deviceIDs (list): List of device IDs.
|
deviceIDs (list): List of integers of device IDs.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
gpus (list): Detected GPU(s) object(s).
|
gpus (list): Detected GPU(s) object(s).
|
||||||
@@ -387,8 +387,11 @@ def detect_check_gpus(deviceIDs):
|
|||||||
raise GeneralError('No NVIDIA CUDA-Enabled GPUs detected (https://developer.nvidia.com/cuda-gpus)')
|
raise GeneralError('No NVIDIA CUDA-Enabled GPUs detected (https://developer.nvidia.com/cuda-gpus)')
|
||||||
|
|
||||||
# Get list of available GPU device IDs
|
# Get list of available GPU device IDs
|
||||||
deviceIDsavail = os.environ.get('CUDA_VISIBLE_DEVICES')
|
if 'CUDA_VISIBLE_DEVICES' in os.environ:
|
||||||
deviceIDsavail = [int(s) for s in deviceIDsavail.split(',')]
|
deviceIDsavail = os.environ.get('CUDA_VISIBLE_DEVICES')
|
||||||
|
deviceIDsavail = [int(s) for s in deviceIDsavail.split(',')]
|
||||||
|
else:
|
||||||
|
deviceIDsavail = range(drv.Device.count())
|
||||||
|
|
||||||
# Print information about all detected GPUs
|
# Print information about all detected GPUs
|
||||||
gpus = []
|
gpus = []
|
||||||
|
在新工单中引用
屏蔽一个用户