fix zluda installer bug

This commit is contained in:
Seunghoon Lee
2025-02-15 11:35:58 +09:00
parent 32fe60b594
commit f8de92ed3f
2 changed files with 8 additions and 17 deletions
+1 -1
View File
@@ -629,11 +629,11 @@ def install_rocm_zluda():
error = None
from modules import zluda_installer
zluda_installer.set_default_agent(device)
try:
if args.reinstall or zluda_installer.is_old_zluda():
zluda_installer.uninstall()
zluda_installer.install()
zluda_installer.set_default_agent(device)
except Exception as e:
error = e
log.warning(f'Failed to install ZLUDA: {e}')
+7 -16
View File
@@ -34,7 +34,12 @@ def set_default_agent(agent: rocm.Agent):
global default_agent # pylint: disable=global-statement
default_agent = agent
is_nightly = is_nightly_zluda() or (not os.path.exists(path) and nightly)
global nvcuda # pylint: disable=global-statement
if nvcuda is None:
nvcuda = ctypes.windll.LoadLibrary(os.path.join(path, 'nvcuda.dll'))
nvcuda.zluda_get_nightly_flag.restype = ctypes.c_int
nvcuda.zluda_get_nightly_flag.argtypes = []
is_nightly = nvcuda.zluda_get_nightly_flag() == 1
global hipBLASLt_available, hipBLASLt_enabled # pylint: disable=global-statement
hipBLASLt_available = is_nightly and os.path.exists(rocm.blaslt_tensile_libpath)
@@ -44,14 +49,7 @@ def set_default_agent(agent: rocm.Agent):
MIOpen_available = is_nightly and agent.gfx_version in (0x908, 0x90a, 0x940, 0x941, 0x942, 0x1030, 0x1100, 0x1101, 0x1102,)
def load_nvcuda():
global nvcuda # pylint: disable=global-statement
if nvcuda is None:
nvcuda = ctypes.windll.LoadLibrary(os.path.join(path, 'nvcuda.dll'))
def is_old_zluda() -> bool: # ZLUDA<3.8.7
load_nvcuda()
def is_old_zluda() -> bool: # ZLUDA<3.8.8
try:
nvcuda.zluda_get_nightly_flag()
return False
@@ -59,13 +57,6 @@ def is_old_zluda() -> bool: # ZLUDA<3.8.7
return True
def is_nightly_zluda() -> bool:
load_nvcuda()
nvcuda.zluda_get_nightly_flag.restype = ctypes.c_int
nvcuda.zluda_get_nightly_flag.argtypes = []
return nvcuda.zluda_get_nightly_flag() == 1
def install() -> None:
if os.path.exists(path):
return