Skip to content

Commit c1b8132

Browse files
committed
fix(iluvatar): failed to load ixml
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 9a474a9 commit c1b8132

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

gpustack_runtime/detector/iluvatar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def is_supported() -> bool:
6262
pyixml.nvmlShutdown()
6363
supported = True
6464
except pyixml.NVMLError:
65-
debug_log_exception(logger, "Failed to initialize IXML library")
65+
debug_log_exception(logger, "Failed to initialize IXML")
6666

6767
return supported
6868

@@ -102,7 +102,7 @@ def detect(self) -> Devices | None:
102102

103103
sys_runtime_ver_original = None
104104
sys_runtime_ver = None
105-
with contextlib.suppress(pyixml.NVMLError):
105+
with contextlib.suppress(Exception):
106106
sys_runtime_ver_original = pyixml.nvmlSystemGetCudaDriverVersion()
107107
sys_runtime_ver_original = ".".join(
108108
map(

gpustack_runtime/detector/pyixml/__init__.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2929
# THE POSSIBILITY OF SUCH DAMAGE.
3030
#####
31+
import os
3132

3233
##
3334
# Python bindings for the NVML library
@@ -2162,8 +2163,20 @@ def _LoadNvmlLibrary():
21622163
# Linux path
21632164
locs = [
21642165
"libixml.so",
2165-
str(Path(__file__).resolve().parent / "libixml.so"),
21662166
]
2167+
for default_path in [
2168+
"/usr/local/corex",
2169+
]:
2170+
iluvatar_path = Path(
2171+
os.getenv("COREX_HOME", default_path),
2172+
)
2173+
if iluvatar_path.exists():
2174+
locs.extend(
2175+
[
2176+
str(iluvatar_path / "lib64/libixml.so"),
2177+
str(iluvatar_path / "lib/libixml.so"),
2178+
]
2179+
)
21672180
for loc in locs:
21682181
try:
21692182
nvmlLib = CDLL(loc)

gpustack_runtime/detector/thead.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def is_supported() -> bool:
6464
pyhgml.hgmlShutdown()
6565
supported = True
6666
except pyhgml.HGMLError:
67-
debug_log_exception(logger, "Failed to initialize HGML library")
67+
debug_log_exception(logger, "Failed to initialize HGML")
6868

6969
return supported
7070

0 commit comments

Comments
 (0)