Detect: Checkpoint untested Windows GPU detection

This commit is contained in:
Ross Patterson 2019-08-09 21:30:48 -07:00
parent 7121906e62
commit 999d047bfe
2 changed files with 16 additions and 0 deletions

View File

@ -54,6 +54,8 @@ HWACCEL_OUTPUT_FORMATS = {
'vaapi': 'vaapi'}
GPU_PRODUCT_RE = re.compile(r'(?P<chip>[^[]+)(\[(?P<board>[^]]+)\]|)')
GPU_WMI_PROPERTIES = dict(
vendor='AdapterCompatibility', board='VideoProcessor')
# Loaded from JSON
DATA = None
@ -86,6 +88,17 @@ def detect_gpus():
if not gpu['board']:
gpu['board'] = gpu.pop('chip')
elif plat_sys == 'Windows':
import wmi
for controller in wmi.WMI().Win32_VideoController():
gpu = {}
for key, wmi_prop in GPU_WMI_PROPERTIES.items():
value = controller.wmi_property(wmi_prop).value
if value:
gpu[key] = value
if gpu:
gpus.append(gpu)
else:
# TODO Other platforms
raise NotImplementedError(

View File

@ -72,6 +72,9 @@ setup(
long_description=long_description,
install_requires=['future'],
extras_require={
'detect': [
"pywin32; sys_platform == 'Windows'",
"wmi; sys_platform == 'Windows'"],
'dev': [
'future==0.17.1',
'numpy==1.16.4',