28d18ec836fe42bebddaa56c41f8432caa0add79,python/ray/resource_spec.py,,_autodetect_num_gpus,#,229
Before Change
proc_gpus_path = "/proc/driver/nvidia/gpus"
if os.path.isdir(proc_gpus_path):
return len(os.listdir(proc_gpus_path))
return 0
After Change
elif sys.platform == "win32":
props = "AdapterCompatibility"
cmdargs = ["WMIC", "PATH", "Win32_VideoController", "GET", props]
lines = subprocess .check_output(cmdargs).splitlines()[1:]
result = len([l.rstrip() for l in lines if l.startswith(b"NVIDIA")])
return result
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: ray-project/ray
Commit Name: 28d18ec836fe42bebddaa56c41f8432caa0add79
Time: 2020-07-04
Author: mehrdadn@users.noreply.github.com
File Name: python/ray/resource_spec.py
Class Name:
Method Name: _autodetect_num_gpus
Project Name: Microsoft/nni
Commit Name: acc311dd3e15135ca35f69b0183e5b0f9f4beadf
Time: 2019-04-27
Author: 15094695770@163.com
File Name: tools/nni_gpu_tool/gpu_metrics_collector.py
Class Name:
Method Name: check_ready_to_run
Project Name: home-assistant/home-assistant
Commit Name: e4a45fa85755ca7abc7374c54d4b793e6caa9763
Time: 2017-01-16
Author: martinstubbs@gmail.com
File Name: homeassistant/components/light/x10.py
Class Name:
Method Name: get_unit_status