diff --git a/installer.py b/installer.py index 0b2498a8a..54b4d1971 100644 --- a/installer.py +++ b/installer.py @@ -477,11 +477,7 @@ def install_rocm_zluda(): try: amd_gpus = rocm.get_agents() if len(amd_gpus) == 0: - if sys.platform == "win32": - log.warning('You do not have perl or any AMDGPUs. The installer may select a wrong device as compute device.') - log.info('ROCm: no agent was found') - else: - log.warning('ROCm: no agent was found') + log.warning('ROCm: no agent was found') else: log.info(f'ROCm: agents={[gpu.name for gpu in amd_gpus]}') if args.device_id is None: diff --git a/modules/rocm.py b/modules/rocm.py index 360270140..e3fbdfca2 100644 --- a/modules/rocm.py +++ b/modules/rocm.py @@ -24,8 +24,8 @@ def dirname(path_: str, r: int = 1) -> str: return path_ -def spawn(command: str) -> str: - process = subprocess.run(command, shell=True, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +def spawn(command: str, cwd: os.PathLike = '.') -> str: + process = subprocess.run(command, cwd=cwd, shell=True, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) return process.stdout.decode(encoding="utf8", errors="ignore") @@ -142,7 +142,7 @@ if sys.platform == "win32": return os.path.basename(path) or os.path.basename(os.path.dirname(path)) def get_agents() -> List[Agent]: - return [Agent(x.split(' ')[-1].strip()) for x in spawn("hipinfo").split("\n") if x.startswith('gcnArchName:')] + return [Agent(x.split(' ')[-1].strip()) for x in spawn("hipinfo", cwd=os.path.join(path, 'bin')).split("\n") if x.startswith('gcnArchName:')] is_wsl: bool = False else: @@ -155,7 +155,7 @@ else: return resolve_link("/opt/rocm") def get_version() -> str: - arr = spawn(f"{os.path.join(path, 'bin', 'hipconfig')} --version").split(".") + arr = spawn("hipconfig --version", cwd=os.path.join(path, 'bin')).split(".") return f'{arr[0]}.{arr[1]}' if len(arr) >= 2 else None def get_agents() -> List[Agent]: