mirror of
https://github.com/sgjzfzzf/triton-tvm-ffi.git
synced 2026-05-02 03:52:11 +08:00
fix bugs on lacking cudatoolkit
Signed-off-by: Jinjie Liu <jjliu@baai.ac.cn>
This commit is contained in:
@@ -155,22 +155,28 @@ def torch_wrap(
|
|||||||
extra_ldflags: Optional[Sequence[str]] = None,
|
extra_ldflags: Optional[Sequence[str]] = None,
|
||||||
extra_include_paths: Optional[Sequence[Union[str, Path]]] = None,
|
extra_include_paths: Optional[Sequence[Union[str, Path]]] = None,
|
||||||
) -> TVMFFIWrapperFunction:
|
) -> TVMFFIWrapperFunction:
|
||||||
|
cuda_home: str = tvm_ffi.cpp.extension._find_cuda_home()
|
||||||
return wrap(
|
return wrap(
|
||||||
name,
|
name,
|
||||||
fns,
|
fns,
|
||||||
code,
|
code,
|
||||||
extra_ldflags=[
|
extra_ldflags=[
|
||||||
"-Wl,--no-as-needed",
|
"-Wl,--no-as-needed",
|
||||||
|
f"-L{cuda_home}/lib64",
|
||||||
*map(
|
*map(
|
||||||
lambda path: f"-L{path}",
|
lambda path: f"-L{path}",
|
||||||
torch.utils.cpp_extension.library_paths(),
|
torch.utils.cpp_extension.library_paths(),
|
||||||
),
|
),
|
||||||
|
"-lcuda",
|
||||||
"-lc10",
|
"-lc10",
|
||||||
"-ltorch",
|
"-ltorch",
|
||||||
]
|
]
|
||||||
+ (extra_ldflags or []),
|
+ (extra_ldflags or []),
|
||||||
extra_cflags=extra_cflags,
|
extra_cflags=extra_cflags,
|
||||||
extra_cuda_cflags=extra_cuda_cflags,
|
extra_cuda_cflags=extra_cuda_cflags,
|
||||||
extra_include_paths=[*torch.utils.cpp_extension.include_paths()]
|
extra_include_paths=[
|
||||||
|
f"{cuda_home}/include",
|
||||||
|
*torch.utils.cpp_extension.include_paths(),
|
||||||
|
]
|
||||||
+ (extra_include_paths or []),
|
+ (extra_include_paths or []),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user