-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.cuda
More file actions
54 lines (43 loc) · 1.41 KB
/
Dockerfile.cuda
File metadata and controls
54 lines (43 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# NVIDIA CUDA base image with Python 3.11
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=${CUDA_HOME}/bin:${PATH}
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.11 \
python3.11-dev \
python3.11-venv \
python3-pip \
build-essential \
cmake \
git \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set Python 3.11 as default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
# Upgrade pip
RUN python3 -m pip install --upgrade pip setuptools wheel
# Create working directory
WORKDIR /app
# Copy project files
COPY pyproject.toml ./
COPY pocket_agent_cli/ ./pocket_agent_cli/
COPY README.md ./
# Install llama-cpp-python with CUDA support
# CMAKE_ARGS ensures CUDA compilation
ENV CMAKE_ARGS="-DLLAMA_CUDA=on"
ENV FORCE_CMAKE=1
# Install the package with CUDA-enabled llama-cpp-python
RUN pip install --no-cache-dir llama-cpp-python --force-reinstall
# Install the rest of the dependencies
RUN pip install --no-cache-dir -e .
# Verify CUDA installation
RUN python3 -c "import llama_cpp; print('llama-cpp-python installed successfully')"
# Set up entrypoint
ENTRYPOINT ["pocket-agent"]
CMD ["--help"]