diff --git a/lib/nvml/NVML.jl b/lib/nvml/NVML.jl index ff3529d243..039465b369 100644 --- a/lib/nvml/NVML.jl +++ b/lib/nvml/NVML.jl @@ -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 + "nvml" + end + else + "libnvidia-ml.so.1" + end +end has_nvml() = Libdl.dlopen(libnvml(); throw_error=false) !== nothing # core library diff --git a/test/runtests.jl b/test/runtests.jl index e27b08a497..c8fa9b3440 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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)