File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -272,13 +272,20 @@ class GPUBenchmark:
272272
273273 if self .duration is not None :
274274 log_debug (f"Running GPU benchmark for { self .duration } seconds" )
275- gpu_prog = [
276- f"CUDA_DEVICE_ORDER=PCI_BUS_ID CUDA_VISIBLE_DEVICES={ self .device } { this_dir .joinpath ('./gpu_benchmark' )} { self .work } { self .duration } " ]
275+ if shutil .which ("nvidia-smi" ) is not None :
276+ gpu_prog = [
277+ f"CUDA_DEVICE_ORDER=PCI_BUS_ID CUDA_VISIBLE_DEVICES={ self .device } { this_dir .joinpath ('./gpu_benchmark' )} { self .work } { self .duration } " ]
278+ else :
279+ gpu_prog = [
280+ f"HIP_DEVICE_ORDER=PCI_BUS_ID HIP_VISIBLE_DEVICES={ self .device } { this_dir .joinpath ('./gpu_benchmark' )} { self .work } { self .duration } " ]
277281 else :
278282 log_debug (f"Running GPU benchmark for { self .work } units of work" )
279- gpu_prog = [
280- f"CUDA_DEVICE_ORDER=PCI_BUS_ID CUDA_VISIBLE_DEVICES={ self .device } { this_dir .joinpath ('./gpu_benchmark' )} { self .work } " ]
281-
283+ if shutil .which ("nvidia-smi" ) is not None :
284+ gpu_prog = [
285+ f"CUDA_DEVICE_ORDER=PCI_BUS_ID CUDA_VISIBLE_DEVICES={ self .device } { this_dir .joinpath ('./gpu_benchmark' )} { self .work } " ]
286+ else :
287+ gpu_prog = [
288+ f"HIP_DEVICE_ORDER=PCI_BUS_ID HIP_VISIBLE_DEVICES={ self .device } { this_dir .joinpath ('./gpu_benchmark' )} { self .work } " ]
282289 p = subprocess .Popen (gpu_prog , shell = True )
283290 return ProcessHandle (p )
284291
You can’t perform that action at this time.
0 commit comments