# build stage FROM registry.fedoraproject.org/fedora:rawhide AS builder # rocm 6.4.4 repo RUN <<'EOF' tee /etc/yum.repos.d/rocm.repo < /opt/llama.cpp/ggml/src/ggml-cuda/mma.cuh.tmp \ && mv /opt/llama.cpp/ggml/src/ggml-cuda/mma.cuh.tmp /opt/llama.cpp/ggml/src/ggml-cuda/mma.cuh \ && cmake -S . -B build \ -DGGML_HIP=ON \ -DAMDGPU_TARGETS=gfx1151 \ -DCMAKE_BUILD_TYPE=Release \ -DLLAMA_HIP_UMA=ON \ -DGGML_HIP_ROCWMMA_FATTN=ON \ -DROCM_PATH=/opt/rocm \ -DHIP_PATH=/opt/rocm \ -DHIP_PLATFORM=amd \ -DCMAKE_HIP_FLAGS="--rocm-path=/opt/rocm" \ && cmake --build build --config Release -- -j$(nproc) \ && cmake --install build --config Release # libs RUN find /opt/llama.cpp/build -type f -name 'lib*.so*' -exec cp {} /usr/lib64/ \; \ && ldconfig # helper COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py RUN chmod +x /usr/local/bin/gguf-vram-estimator.py # runtime stage FROM registry.fedoraproject.org/fedora-minimal:rawhide # rocm 6.4.3 repo RUN <<'EOF' tee /etc/yum.repos.d/rocm.repo < /etc/ld.so.conf.d/local.conf \ && echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local.conf \ && ldconfig \ && cp -n /usr/local/lib/libllama*.so* /usr/lib64/ 2>/dev/null || true \ && ldconfig # helper COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py RUN chmod +x /usr/local/bin/gguf-vram-estimator.py # profile RUN printf '%s\n' \ 'export ROCBLAS_USE_HIPBLASLT=1' \ > /etc/profile.d/rocm.sh && chmod +x /etc/profile.d/rocm.sh \ && echo 'source /etc/profile.d/rocm.sh' >> /etc/bashrc # shell CMD ["/bin/bash"]