Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 18575c3

Browse files
authored
Merge pull request #355 from janhq/298-feat-gpu-docker-image
feat: add example GPU version of nitro on docker image
2 parents 3eb7342 + 6cb0d11 commit 18575c3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Use Debian stable slim as the base image
2+
FROM nvidia/cuda:12.3.1-devel-ubuntu22.04
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Install required packages
8+
RUN apt-get update && \
9+
apt-get install -y git cmake numactl uuid-dev && \
10+
git clone --recurse https://github.com/janhq/nitro nitro && \
11+
cd nitro && \
12+
./install_deps.sh && \
13+
mkdir build && \
14+
cd build && \
15+
cmake .. -DDEBUG=ON -DLLAMA_CUBLAS=ON -DLLAMA_CUDA_F16=ON -DLLAMA_CUDA_DMMV_X=64 -DLLAMA_CUDA_MMV_Y=32 && \
16+
cmake --build . --config Release -j $(nproc) && \
17+
apt-get remove --purge -y git cmake && \
18+
apt-get autoremove -y && \
19+
apt-get clean && \
20+
rm -rf /var/lib/apt/lists/*
21+
22+
# Expose the port
23+
EXPOSE 3928
24+
25+
# Change the permissions of the nitro binary to make it executable
26+
RUN chmod +x /app/nitro/build/nitro
27+
28+
# Set the command to run the nitro binary with numactl limiting to cores 0-7
29+
ENTRYPOINT ["/app/nitro/build/nitro"]
30+
CMD ["1", "0.0.0.0", "3928"]

0 commit comments

Comments
 (0)