Skip to content

Commit 067512b

Browse files
committed
fix
1 parent f8de92e commit 067512b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ def install_rocm_zluda():
630630
error = None
631631
from modules import zluda_installer
632632
try:
633-
if args.reinstall or zluda_installer.is_old_zluda():
633+
if args.reinstall or zluda_installer.is_reinstall_needed():
634634
zluda_installer.uninstall()
635635
zluda_installer.install()
636636
zluda_installer.set_default_agent(device)

modules/zluda_installer.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,16 @@ def set_default_agent(agent: rocm.Agent):
4949
MIOpen_available = is_nightly and agent.gfx_version in (0x908, 0x90a, 0x940, 0x941, 0x942, 0x1030, 0x1100, 0x1101, 0x1102,)
5050

5151

52-
def is_old_zluda() -> bool: # ZLUDA<3.8.8
52+
def is_reinstall_needed() -> bool: # ZLUDA<3.8.8
53+
if not os.path.exists(path):
54+
return False
5355
try:
56+
global nvcuda # pylint: disable=global-statement
57+
if nvcuda is None:
58+
nvcuda = ctypes.windll.LoadLibrary(os.path.join(path, 'nvcuda.dll'))
5459
nvcuda.zluda_get_nightly_flag()
5560
return False
56-
except AttributeError:
61+
except Exception:
5762
return True
5863

5964

0 commit comments

Comments
 (0)