rocm wsl better arch detection

This commit is contained in:
Seunghoon Lee
2025-04-01 21:14:02 +09:00
parent e8ae79cc49
commit 0eaa2c0378
+4 -4
View File
@@ -172,12 +172,12 @@ else:
return f'{arr[0]}.{arr[1]}' if len(arr) >= 2 else None
def get_agents() -> List[Agent]:
if is_wsl: # WSL does not have 'rocm_agent_enumerator'
agents = spawn("rocminfo").split("\n")
agents = [x.strip().split(" ")[-1] for x in agents if x.startswith(' Name:') and "CPU" not in x]
else:
try:
agents = spawn("rocm_agent_enumerator").split("\n")
agents = [x for x in agents if x and x != 'gfx000']
except Exception: # old version of ROCm WSL doesn't have rocm_agent_enumerator
agents = spawn("rocminfo").split("\n")
agents = [x.strip().split(" ")[-1] for x in agents if x.startswith(' Name:') and "CPU" not in x]
return [Agent(x) for x in agents]
def load_hsa_runtime() -> None: