-
Notifications
You must be signed in to change notification settings - Fork 761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker + CUDA documentation #1232
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
ARG CUDA_VERSION=12.1.0 | ||
# By copying the installation from a devel to a runtime container one could likely save a lot container size | ||
FROM nvidia/cuda:$CUDA_VERSION-devel-ubuntu22.04 | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libopenjp2-7-dev \ | ||
ninja-build cmake git python3 python3-pip nasm xxd pkg-config curl unzip | ||
|
||
RUN git clone https://github.com/Netflix/vmaf.git | ||
|
||
RUN git clone https://github.com/FFmpeg/FFmpeg.git | ||
|
||
RUN git clone https://github.com/FFmpeg/nv-codec-headers.git && cd nv-codec-headers && make && make install | ||
|
||
# install vmaf | ||
RUN python3 -m pip install meson cpython | ||
RUN cd vmaf && meson libvmaf/build libvmaf -Denable_cuda=true -Denable_avx512=true --buildtype release && \ | ||
ninja -vC libvmaf/build && \ | ||
ninja -vC libvmaf/build install | ||
|
||
# install ffmpeg | ||
RUN cd FFmpeg && ./configure \ | ||
--enable-libnpp \ | ||
--enable-nonfree \ | ||
--enable-nvdec \ | ||
--enable-nvenc \ | ||
--enable-cuvid \ | ||
--enable-cuda \ | ||
--enable-cuda-nvcc \ | ||
--enable-libvmaf \ | ||
--enable-ffnvcodec \ | ||
--disable-stripping \ | ||
--extra-cflags="-I/usr/local/cuda/include" \ | ||
--extra-ldflags="-L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64/stubs/" | ||
|
||
RUN cd FFmpeg && make -j && make install | ||
|
||
RUN mkdir /data | ||
# VMAF+decode GPU (only works for NVDec supported formats https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new) | ||
ENTRYPOINT ["ffmpeg" ,"-hwaccel", "cuda", "-hwaccel_output_format" ,"cuda", \ | ||
"-i" ,"/data/ref.mp4", \ | ||
"-hwaccel", "cuda", "-hwaccel_output_format", "cuda", \ | ||
"-i", "/data/dis.mp4" ,\ | ||
"-filter_complex", "[0:v][1:v]libvmaf_cuda" ,"-f" ,"null", "-"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,11 @@ Run: | |
meson build --buildtype release | ||
``` | ||
|
||
(add `-Denable_float=true` flag in the rare case if you want to use the floating-point feature extractors.) | ||
Special cases: | ||
- add `-Denable_float=true` flag in the rare case if you want to use the floating-point feature extractors. | ||
- add `-Denable_avx512=true` to support wider SIMD instructions to achieve the fastest processing on supported CPUs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this is now enabled by default so this wording may be misleading. We can fix this later though. |
||
- add `-Denable_cuda=true` to build with CUDA support, which requires `nvcc` for compilation (tested with CUDA >= 11) | ||
- add `-Denable_nvtx=true` to build with [NVTX](https://github.com/NVIDIA/NVTX) marker support, which enables easy profiling using Nsight Systems | ||
|
||
Build with: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linking against stubs as during build the driver is not available.