SamilG2 commited on
Commit
df78766
·
1 Parent(s): 99f25c1

fix: usar wheel CUDA precompilado en base runtime (evita OOM al compilar)

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -11
Dockerfile CHANGED
@@ -1,16 +1,16 @@
1
- # Imagen base CUDA 12.1 *devel*: trae nvcc para compilar llama-cpp-python CON
2
- # soporte GPU. Imprescindible para que el coach Qwen use la Tesla T4 (de lo
3
- # contrario llama-cpp cae a CPU silenciosamente, ~165s por comentario).
4
- FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
 
5
 
6
  ENV DEBIAN_FRONTEND=noninteractive
7
 
8
- # Python + Stockfish + libs de OpenCV + toolchain de compilación
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
- python3 python3-pip python3-dev \
11
  stockfish \
12
  libgl1 libglib2.0-0 \
13
- build-essential cmake git \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  WORKDIR /app
@@ -26,10 +26,10 @@ RUN pip3 install --no-cache-dir --upgrade pip \
26
  RUN pip3 install --no-cache-dir torch torchvision \
27
  --index-url https://download.pytorch.org/whl/cu121
28
 
29
- # llama-cpp-python COMPILADO desde fuente con CUDA (arch 75 = Tesla T4).
30
- # Garantiza offload real a GPU sin depender de wheels precompilados.
31
- RUN CMAKE_ARGS="-DGGML_CUDA=on -DCMAKE_CUDA_ARCHITECTURES=75" FORCE_CMAKE=1 \
32
- pip3 install --no-cache-dir llama-cpp-python==0.3.2
33
 
34
  # Resto de dependencias de la app
35
  RUN pip3 install --no-cache-dir -r requirements.txt
 
1
+ # Imagen base CUDA 12.1 *runtime*: trae las librerías de CUDA (libcudart, cublas…)
2
+ # necesarias para que el wheel precompilado de llama-cpp-python use la Tesla T4.
3
+ # NO compilamos llama-cpp (eso causaba OOM en el builder de HF); usamos el wheel
4
+ # CUDA ya hecho del índice de abetlen, que con estas libs sí offloadea a GPU.
5
+ FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
6
 
7
  ENV DEBIAN_FRONTEND=noninteractive
8
 
9
+ # Python + Stockfish + libs de OpenCV
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ python3 python3-pip \
12
  stockfish \
13
  libgl1 libglib2.0-0 \
 
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  WORKDIR /app
 
26
  RUN pip3 install --no-cache-dir torch torchvision \
27
  --index-url https://download.pytorch.org/whl/cu121
28
 
29
+ # llama-cpp-python: wheel PRECOMPILADO con CUDA 12.1 (sin compilar → sin OOM).
30
+ # Con las libs del runtime base presentes, el offload a GPU funciona.
31
+ RUN pip3 install --no-cache-dir llama-cpp-python==0.3.2 \
32
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
33
 
34
  # Resto de dependencias de la app
35
  RUN pip3 install --no-cache-dir -r requirements.txt