Commit f57d86f4 authored by one's avatar one
Browse files

Update GPU vendors

parent 49a4389b
......@@ -282,7 +282,7 @@ def __prepare_general_ib_command_params(self, msg_size, device='cpu'):
gpu = GPU()
if gpu.vendor == 'nvidia':
gpu_dev = f'--use_cuda={self._args.gpu_dev}'
elif gpu.vendor == 'amd':
elif gpu.vendor == 'amd' or gpu.vendor == 'hygon':
gpu_dev = f'--use_rocm={self._args.gpu_dev}'
else:
self._result.set_return_code(ReturnCode.INVALID_ARGUMENT)
......
......@@ -12,7 +12,7 @@
gpu = GPU()
if gpu.vendor == 'nvidia' or gpu.vendor == 'nvidia-graphics':
import py3nvml.py3nvml as nvml
elif gpu.vendor == 'amd' or gpu.vendor == 'amd-graphics':
elif gpu.vendor == 'amd' or gpu.vendor == 'amd-graphics' or gpu.vendor == 'hygon':
import amdsmi as rocml
......@@ -456,5 +456,5 @@ def get_device_ecc_error(self, idx):
device_manager: Optional[DeviceManager] = DeviceManager()
if gpu.vendor == 'nvidia' or gpu.vendor == 'nvidia-graphics':
device_manager = NvidiaDeviceManager()
elif gpu.vendor == 'amd' or gpu.vendor == 'amd-graphics':
elif gpu.vendor == 'amd' or gpu.vendor == 'amd-graphics' or gpu.vendor == 'hygon':
device_manager = AmdDeviceManager()
......@@ -286,6 +286,13 @@ def get_gpu_amd(self):
return gpu_dict
def get_gpu_hygon(self):
"""Get hygon gpu info."""
gpu_dict = self.get_gpu_amd()
if gpu_dict:
gpu_dict['accelerator_vendor'] = 'hygon'
return gpu_dict
def get_gpu(self):
"""Get gpu info and identify gpu type(nvidia/amd).
......@@ -296,6 +303,8 @@ def get_gpu(self):
if Path('/dev/nvidiactl').is_char_device() and Path('/dev/nvidia-uvm').is_char_device():
return self.get_gpu_nvidia()
if Path('/dev/kfd').is_char_device() and Path('/dev/dri').is_dir():
if Path('/usr/local/hyhal').exists() or Path('/opt/hyhal').exists():
return self.get_gpu_hygon()
return self.get_gpu_amd()
except Exception:
logger.exception('Error: get gpu info failed')
......
......@@ -224,6 +224,11 @@ def test_ib_traffic_performance(self, mock_gpu):
expect_command = expect_command.replace('cuda', 'rocm')
command = benchmark._bin_name + benchmark._commands[0].split(benchmark._bin_name)[1]
assert (command == expect_command)
mock_gpu.return_value = 'hygon'
benchmark = benchmark_class(benchmark_name, parameters=parameters)
ret = benchmark._preprocess()
command = benchmark._bin_name + benchmark._commands[0].split(benchmark._bin_name)[1]
assert (command == expect_command)
parameters = '--command ib_read_lat --ib_dev mlx5_0 --iters 2000 --msg_size 33554432 ' + \
'--pattern one-to-one --hostfile hostfile --gpu_dev 0 --direction gpu-to-gpu'
......
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