diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf3ba0b6c9..924a5f7f8f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,8 +22,8 @@ julia/1.8-n2: - module load lang/JuliaHPC/1.9.0-foss-2022a-CUDA-11.7.0 - julia --project=. -e ' using Pkg; Pkg.instantiate(); - using DFTK; - DFTK.disable_libxc_cuda!(); + using CUDA; + CUDA.set_runtime_version!(v"11.7") ' - julia --color=yes --project=. -e ' using Pkg; diff --git a/Project.toml b/Project.toml index 9780854adc..b96ab32182 100644 --- a/Project.toml +++ b/Project.toml @@ -110,4 +110,4 @@ WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192" wannier90_jll = "c5400fa0-8d08-52c2-913f-1e3f656c1ce9" [targets] -test = ["Test", "ASEconvert", "Aqua", "AtomsIO", "AtomsIOPython", "CUDA", "ComponentArrays", "DoubleFloats", "FiniteDiff", "FiniteDifferences", "GenericLinearAlgebra", "IntervalArithmetic", "JLD2", "Logging", "Plots", "QuadGK", "Random", "KrylovKit", "WriteVTK", "wannier90_jll"] +test = ["Test", "ASEconvert", "Aqua", "AtomsIO", "AtomsIOPython", "CUDA", "CUDA_Runtime_jll", "ComponentArrays", "DoubleFloats", "FiniteDiff", "FiniteDifferences", "GenericLinearAlgebra", "IntervalArithmetic", "JLD2", "Logging", "Plots", "QuadGK", "Random", "KrylovKit", "WriteVTK", "wannier90_jll"] diff --git a/src/workarounds/cuda_arrays.jl b/src/workarounds/cuda_arrays.jl index decd21388d..3d4321f266 100644 --- a/src/workarounds/cuda_arrays.jl +++ b/src/workarounds/cuda_arrays.jl @@ -1,11 +1,9 @@ synchronize_device(::GPU{<:CUDA.CuArray}) = CUDA.synchronize() -@static if @load_preference("use_libxc_cuda", "true") == "true" - for fun in (:potential_terms, :kernel_terms) - @eval function DftFunctionals.$fun(fun::DispatchFunctional, - ρ::CUDA.CuMatrix{Float64}, args...) - @assert Libxc.has_cuda() - $fun(fun.inner, ρ, args...) - end +for fun in (:potential_terms, :kernel_terms) + @eval function DftFunctionals.$fun(fun::DispatchFunctional, + ρ::CUDA.CuMatrix{Float64}, args...) + @assert Libxc.has_cuda() + $fun(fun.inner, ρ, args...) end end diff --git a/src/workarounds/gpu_arrays.jl b/src/workarounds/gpu_arrays.jl index 785edd6a1d..6f71320372 100644 --- a/src/workarounds/gpu_arrays.jl +++ b/src/workarounds/gpu_arrays.jl @@ -22,10 +22,3 @@ for fun in (:potential_terms, :kernel_terms) $fun(fun, Array(ρ), cpuify.(args)...) end end - -# Note: This preference is temporary for now and can disappear at any time. -# This is needed because for some reason I cannot arrive at the tests -# to use CUDA version 11.8 instead of 12 (where Libxc is not supported) -function disable_libxc_cuda!() - @set_preferences!("use_libxc_cuda" => "false") -end diff --git a/test/runtests.jl b/test/runtests.jl index b3c9f8a6e7..0fab1bb689 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,3 +1,15 @@ +# Work around JuliaLang/Pkg.jl#2500 +# Must be before loading anything +if VERSION < v"1.8-" + test_project = first(Base.load_path()) + preferences_file = "../LocalPreferences.toml" + test_preferences_file = joinpath(dirname(test_project), "LocalPreferences.toml") + if isfile(preferences_file) && !isfile(test_preferences_file) + cp(preferences_file, test_preferences_file) + @info "copied LocalPreferences.toml to $test_preferences_file" + end +end + using Test using DFTK using Random