Skip to content

Fix CUDA detection and modern FFmpeg compatibility#371

Open
DrStone1971 wants to merge 3 commits into
dmlc:masterfrom
DrStone1971:fix-cuda-modern-cmake
Open

Fix CUDA detection and modern FFmpeg compatibility#371
DrStone1971 wants to merge 3 commits into
dmlc:masterfrom
DrStone1971:fix-cuda-modern-cmake

Conversation

@DrStone1971
Copy link
Copy Markdown

This PR updates Decord to build on newer Linux/CUDA/FFmpeg environments.

Changes:

  • Replace legacy CUDA detection with CMake CUDAToolkit
  • Fix CUDA detection with CUDA 12/13
  • Add modern FFmpeg bitstream filter header usage
  • Fix FFmpeg const-correctness issues with AVCodec and AVInputFormat
  • Replace deprecated FFmpeg rotation side-data access for newer libavformat
  • Fix C++ warnings such as catching dmlc::Error by value
  • Add bounds check for CUDA codec string lookup

Tested on:

  • Ubuntu Linux
  • GCC 13
  • CUDA 13.2
  • CMake + Ninja
  • FFmpeg / LibAV: libavcodec 60, libavformat 60, libavutil 58
  • Python 3.12
  • USE_CUDA=ON
  • CMAKE_CUDA_ARCHITECTURES=120

Also verified local wheel build and import successfully.

@DrStone1971
Copy link
Copy Markdown
Author

Tested on modern environment:

  • Ubuntu 24.04
  • GCC 13
  • CUDA 13.2 (Blackwell sm_120)
  • CMake + Ninja
  • FFmpeg (libavcodec 60 / libavformat 60)
  • Python 3.12

Build completed successfully with USE_CUDA=ON.
Wheel package builds and imports correctly.

This removes the need for -fpermissive and fixes compatibility with newer FFmpeg APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant