mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-01-13 22:18:36 +08:00
fix cuda driver link issue with driver version less than 12.3 (#5025)
Signed-off-by: Dongxu Yang <78518666+dongxuy04@users.noreply.github.com>
This commit is contained in:
parent
ec6b1821c7
commit
7137cc8f67
@ -1,4 +1,7 @@
|
||||
import os
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.errors import ConanInvalidConfiguration
|
||||
|
||||
|
||||
class LibnumaSystemConan(ConanFile):
|
||||
@ -13,24 +16,36 @@ class LibnumaSystemConan(ConanFile):
|
||||
return
|
||||
|
||||
self.cpp_info.includedirs = ["/usr/include"]
|
||||
libdirs = []
|
||||
|
||||
arch = str(self.settings.arch)
|
||||
os_name = str(self.settings.os)
|
||||
|
||||
if os_name == "Linux":
|
||||
lib_candidates = [
|
||||
"/usr/lib64/libnuma.so", # RHEL/CentOS/Rocky
|
||||
"/lib64/libnuma.so", # possible fallback
|
||||
]
|
||||
if arch == "x86_64":
|
||||
libdirs.append("/usr/lib/x86_64-linux-gnu")
|
||||
# Debian/Ubuntu x86_64
|
||||
lib_candidates.append("/usr/lib/x86_64-linux-gnu/libnuma.so")
|
||||
elif arch in ["armv8", "aarch64"]:
|
||||
libdirs.append("/usr/lib/aarch64-linux-gnu")
|
||||
# Debian/Ubuntu aarch64
|
||||
lib_candidates.append("/usr/lib/aarch64-linux-gnu/libnuma.so")
|
||||
else:
|
||||
self.output.warn(
|
||||
f"Unrecognized architecture: {arch}, falling back to /usr/lib"
|
||||
self.output.info(
|
||||
f"Unrecognized architecture: {arch}, falling back to /usr/lib/libnuma.so"
|
||||
)
|
||||
libdirs.append("/usr/lib")
|
||||
lib_candidates.append("/usr/lib/libnuma.so")
|
||||
for lib in lib_candidates:
|
||||
if os.path.exists(lib):
|
||||
self.output.info(f"Using libnuma from: {lib}")
|
||||
self.cpp_info.set_property("cmake_link_options", [lib])
|
||||
break
|
||||
else:
|
||||
raise ConanInvalidConfiguration(
|
||||
"libnuma.so not found on system")
|
||||
else:
|
||||
self.output.warn(f"Unsupported OS: {os_name}, assuming /usr/lib")
|
||||
libdirs.append("/usr/lib")
|
||||
raise ConanInvalidConfiguration(f"Unsupported OS: {os_name}")
|
||||
|
||||
self.cpp_info.libdirs = libdirs
|
||||
self.cpp_info.libdirs = []
|
||||
self.cpp_info.system_libs = ["numa"]
|
||||
|
||||
@ -104,4 +104,5 @@ if(NOT WIN32)
|
||||
message(STATUS "libnuma found.")
|
||||
endif()
|
||||
target_link_libraries(runtime_src PUBLIC libnuma::libnuma)
|
||||
target_link_options(runtime_src PUBLIC ${CONAN_LIBNUMA_LINK_OPTIONS})
|
||||
endif()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user