refactor: streamline CUDA development tools installation and simplify FFmpeg configuration for NVIDIA support
All checks were successful
Build Worker Base and Application Images / check-base-changes (push) Successful in 8s
Build Worker Base and Application Images / build-base (push) Successful in 10m9s
Build Worker Base and Application Images / build-docker (push) Successful in 4m4s
Build Worker Base and Application Images / deploy-stack (push) Successful in 43s

This commit is contained in:
Siwat Sirichai 2025-09-26 01:11:32 +07:00
parent fa3ab5c6d2
commit bdbf688946

View file

@ -18,6 +18,11 @@ RUN apt-get update && apt-get install -y \
libc6-dev \ libc6-dev \
libnuma1 \ libnuma1 \
libnuma-dev \ libnuma-dev \
# Essential compilation libraries
gcc \
g++ \
libc6-dev \
linux-libc-dev \
# System libraries # System libraries
libgl1-mesa-glx \ libgl1-mesa-glx \
libglib2.0-0 \ libglib2.0-0 \
@ -37,13 +42,18 @@ RUN apt-get update && apt-get install -y \
python3-numpy \ python3-numpy \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install minimal CUDA development tools (just what we need for FFmpeg) # Add NVIDIA CUDA repository and install minimal development tools
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y wget gnupg && \
wget -O - https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | apt-key add - && \
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \
apt-get update && \
apt-get install -y \
cuda-nvcc-12-6 \ cuda-nvcc-12-6 \
cuda-cudart-dev-12-6 \ cuda-cudart-dev-12-6 \
libnvidia-encode-12-6 \ libnpp-dev-12-6 \
libnvidia-decode-12-6 \ && apt-get remove -y wget gnupg && \
&& rm -rf /var/lib/apt/lists/* apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
# Ensure CUDA paths are available # Ensure CUDA paths are available
ENV PATH="/usr/local/cuda/bin:${PATH}" ENV PATH="/usr/local/cuda/bin:${PATH}"
@ -62,7 +72,7 @@ RUN cd /tmp && \
# Download FFmpeg source (official method) # Download FFmpeg source (official method)
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg/ && \ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg/ && \
cd ffmpeg && \ cd ffmpeg && \
# Configure with NVIDIA support (following official NVIDIA documentation) # Configure with NVIDIA support (simplified to avoid configure issues)
./configure \ ./configure \
--prefix=/usr/local \ --prefix=/usr/local \
--enable-shared \ --enable-shared \
@ -70,18 +80,12 @@ RUN cd /tmp && \
--enable-nonfree \ --enable-nonfree \
--enable-gpl \ --enable-gpl \
--enable-cuda-nvcc \ --enable-cuda-nvcc \
--enable-cuda-llvm \
--enable-cuvid \ --enable-cuvid \
--enable-nvdec \ --enable-nvdec \
--enable-nvenc \ --enable-nvenc \
--enable-libnpp \ --enable-libnpp \
--nvcc=/usr/local/cuda/bin/nvcc \
--extra-cflags=-I/usr/local/cuda/include \ --extra-cflags=-I/usr/local/cuda/include \
--extra-ldflags=-L/usr/local/cuda/lib64 \ --extra-ldflags=-L/usr/local/cuda/lib64 \
--extra-libs=-lcuda \
--extra-libs=-lcudart \
--extra-libs=-lnvcuvid \
--extra-libs=-lnvidia-encode \
--enable-libx264 \ --enable-libx264 \
--enable-libx265 \ --enable-libx265 \
--enable-libvpx \ --enable-libvpx \