Skip to content

Commit

Permalink
Merge pull request #353 from containers/vulkan
Browse files Browse the repository at this point in the history
Add vulkan image and show size
  • Loading branch information
rhatdan authored Oct 23, 2024
2 parents f11144e + 4e2fcbe commit e754b91
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions container-images/vulkan/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM quay.io/ramalama/ramalama:latest

RUN /usr/bin/python3 --version

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 e754b91

Please sign in to comment.