diff --git a/lib/constants.py b/lib/constants.py index dc317f0..e5b87fa 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -1,4 +1,4 @@ GPU_ID_TO_NAME = { - "0x20C210DE": "NVIDIA CMP 170HX", - "0x208210DE": "NVIDIA CMP 170HX" + "0x20c210de": "NVIDIA CMP 170HX", + "0x208210de": "NVIDIA CMP 170HX" } diff --git a/lib/get_specs.py b/lib/get_specs.py index fae4ce9..7a0b39f 100644 --- a/lib/get_specs.py +++ b/lib/get_specs.py @@ -269,8 +269,9 @@ def get_gpu_info(): parts = [s.strip() for s in line.split(',')] if len(parts)>12 and index>0: gpu_name_xl = parts[1] - if gpu_name_xl == "NVIDIA Graphics Device" and parts[13] in constants.GPU_ID_TO_NAME: - gpu_name_xl = constants.GPU_ID_TO_NAME[parts[13]] + gpu_id_xl = parts[13].lower() + if gpu_name_xl == "NVIDIA Graphics Device" and gpu_id_xl in constants.GPU_ID_TO_NAME: + gpu_name_xl = constants.GPU_ID_TO_NAME[gpu_id_xl] xl_gpu_info={ "id":index-1, @@ -304,7 +305,7 @@ def get_gpu_info(): if bool(re.match(r'^[0-9]+$', parts[0])): gpu_name = parts[1].strip() - gpu_id = parts[5].strip(); + gpu_id = parts[5].strip().lower() if gpu_name == "NVIDIA Graphics Device" and gpu_id in constants.GPU_ID_TO_NAME: gpu_name = constants.GPU_ID_TO_NAME[gpu_id] diff --git a/lib/nvml.py b/lib/nvml.py index 1eca64d..66b95f0 100644 --- a/lib/nvml.py +++ b/lib/nvml.py @@ -101,7 +101,7 @@ def init(gpu_specs_file=None, allow_hive_binaries=True): gpu_name = pynvml.nvmlDeviceGetName(gpu_handle) print(gpu_name) - gpu_device_id = hex(pynvml.nvmlDeviceGetPciInfo(gpu_handle).pciDeviceId).upper() + gpu_device_id = hex(pynvml.nvmlDeviceGetPciInfo(gpu_handle).pciDeviceId).lower() print(gpu_device_id) print(constants.GPU_ID_TO_NAME) if gpu_name == "NVIDIA Graphics Device" and gpu_device_id in constants.GPU_ID_TO_NAME: @@ -132,7 +132,7 @@ def init(gpu_specs_file=None, allow_hive_binaries=True): gpu_spec["power_limits"] = [min_power_limit, max_power_limit] gpu_name_regen = pynvml.nvmlDeviceGetName(gpu_handle) - gpu_device_id_regen = hex(pynvml.nvmlDeviceGetPciInfo(gpu_handle).pciDeviceId).upper() + gpu_device_id_regen = hex(pynvml.nvmlDeviceGetPciInfo(gpu_handle).pciDeviceId).lower() if gpu_name_regen == "NVIDIA Graphics Device" and gpu_device_id_regen in constants.GPU_ID_TO_NAME: gpu_name_regen = constants.GPU_ID_TO_NAME[gpu_device_id_regen]