moving 6.4.4 toolbox to use official fedora 43 rocm packages that include backported fixes for kernel compatibility
This commit is contained in:
@@ -1,54 +1,28 @@
|
|||||||
# build stage
|
# build stage
|
||||||
FROM registry.fedoraproject.org/fedora:43 AS builder
|
FROM registry.fedoraproject.org/fedora:43 AS builder
|
||||||
|
|
||||||
# rocm 6.4.3 repo
|
# deps + rocm toolchain (native fedora packages)
|
||||||
RUN <<'EOF'
|
|
||||||
tee /etc/yum.repos.d/rocm.repo <<REPO
|
|
||||||
[ROCm-6.4.4]
|
|
||||||
name=ROCm6.4.4
|
|
||||||
baseurl=https://repo.radeon.com/rocm/el9/6.4.4/main
|
|
||||||
enabled=1
|
|
||||||
priority=50
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
|
|
||||||
REPO
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# deps
|
|
||||||
RUN dnf -y --nodocs --setopt=install_weak_deps=False \
|
RUN dnf -y --nodocs --setopt=install_weak_deps=False \
|
||||||
--exclude='*sdk*' --exclude='*samples*' --exclude='*-doc*' --exclude='*-docs*' \
|
|
||||||
install \
|
install \
|
||||||
make gcc cmake lld clang clang-devel compiler-rt libcurl-devel \
|
make gcc cmake lld clang clang-devel compiler-rt libcurl-devel \
|
||||||
rocm-llvm rocm-device-libs hip-runtime-amd hip-devel \
|
rocminfo radeontop 'rocm-*' 'rocblas-*' hipblas 'hipblas-*' \
|
||||||
rocblas rocblas-devel hipblas hipblas-devel \
|
git vim rsync sudo tar xz \
|
||||||
rocminfo radeontop \
|
|
||||||
git-core vim sudo rsync \
|
|
||||||
&& dnf clean all && rm -rf /var/cache/dnf/*
|
&& dnf clean all && rm -rf /var/cache/dnf/*
|
||||||
|
|
||||||
# rocm env
|
|
||||||
ENV ROCM_PATH=/opt/rocm \
|
|
||||||
HIP_PATH=/opt/rocm \
|
|
||||||
HIP_CLANG_PATH=/opt/rocm/llvm/bin \
|
|
||||||
HIP_DEVICE_LIB_PATH=/opt/rocm/amdgcn/bitcode \
|
|
||||||
PATH=/opt/rocm/bin:/opt/rocm/llvm/bin:$PATH
|
|
||||||
|
|
||||||
# llama.cpp
|
# llama.cpp
|
||||||
WORKDIR /opt/llama.cpp
|
WORKDIR /opt/llama.cpp
|
||||||
RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git .
|
RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git .
|
||||||
|
|
||||||
# build
|
# build + install
|
||||||
RUN git clean -xdf \
|
RUN git clean -xdf \
|
||||||
&& git submodule update --recursive \
|
&& git submodule update --recursive \
|
||||||
&& cmake -S . -B build \
|
&& HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
|
||||||
|
cmake -S . -B build \
|
||||||
-DGGML_HIP=ON \
|
-DGGML_HIP=ON \
|
||||||
-DAMDGPU_TARGETS=gfx1151 \
|
-DAMDGPU_TARGETS=gfx1151 \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DGGML_RPC=ON \
|
-DGGML_RPC=ON \
|
||||||
-DLLAMA_HIP_UMA=ON \
|
-DLLAMA_HIP_UMA=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 --build build --config Release -- -j$(nproc) \
|
||||||
&& cmake --install build --config Release
|
&& cmake --install build --config Release
|
||||||
|
|
||||||
@@ -56,38 +30,20 @@ RUN git clean -xdf \
|
|||||||
RUN find /opt/llama.cpp/build -type f -name 'lib*.so*' -exec cp {} /usr/lib64/ \; \
|
RUN find /opt/llama.cpp/build -type f -name 'lib*.so*' -exec cp {} /usr/lib64/ \; \
|
||||||
&& ldconfig
|
&& 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
|
# runtime stage
|
||||||
FROM registry.fedoraproject.org/fedora-minimal:43
|
FROM registry.fedoraproject.org/fedora-minimal:43
|
||||||
|
|
||||||
# rocm 6.4.3 repo
|
# runtime deps (native fedora rocm + utilities)
|
||||||
RUN <<'EOF'
|
|
||||||
tee /etc/yum.repos.d/rocm.repo <<REPO
|
|
||||||
[ROCm-6.4.4]
|
|
||||||
name=ROCm6.4.4
|
|
||||||
baseurl=https://repo.radeon.com/rocm/el9/6.4.4/main
|
|
||||||
enabled=1
|
|
||||||
priority=50
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
|
|
||||||
REPO
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# runtime deps
|
|
||||||
RUN microdnf -y --nodocs --setopt=install_weak_deps=0 \
|
RUN microdnf -y --nodocs --setopt=install_weak_deps=0 \
|
||||||
--exclude='*sdk*' --exclude='*samples*' --exclude='*-doc*' --exclude='*-docs*' \
|
|
||||||
install \
|
install \
|
||||||
bash ca-certificates libatomic libstdc++ libgcc libgomp sudo \
|
bash ca-certificates libatomic libstdc++ libgcc libgomp sudo \
|
||||||
hip-runtime-amd rocblas hipblas \
|
rocminfo radeontop 'rocm-*' 'rocblas-*' hipblas 'hipblas-*' \
|
||||||
rocminfo radeontop procps-ng \
|
procps-ng \
|
||||||
&& microdnf clean all && rm -rf /var/cache/dnf/*
|
&& microdnf clean all && rm -rf /var/cache/dnf/*
|
||||||
|
|
||||||
# copy
|
# copy
|
||||||
COPY --from=builder /usr/local/ /usr/local/
|
COPY --from=builder /usr/local/ /usr/local/
|
||||||
|
COPY --from=builder /usr/include/rocwmma /usr/include/rocwmma
|
||||||
COPY --from=builder /opt/llama.cpp/build/bin/rpc-* /usr/local/bin/
|
COPY --from=builder /opt/llama.cpp/build/bin/rpc-* /usr/local/bin/
|
||||||
|
|
||||||
# ld
|
# ld
|
||||||
@@ -101,10 +57,5 @@ RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf \
|
|||||||
COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py
|
COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py
|
||||||
RUN chmod +x /usr/local/bin/gguf-vram-estimator.py
|
RUN chmod +x /usr/local/bin/gguf-vram-estimator.py
|
||||||
|
|
||||||
# profile
|
|
||||||
RUN printf '%s\n' \
|
|
||||||
> /etc/profile.d/rocm.sh && chmod +x /etc/profile.d/rocm.sh \
|
|
||||||
&& echo 'source /etc/profile.d/rocm.sh' >> /etc/bashrc
|
|
||||||
|
|
||||||
# shell
|
# shell
|
||||||
CMD ["/bin/bash"]
|
CMD ["/bin/bash"]
|
||||||
|
|||||||
Reference in New Issue
Block a user