zluda downgrade torch on gcn cards

This commit is contained in:
Seunghoon Lee
2024-09-21 14:45:40 +09:00
parent c20ba34b3e
commit f028628e88
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -514,7 +514,7 @@ def install_rocm_zluda():
del args.device_id
try:
zluda_installer.load(zluda_path)
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.3.0 torchvision --index-url https://download.pytorch.org/whl/cu118')
torch_command = os.environ.get('TORCH_COMMAND', f'torch=={zluda_installer.get_default_torch_version(hip_default_device)} torchvision --index-url https://download.pytorch.org/whl/cu118')
log.info(f'Using ZLUDA in {zluda_path}')
except Exception as e:
error = e
+10
View File
@@ -4,6 +4,7 @@ import ctypes
import shutil
import zipfile
import urllib.request
from typing import Optional
from modules import rocm
@@ -71,3 +72,12 @@ def load(zluda_path: os.PathLike) -> None:
return os.path.join(cpp_extension.ROCM_HOME, *paths)
cpp_extension._join_rocm_home = _join_rocm_home # pylint: disable=protected-access
rocm.conceal = conceal
def get_default_torch_version(agent: Optional[rocm.Agent]) -> str:
if agent is not None:
if agent.is_navi3x or agent.is_navi2x or agent.is_navi1x:
return "2.3.1"
elif agent.is_gcn:
return "2.2.1"
return "2.3.1"