From 067512b8a35736e57d8132ae7f8e9d584a8b4232 Mon Sep 17 00:00:00 2001 From: Seunghoon Lee Date: Sat, 15 Feb 2025 11:42:49 +0900 Subject: [PATCH] fix --- installer.py | 2 +- modules/zluda_installer.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/installer.py b/installer.py index ff5574b80..ccaeb1227 100644 --- a/installer.py +++ b/installer.py @@ -630,7 +630,7 @@ def install_rocm_zluda(): error = None from modules import zluda_installer try: - if args.reinstall or zluda_installer.is_old_zluda(): + if args.reinstall or zluda_installer.is_reinstall_needed(): zluda_installer.uninstall() zluda_installer.install() zluda_installer.set_default_agent(device) diff --git a/modules/zluda_installer.py b/modules/zluda_installer.py index 85876f482..347f92b06 100644 --- a/modules/zluda_installer.py +++ b/modules/zluda_installer.py @@ -49,11 +49,16 @@ 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 is_old_zluda() -> bool: # ZLUDA<3.8.8 +def is_reinstall_needed() -> bool: # ZLUDA<3.8.8 + if not os.path.exists(path): + return False try: + 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() return False - except AttributeError: + except Exception: return True