Unverified Commit bbb0e243 authored by Yuting Jiang's avatar Yuting Jiang Committed by GitHub
Browse files

Benchmarks - Add support for DirectX GPU platform (#536)

**Description**
Add support for DirectX GPU platform.

**Major Revision**
- Add DirectX platform for benchmark registry
- Add gpu_vendor identify for AMD and NVIDIA with win driver
parent e909ddd0
...@@ -24,6 +24,7 @@ class Platform(Enum): ...@@ -24,6 +24,7 @@ class Platform(Enum):
CPU = 'CPU' CPU = 'CPU'
CUDA = 'CUDA' CUDA = 'CUDA'
ROCM = 'ROCm' ROCM = 'ROCm'
DIRECTX = 'DirectX'
class Framework(Enum): class Framework(Enum):
......
...@@ -29,6 +29,10 @@ def get_vendor(self): ...@@ -29,6 +29,10 @@ def get_vendor(self):
if not list(Path('/dev/dri').glob('card*')): if not list(Path('/dev/dri').glob('card*')):
logger.warning('Cannot find AMD GPU device.') logger.warning('Cannot find AMD GPU device.')
return 'amd' return 'amd'
if list(Path(r'C:\Windows\System32').glob('*DriverStore/FileRepository/nv*.inf_amd64_*/nvapi64.dll')):
return 'nvidia-graphics'
if list(Path(r'C:\Windows\System32').glob('*DriverStore/FileRepository/u*.inf_amd64_*/*/aticfx64.dll')):
return 'amd-graphics'
return None return None
@property @property
......
...@@ -87,6 +87,8 @@ def __get_platform(self): ...@@ -87,6 +87,8 @@ def __get_platform(self):
return Platform.CUDA return Platform.CUDA
elif gpu.vendor == 'amd': elif gpu.vendor == 'amd':
return Platform.ROCM return Platform.ROCM
elif gpu.vendor == 'amd-graphics' or gpu.vendor == 'nvidia-graphics':
return Platform.DIRECTX
except Exception as e: except Exception as e:
logger.error(e) logger.error(e)
return Platform.CPU return Platform.CPU
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment