Skip to content
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ result = evaluate(gga_x, rho=rho, sigma=sigma, derivatives=0)
## GPU support
Recently GPU support has been added. Whenever `evaluate` is called
with `CuArray`s, the computation will automatically be done with the CUDA
version of libxc.
version of libxc. Currently, CUDA 13 is not yet supported. You need
to enforce the use of an earlier CUDA version with, for example,
```julia
using CUDA
CUDA.set_runtime_version!(v"12.8")
```

## Status
Full support for evaluating LDA, GGA and meta-GGA functionals
Expand Down
10 changes: 10 additions & 0 deletions ext/LibxcCudaExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ import Libxc_GPU_jll
using Libxc: Libxc, xc_func_type, Functional
using CUDA

function __init__()
if CUDA.functional()
if !Libxc_GPU_jll.is_available() && CUDA.runtime_version() ≥ v"13"
@warn("Libxc_GPU_jll currently not available for CUDA 13. " *
"Please use CUDA 11 or 12 for GPU support " *
"""(e.g. `CUDA.set_runtime_version!(v"12.8")`)""")
end
end
end

if Libxc_GPU_jll.is_available()
const libxc_gpu = Libxc_GPU_jll.libxc
const CuArray = CUDA.CuArray
Expand Down
Loading