Skip to content

Commit

Permalink
Benchmarks - Add support for DirectX GPU platform (#536)
Browse files Browse the repository at this point in the history
**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
  • Loading branch information
yukirora committed Jun 21, 2023
1 parent e909ddd commit bbb0e24
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions superbench/benchmarks/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Platform(Enum):
CPU = 'CPU'
CUDA = 'CUDA'
ROCM = 'ROCm'
DIRECTX = 'DirectX'


class Framework(Enum):
Expand Down
4 changes: 4 additions & 0 deletions superbench/common/devices/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def get_vendor(self):
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
Expand Down
2 changes: 2 additions & 0 deletions superbench/executor/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def __get_platform(self):
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
Expand Down

0 comments on commit bbb0e24

Please sign in to comment.