diff --git a/superbench/benchmarks/context.py b/superbench/benchmarks/context.py index cb9a756e..d1ad2237 100644 --- a/superbench/benchmarks/context.py +++ b/superbench/benchmarks/context.py @@ -24,6 +24,7 @@ class Platform(Enum): CPU = 'CPU' CUDA = 'CUDA' ROCM = 'ROCm' + DIRECTX = 'DirectX' class Framework(Enum): diff --git a/superbench/common/devices/gpu.py b/superbench/common/devices/gpu.py index 9cbb06a9..e12889e1 100644 --- a/superbench/common/devices/gpu.py +++ b/superbench/common/devices/gpu.py @@ -29,6 +29,10 @@ class GPU(): if not list(Path('/dev/dri').glob('card*')): logger.warning('Cannot find AMD GPU device.') 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 @property diff --git a/superbench/executor/executor.py b/superbench/executor/executor.py index f7880698..ca2b7809 100644 --- a/superbench/executor/executor.py +++ b/superbench/executor/executor.py @@ -87,6 +87,8 @@ class SuperBenchExecutor(): return Platform.CUDA elif gpu.vendor == 'amd': return Platform.ROCM + elif gpu.vendor == 'amd-graphics' or gpu.vendor == 'nvidia-graphics': + return Platform.DIRECTX except Exception as e: logger.error(e) return Platform.CPU