
Simply add the AMDGPU.jl package to your Julia environment:
using Pkg
Pkg.add("AMDGPU")Julia 1.10+
MI300X requires Julia 1.12+
64-bit Linux or Windows
ROCm 6.0+
| Linux | Windows |
|---|---|
| ROCm | ROCm |
| - | AMD Software: Adrenalin Edition |
On Windows AMD Software
Adrenalin Edition contains HIP library itself, while ROCm provides support for other functionality.
On Fedora ROCm packages
Although not included in the AMD's list of supported Linux distributions, Fedora provides its own ROCM packages.
sudo dnf install rocminfo rocblas rocfft rocsparse rocsolver rocrand roctracer miopen rocm-hip-develTo ensure that everything works, you can run the test suite:
using AMDGPU
using Pkg
Pkg.test("AMDGPU")Element-wise addition via high-level interface & low-level kernel:
using AMDGPU
function vadd!(c, a, b)
i = workitemIdx().x + (workgroupIdx().x - 1) * workgroupDim().x
if i ≤ length(a)
c[i] = a[i] + b[i]
end
return
end
a = AMDGPU.ones(Int, 1024)
b = AMDGPU.ones(Int, 1024)
c = AMDGPU.zeros(Int, 1024)
groupsize = 256
gridsize = cld(length(c), groupsize)
@roc groupsize=groupsize gridsize=gridsize vadd!(c, a, b)
@assert (a .+ b) ≈ c| Area | What you get | Learn more |
|---|---|---|
| Arrays | Dense ROCArray, broadcasting, reductions, sorting | Array Programming |
| Kernels | Native @roc kernels and portable KernelAbstractions | Kernel Programming |
| Multi-GPU | Task-local devices and streams | Tasks and Streams |
| Linear algebra | *, \, cholesky, lu, qr via rocBLAS/rocSOLVER | Linear Algebra |
| Sparse | CSR/CSC/COO arrays, SpMV/SpMM via rocSPARSE | Sparse Arrays |
| FFT | fft/plan_fft via rocFFT | Fourier Transforms |
| Random | rand/randn via rocRAND | Random Numbers |
| Deep learning | Conv/pooling/softmax via MIOpen (NNlib/Flux) | Deep Learning (MIOpen) |
Usage questions can be posted on the Julia Discourse forum under the GPU domain and/or in the #gpu channel of the Julia Slack.
Contributions are very welcome, as are feature requests and suggestions. Please open an issue if you encounter any problems.
AMDGPU.jl would not have been possible without the work by Tim Besard and contributors to CUDA.jl and LLVM.jl.
AMDGPU.jl is licensed under the MIT License.