Build decord from source with CUDA for GPU video decode
- Build decord with -DUSE_CUDA=ON for true NVDEC hardware decode - Use DLPack for zero-copy transfer from decord to CuPy - Frames stay on GPU throughout: decode -> process -> encode Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,9 +26,18 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
# Install GPU-specific dependencies (CuPy for CUDA 12.x)
|
||||
RUN pip install --no-cache-dir cupy-cuda12x
|
||||
|
||||
# Install PyNvCodec for true GPU-native video decoding (NVDEC)
|
||||
# Frames decode directly to GPU memory - zero CPU transfer
|
||||
RUN pip install --no-cache-dir PyNvCodec
|
||||
# Build decord from source with CUDA support for GPU-native video decoding
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
cmake build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN git clone --recursive https://github.com/dmlc/decord /tmp/decord && \
|
||||
cd /tmp/decord && \
|
||||
mkdir build && cd build && \
|
||||
cmake .. -DUSE_CUDA=ON -DCMAKE_BUILD_TYPE=Release && \
|
||||
make -j$(nproc) && \
|
||||
cd ../python && pip install . && \
|
||||
rm -rf /tmp/decord
|
||||
|
||||
# Copy application
|
||||
COPY . .
|
||||
|
||||
Reference in New Issue
Block a user