Skip to content

Commit dfc2661

Browse files
authored
[build_local] Symlink libdevice and fatbinary for GPU builds (#1579)
* [build_local] Also symlink `libdevice` to appropriate path * [build_local] Symlink `fatbinary` too
1 parent 257815a commit dfc2661

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

deps/build_local.jl

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,19 +187,25 @@ lib_path = joinpath(source_dir, "bazel-bin", only(built_libs))
187187
isfile(lib_path) || error("Could not find library $lib_path in build directory")
188188

189189
if build_backend == "cuda"
190-
if !Base.Filesystem.ispath(joinpath(source_dir, "bazel-bin", "cuda", "bin", "ptxas"))
191-
Base.Filesystem.mkpath(joinpath(source_dir, "bazel-bin", "cuda", "bin"))
192-
Base.Filesystem.symlink(
193-
joinpath(
194-
source_dir,
195-
"bazel-bin",
196-
"libReactantExtra.so.runfiles",
197-
"cuda_nvcc",
198-
"bin",
199-
"ptxas",
200-
),
201-
joinpath(source_dir, "bazel-bin", "cuda", "bin", "ptxas"),
202-
)
190+
for path in (
191+
joinpath("bin", "ptxas"),
192+
joinpath("bin", "fatbinary"),
193+
joinpath("nvvm", "libdevice", "libdevice.10.bc"),
194+
)
195+
full_path = joinpath(source_dir, "bazel-bin", "cuda", path)
196+
if !Base.Filesystem.ispath(full_path)
197+
Base.Filesystem.mkpath(dirname(full_path))
198+
Base.Filesystem.symlink(
199+
joinpath(
200+
source_dir,
201+
"bazel-bin",
202+
"libReactantExtra.so.runfiles",
203+
"cuda_nvcc",
204+
path,
205+
),
206+
full_path,
207+
)
208+
end
203209
end
204210
end
205211

0 commit comments

Comments
 (0)