Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Windows #518

Merged
merged 2 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/nvml/NVML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ using CEnum

using Libdl

libnvml() = Sys.iswindows() ? "nvml" : "libnvidia-ml.so.1"
function libnvml()
if Sys.iswindows()
# the NVSMI dir isn't added to PATH by the installer
nvsmi = joinpath(ENV["ProgramFiles"], "NVIDIA Corporation", "NVSMI")
if isdir(nvsmi)
joinpath(nvsmi, "nvml.dll")
else
# let's just hope for the best
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah typical windows

"nvml"
end
else
"libnvidia-ml.so.1"
end
end
has_nvml() = Libdl.dlopen(libnvml(); throw_error=false) !== nothing

# core library
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ for (rootpath, dirs, files) in walkdir(@__DIR__)
end
## GPUArrays testsuite
for name in keys(TestSuite.tests)
push!(tests, "gpuarrays/$name")
test_runners["gpuarrays/$name"] = ()->TestSuite.tests[name](CuArray)
push!(tests, "gpuarrays$(Base.Filesystem.path_separator)$name")
test_runners["gpuarrays$(Base.Filesystem.path_separator)$name"] = ()->TestSuite.tests[name](CuArray)
end
unique!(tests)

Expand Down