Spaces:
Running
Running
Commit
·
5719070
1
Parent(s):
5dcf9b3
Investigating torchcodec issues
Browse files- Dockerfile +17 -1
- requirements.txt +2 -0
Dockerfile
CHANGED
@@ -7,6 +7,7 @@ ARG DEBIAN_FRONTEND=noninteractive
|
|
7 |
ENV PYTHONUNBUFFERED=1
|
8 |
ENV PYTHONDONTWRITEBYTECODE=1
|
9 |
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
10 |
|
11 |
# Install system dependencies
|
12 |
RUN apt-get update && apt-get install -y \
|
@@ -15,6 +16,12 @@ RUN apt-get update && apt-get install -y \
|
|
15 |
python3-dev \
|
16 |
git \
|
17 |
ffmpeg \
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
libsm6 \
|
19 |
libxext6 \
|
20 |
libgl1-mesa-glx \
|
@@ -27,7 +34,16 @@ WORKDIR /app
|
|
27 |
|
28 |
# Install Python dependencies first for better caching
|
29 |
COPY requirements.txt .
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
# actually we found a way to put flash attention inside the requirements.txt
|
33 |
# so we are good, we don't need this anymore:
|
|
|
7 |
ENV PYTHONUNBUFFERED=1
|
8 |
ENV PYTHONDONTWRITEBYTECODE=1
|
9 |
ENV DEBIAN_FRONTEND=noninteractive
|
10 |
+
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
|
11 |
|
12 |
# Install system dependencies
|
13 |
RUN apt-get update && apt-get install -y \
|
|
|
16 |
python3-dev \
|
17 |
git \
|
18 |
ffmpeg \
|
19 |
+
libavcodec-dev \
|
20 |
+
libavformat-dev \
|
21 |
+
libavutil-dev \
|
22 |
+
libswscale-dev \
|
23 |
+
libavdevice-dev \
|
24 |
+
libavfilter-dev \
|
25 |
libsm6 \
|
26 |
libxext6 \
|
27 |
libgl1-mesa-glx \
|
|
|
34 |
|
35 |
# Install Python dependencies first for better caching
|
36 |
COPY requirements.txt .
|
37 |
+
# Install most requirements first
|
38 |
+
RUN grep -v torchcodec requirements.txt > requirements_without_torchcodec.txt && \
|
39 |
+
pip3 install --no-cache-dir -r requirements_without_torchcodec.txt
|
40 |
+
# Install torchcodec with CUDA support (for CUDA 12.x which matches our base image)
|
41 |
+
RUN pip3 install --no-cache-dir torchcodec --index-url=https://download.pytorch.org/whl/cu124
|
42 |
+
|
43 |
+
# Verify FFmpeg installation and libraries
|
44 |
+
RUN ffmpeg -version && \
|
45 |
+
ldconfig && \
|
46 |
+
python3 -c "import torchcodec; print('torchcodec imported successfully')" || echo "Warning: torchcodec import test failed, but continuing..."
|
47 |
|
48 |
# actually we found a way to put flash attention inside the requirements.txt
|
49 |
# so we are good, we don't need this anymore:
|
requirements.txt
CHANGED
@@ -6,6 +6,8 @@ torchdata==0.10.1
|
|
6 |
torchao==0.9.0
|
7 |
|
8 |
# for video decoding
|
|
|
|
|
9 |
torchcodec
|
10 |
|
11 |
# something broke in Transformers > 4.55.4
|
|
|
6 |
torchao==0.9.0
|
7 |
|
8 |
# for video decoding
|
9 |
+
# Note: We need to install torchcodec with CUDA support for A100
|
10 |
+
# This will be handled in the Dockerfile with the correct index-url
|
11 |
torchcodec
|
12 |
|
13 |
# something broke in Transformers > 4.55.4
|