Spaces:
Paused
Paused
fix: usar wheel CUDA precompilado en base runtime (evita OOM al compilar)
Browse files- Dockerfile +11 -11
Dockerfile
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
-
# Imagen base CUDA 12.1 *
|
| 2 |
-
#
|
| 3 |
-
#
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 7 |
|
| 8 |
-
# Python + Stockfish + libs de OpenCV
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
-
python3 python3-pip
|
| 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
|
| 30 |
-
#
|
| 31 |
-
RUN
|
| 32 |
-
|
| 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
|