gpo.zugaina.org

Search Portage & Overlays:

dev-util/zluda

Drop-in replacement for CUDA on AMD GPUs

Screenshots

  • zluda-9999

    View      Download      Browse     License: || ( Apache-2.0 MIT ) Apache-2.0-with-LLVM-exceptions   
    Overlay: stuff

ChangeLog

commit b0475e213025473bef165a1ab6bd40bb977abc17
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Thu May 7 19:06:33 2026 +0200

dev-util/zluda: build cuFFT/cuBLAS/cuBLASLt/cuSPARSE replacements

xtask --release builds the workspace's default-members but skips the
math-library crates. Add an explicit pass for zluda_fft, zluda_blas,
zluda_blaslt and zluda_sparse, and install their cdylibs into
/opt/zluda/ with the linux_symlinks declared in each crate's
[package.metadata.zluda]:

zluda_fft → libcufft.so (+ .so.)
zluda_blas → libcublas.so (+ .so.)
zluda_blaslt → libcublaslt.so (+ libcublasLt.so
symlinks; upstream uses
case-mixed filenames)
zluda_sparse → libcusparse.so (+ .so.)

A CUDA app run with LD_LIBRARY_PATH=/opt/zluda now finds ZLUDA's
cuFFT/cuBLAS/cuBLASLt/cuSPARSE replacements ahead of NVIDIA's stubs in
/opt/cuda/lib64. zluda_blas/blaslt/sparse have partial real
implementations through rocBLAS / hipBLASLt / rocSPARSE; zluda_fft is
all-stub upstream today (every entry point returns NOT_SUPPORTED) but
ships the symbol surface so the dispatch path is wired. There is no
zluda_curand crate, so cuRAND-using apps still fall through to NVIDIA.

RDEPEND gains sci-libs/hipBLASLt and sci-libs/rocSPARSE for the new
sys-crates' link targets.

Verified end-to-end with sci-physics/mumax-3.12: ZLUDA's libcuda now
drives a real ROCm context on the gfx1150 iGPU; mumax3 walks through
cuInit / cuCtxCreate_v2 / device enumeration / PTX→AMDGPU JIT / memory
allocation; cuFFT calls reach zluda_fft and return CUFFT-stub-error 16
(NOT_SUPPORTED) rather than NVIDIA's CUFFT_INTERNAL_ERROR — confirming
the dispatch is now in ZLUDA, blocked only by upstream's missing FFT
implementation.

commit 4e7a3c52aeea7c3d4dfa440b4fe99be1ebb7f81b
Author: Ivan S. Titov <iohann.s.titov@gmail.com>
Date: Thu May 7 17:39:58 2026 +0200

dev-util/zluda: new package, live ebuild

ZLUDA is a CUDA-runtime replacement for AMD GPUs — translates CUDA
driver API calls and PTX kernels to AMD ROCm/HIP at runtime.
Default-members on Linux build libnvcuda.so (zluda crate),
libnvml.so (zluda_ml crate) and libzluda_ld.so (zluda_ld crate);
zluda_inject and zluda_redirect are windows_only, compiler is
debug_only, so xtask --release skips them.

Live ebuild because:
- Upstream's quick_start.md tells users to grab pre-release builds.
- ext/llvm-project is a git submodule pinned to release/17.x; the
workspace's other crate dependencies are pulled by cargo over the
network. Both fit the existing live-ebuild + RESTRICT=network-sandbox
convention used by sci-ml/{kokoros,lemonade,fastflowlm}.
- EGIT_LFS=yes is required: llvm_zluda/src/device-libs/{ockl,ocml}.bc
are git-lfs blobs and the build.rs panics on lfs stubs.

Install layout follows the upstream prebuilt zip — flat /opt/zluda/
mirroring target/release/, with the [package.metadata.zluda].linux_symlinks
recreated:
/opt/zluda/libnvcuda.so + libcuda.so symlinks
/opt/zluda/libnvml.so + libnvidia-ml.so symlinks
/opt/zluda/libzluda_ld.so + zluda_ld symlink (LD_AUDIT entry point)

Users opt in via LD_LIBRARY_PATH=/opt/zluda or LD_AUDIT=/opt/zluda/zluda_ld
so it doesn't shadow nvidia-drivers' libcuda for users with both.

No KEYWORDS — upstream warns the project is under heavy development.