Skip to content

Commit

Permalink
Add vulkan image and show size
Browse files Browse the repository at this point in the history
Add this image, we also want to see the size of this image in the
build.

Signed-off-by: Eric Curtin <[email protected]>
  • Loading branch information
ericcurtin committed Oct 22, 2024
1 parent 89f0d25 commit ec51b80
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
33 changes: 33 additions & 0 deletions container-images/vulkan/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM quay.io/ramalama/ramalama:latest

RUN /usr/bin/python3 --version

ARG ROCM_VERSION=6.2.2
ARG AMDGPU_VERSION=6.2.2

COPY amdgpu.repo /etc/yum.repos.d/
COPY rocm.repo /etc/yum.repos.d/

RUN dnf config-manager --add-repo https://mirror.stream.centos.org/9-stream/AppStream/$(uname -m)/os/
RUN curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-Official
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official

RUN git clone https://github.com/ggerganov/llama.cpp && \
cd llama.cpp && \
git reset --hard ${LLAMA_CPP_SHA} && \
cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=/usr -DGGML_CCACHE=0 \
-DGGML_VULKAN=1 && \
cmake --build build --config Release -j $(nproc) && \
cmake --install build && \
cd / && \
git clone https://github.com/ggerganov/whisper.cpp.git && \
cd whisper.cpp && \
git reset --hard ${WHISPER_CPP_SHA} && \
cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=/usr -DGGML_CCACHE=0 \
-DGGML_VULKAN=1 && \
cmake --build build --config Release -j $(nproc) && \
mv build/bin/main /usr/bin/whisper-main && \
mv build/bin/server /usr/bin/whisper-server && \
cd / && \
rm -rf llama.cpp whisper.cpp

4 changes: 4 additions & 0 deletions container_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ build() {
local image_name
image_name=$(echo "$1" | sed "s#container-images/##g")
local conman_build=("${conman[@]}")
local conman_show_size=("${conman[@]}" "images" "--filter" "reference='quay.io/ramalama/$image_name'")
if [ "$#" -lt 2 ]; then
add_build_platform
"${conman_build[@]}"
"${conman_show_size[@]}"
rm_container_image
elif [ "$2" = "-d" ]; then
add_build_platform
Expand All @@ -45,9 +47,11 @@ build() {
"${conman[@]}" push "quay.io/ramalama/$image_name"
elif [ "$2" = "log" ]; then
"${conman_build[@]}" 2>&1 | tee container_build.log
"${conman_show_size[@]}"
else
add_build_platform
"${conman_build[@]}"
"${conman_show_size[@]}"
rm_container_image
fi

Expand Down

0 comments on commit ec51b80

Please sign in to comment.