This repository has been archived by the owner on Mar 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #588 from JuliaGPU/tb/windows_versions
Use correct versions for library discovery.
- Loading branch information
Showing
4 changed files
with
109 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# discovering binary CUDA dependencies | ||
|
||
function __init_bindeps__(; silent=false, verbose=false) | ||
# discover libraries | ||
for (name,version) in (("cublas", CUDAnative.version()), | ||
("cusparse", CUDAnative.version()), | ||
("cusolver", CUDAnative.version()), | ||
("cufft", CUDAnative.version()), | ||
("curand", CUDAnative.version()), | ||
("cudnn", v"7"), | ||
("cutensor", v"1")) | ||
mod = getfield(CuArrays, Symbol(uppercase(name))) | ||
handle = getfield(mod, Symbol("lib$name")) | ||
|
||
# on Windows, the library name is version dependent | ||
if Sys.iswindows() | ||
cuda = CUDAnative.version() | ||
suffix = cuda >= v"10.1" ? "$(cuda.major)" : "$(cuda.major)$(cuda.minor)" | ||
handle[] = "$(name)$(Sys.WORD_SIZE)_$(suffix)" | ||
end | ||
|
||
if CUDAnative.uses_artifacts[] | ||
artifact = first(CUDAnative.prefix()) | ||
handle[] = CUDAnative.get_library(Sys.iswindows() ? handle[] : name, artifact) | ||
else | ||
path = find_cuda_library(name, CUDAnative.prefix(), [version]) | ||
if path !== nothing | ||
handle[] = path | ||
end | ||
end | ||
end | ||
|
||
# library dependencies | ||
CUBLAS.version() | ||
CUSPARSE.version() | ||
CUSOLVER.version() | ||
CUFFT.version() | ||
CURAND.version() | ||
# CUDNN and CUTENSOR are optional | ||
|
||
# library compatibility | ||
if has_cutensor() | ||
cutensor = CUTENSOR.version() | ||
if cutensor < v"1" | ||
silent || @warn("CuArrays.jl only supports CUTENSOR 1.0 or higher") | ||
end | ||
|
||
cuda = CUDAnative.version() | ||
cutensor_cuda = CUTENSOR.cuda_version() | ||
if cutensor_cuda.major != cuda.major || cutensor_cuda.minor != cuda.minor | ||
silent || @warn("You are using CUTENSOR $cutensor for CUDA $cutensor_cuda with CUDA toolkit $cuda; these might be incompatible.") | ||
end | ||
end | ||
if has_cudnn() | ||
cudnn = CUDNN.version() | ||
if cudnn < v"7.6" | ||
silent || @warn("CuArrays.jl only supports CUDNN v7.6 or higher") | ||
end | ||
|
||
cuda = CUDAnative.version() | ||
cudnn_cuda = CUDNN.cuda_version() | ||
if cudnn_cuda.major != cuda.major || cudnn_cuda.minor != cuda.minor | ||
silent || @warn("You are using CUDNN $cudnn for CUDA $cudnn_cuda with CUDA toolkit $cuda; these might be incompatible.") | ||
end | ||
end | ||
end |