Skip to content

Commit 9f59967

Browse files
committed
fix bug
1 parent 227a419 commit 9f59967

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

modules/zluda_installer.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
HIPSDK_TARGETS = ['rocblas.dll', 'rocsolver.dll', 'hipfft.dll',]
2121
ZLUDA_TARGETS = ('nvcuda.dll', 'nvml.dll',)
2222

23-
nvcuda: Optional[ctypes.WinDLL] = None
2423
hipBLASLt_available = False
2524
MIOpen_available = False
2625

@@ -34,12 +33,14 @@ def set_default_agent(agent: rocm.Agent):
3433
global default_agent # pylint: disable=global-statement
3534
default_agent = agent
3635

37-
global nvcuda # pylint: disable=global-statement
38-
if nvcuda is None:
36+
is_nightly = False
37+
try:
3938
nvcuda = ctypes.windll.LoadLibrary(os.path.join(path, 'nvcuda.dll'))
4039
nvcuda.zluda_get_nightly_flag.restype = ctypes.c_int
4140
nvcuda.zluda_get_nightly_flag.argtypes = []
42-
is_nightly = nvcuda.zluda_get_nightly_flag() == 1
41+
is_nightly = nvcuda.zluda_get_nightly_flag() == 1
42+
except Exception:
43+
pass
4344

4445
global hipBLASLt_available, hipBLASLt_enabled # pylint: disable=global-statement
4546
hipBLASLt_available = is_nightly and os.path.exists(rocm.blaslt_tensile_libpath)
@@ -49,17 +50,8 @@ def set_default_agent(agent: rocm.Agent):
4950
MIOpen_available = is_nightly and agent.gfx_version in (0x908, 0x90a, 0x940, 0x941, 0x942, 0x1030, 0x1100, 0x1101, 0x1102,)
5051

5152

52-
def is_reinstall_needed() -> bool: # ZLUDA<3.8.8
53-
if not os.path.exists(path):
54-
return False
55-
try:
56-
global nvcuda # pylint: disable=global-statement
57-
if nvcuda is None:
58-
nvcuda = ctypes.windll.LoadLibrary(os.path.join(path, 'nvcuda.dll'))
59-
nvcuda.zluda_get_nightly_flag()
60-
return False
61-
except Exception:
62-
return True
53+
def is_reinstall_needed() -> bool: # ZLUDA<3.8.7
54+
return not os.path.exists(os.path.join(path, 'cufftw.dll'))
6355

6456

6557
def install() -> None:

0 commit comments

Comments
 (0)