diff --git a/.github/issue_template.md b/.github/issue_template.md
deleted file mode 100644
index 79146689..00000000
--- a/.github/issue_template.md
+++ /dev/null
@@ -1,42 +0,0 @@
-### Expected behaviour
-
-Write here how did you expect the library to function.
-
-### Actual behaviour
-
-Write here what went wrong.
-
-### Steps to reproduce
-
-- example code
-- operating system
-- architecture (e.g. x86)
-- opencv-python version
-
-##### Issue submission checklist
-
- - [ ] This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
-
- - [ ] I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
-
- - [ ] The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
- - [ ] I'm using the latest version of ``opencv-python``
diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml
deleted file mode 100644
index cc7b0636..00000000
--- a/.github/workflows/build_wheels_linux.yml
+++ /dev/null
@@ -1,253 +0,0 @@
-name: Linux x86_64
-
-on:
- pull_request:
- branches:
- - 4.x
- - 5.x
- paths-ignore:
- - '.github/workflows/build_wheels_linux_arm.yml'
- - '.github/workflows/build_wheels_windows*'
- - '.github/workflows/build_wheels_macos*'
- release:
- types: [published, edited]
- schedule:
- - cron: '0 3 * * 6'
- workflow_dispatch:
-
-
-jobs:
- Build:
- runs-on: ubuntu-22.04
- defaults:
- run:
- shell: bash
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.9']
- platform: [x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
- env:
- ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- REPO_DIR: .
- PROJECT_SPEC: opencv-python
- MB_PYTHON_VERSION: ${{ matrix.python-version }}
- TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
- MB_ML_VER: 2014
- TRAVIS_BUILD_DIR: ${{ github.workspace }}
- CONFIG_PATH: travis_config.sh
- DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20250630
- USE_CCACHE: 0
- UNICODE_WIDTH: 32
- PLAT: x86_64
- SDIST: ${{ matrix.build_sdist || 0 }}
- ENABLE_HEADLESS: ${{ matrix.without_gui }}
- ENABLE_CONTRIB: ${{ matrix.with_contrib }}
- steps:
- - name: Cleanup
- run: find . -mindepth 1 -delete
- working-directory: ${{ github.workspace }}
- - name: Setup environment
- run: |
- if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
- echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
- fi
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: false
- fetch-depth: 0
- - name: Build a package
- run: source scripts/build.sh
- - name: Saving a wheel accordingly to matrix
- uses: actions/upload-artifact@v4
- with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
- path: wheelhouse/opencv*.whl
-
- Test:
- needs: [Build]
- runs-on: ubuntu-22.04
- defaults:
- run:
- shell: bash
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
- platform: [x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
- env:
- ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- MB_PYTHON_VERSION: ${{ matrix.python-version }}
- NP_TEST_DEP: numpy==1.19.4
- NP_TEST_DEP_LATEST: numpy==2.2.6
- CONFIG_PATH: travis_config.sh
- PLAT: x86_64
- steps:
- - name: Cleanup
- run: find . -mindepth 1 -delete
- working-directory: ${{ github.workspace }}
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: true
- fetch-depth: 0
- - name: Setup Environment variables
- run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
- - name: Download a wheel accordingly to matrix
- uses: actions/download-artifact@v4
- with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
- path: wheelhouse/
- - name: Package installation and run tests
- run: source scripts/install.sh
-
- Build_sdist:
- runs-on: ubuntu-22.04
- defaults:
- run:
- shell: bash
- strategy:
- fail-fast: false
- matrix:
- python-version: [3.8]
- platform: [x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [1]
- env:
- ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- REPO_DIR: .
- PROJECT_SPEC: opencv-python
- PLAT: x86_64
- MB_PYTHON_VERSION: ${{ matrix.python-version }}
- TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
- MB_ML_VER: 2014
- NP_TEST_DEP: numpy==1.19.4
- TRAVIS_BUILD_DIR: ${{ github.workspace }}
- CONFIG_PATH: travis_config.sh
- DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20250630
- USE_CCACHE: 1
- UNICODE_WIDTH: 32
- SDIST: ${{ matrix.build_sdist || 0 }}
- ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }}
- ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }}
- steps:
- - name: Cleanup
- run: find . -mindepth 1 -delete
- working-directory: ${{ github.workspace }}
- - name: Setup environment
- run: |
- if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
- echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
- fi
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: false
- fetch-depth: 0
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
- with:
- python-version: ${{ matrix.python-version }}
- architecture: ${{ matrix.platform }}
- - name: Build a package
- run: |
- set -e
- # Build and package
- set -x
- python -m pip install --upgrade pip
- python -m pip install scikit-build
- python setup.py sdist --formats=gztar
- set +x
- # Install and run tests
- set -x
- echo "skipping tests because of sdist"
- - name: saving artifacts
- uses: actions/upload-artifact@v4
- with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
- path: dist/opencv*.tar.gz
-
- Release_rolling:
- if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-rolling-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- path: wheelhouse/
-
- - name: Upload wheels for opencv_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python_rolling-*
- - name: Upload wheels for opencv_contrib_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python_rolling-*
- - name: Upload wheels for opencv_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python_headless_rolling-*
- - name: Upload wheels for opencv_contrib_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python_headless_rolling-*
-
- Pre-release:
- if: github.event_name == 'release' && github.event.release.prerelease
- needs: [Build, Build_sdist, Test]
- runs-on: ubuntu-22.04
- environment: test-opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- path: wheelhouse/
-
- - name: Upload all wheels
- run: |
- python -m pip install twine
- python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_* wheelhouse/wheel-*/opencv-*
-
- Release:
- if: github.event_name == 'release' && !github.event.release.prerelease
- needs: [Build, Build_sdist, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- path: wheelhouse/
- - name: Upload wheels for opencv_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python-* wheelhouse/wheel-*/opencv-python-[^h]*
- - name: Upload wheels for opencv_contrib_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python-* wheelhouse/wheel-*/opencv-contrib-python-[^h]*
- - name: Upload wheels for opencv_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python_headless-* wheelhouse/wheel-*/opencv-python-headless-*
- - name: Upload wheels for opencv_contrib_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python_headless-* wheelhouse/wheel-*/opencv-contrib-python-headless-*
diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml
deleted file mode 100644
index 58b06747..00000000
--- a/.github/workflows/build_wheels_linux_arm.yml
+++ /dev/null
@@ -1,189 +0,0 @@
-name: Linux ARM64
-
-on:
- pull_request:
- branches:
- - 4.x
- - 5.x
- paths-ignore:
- - '.github/workflows/build_wheels_linux.yml'
- - '.github/workflows/build_wheels_windows*'
- - '.github/workflows/build_wheels_macos*'
- release:
- types: [published, edited]
- schedule:
- - cron: '0 3 * * 6'
- workflow_dispatch:
-
-
-jobs:
- Build:
- runs-on: opencv-cn-lin-arm64
- defaults:
- run:
- shell: bash
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.9']
- platform: [x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
- env:
- ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- REPO_DIR: .
- PROJECT_SPEC: opencv-python
- MB_PYTHON_VERSION: ${{ matrix.python-version }}
- TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
- PLAT: aarch64
- MB_ML_VER: 2014
- TRAVIS_BUILD_DIR: ${{ github.workspace }}
- CONFIG_PATH: travis_config.sh
- DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20250630
- USE_CCACHE: 0
- UNICODE_WIDTH: 32
- SDIST: ${{ matrix.build_sdist || 0 }}
- ENABLE_HEADLESS: ${{ matrix.without_gui }}
- ENABLE_CONTRIB: ${{ matrix.with_contrib }}
- steps:
- - name: Cleanup
- run: find . -mindepth 1 -delete
- working-directory: ${{ github.workspace }}
- - name: Setup environment
- run: |
- if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
- echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
- fi
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: false
- fetch-depth: 0
- - name: Build a package
- run: source scripts/build.sh
- - name: Saving a wheel accordingly to matrix
- uses: actions/upload-artifact@v4
- with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
- path: wheelhouse/opencv*.whl
-
- Test:
- needs: [Build]
- runs-on: opencv-cn-lin-arm64
- defaults:
- run:
- shell: bash
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
- platform: [x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
- env:
- ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- MB_PYTHON_VERSION: ${{ matrix.python-version }}
- PLAT: aarch64
- NP_TEST_DEP: numpy==1.19.4
- NP_TEST_DEP_LATEST: numpy==2.2.6
- CONFIG_PATH: travis_config.sh
- DOCKER_TEST_IMAGE: multibuild/focal_arm64v8
- UNICODE_WIDTH: 32
- steps:
- - name: Cleanup
- run: find . -mindepth 1 -delete
- working-directory: ${{ github.workspace }}
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: true
- fetch-depth: 0
- - name: Setup Environment variables
- run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
- - name: Download a wheel accordingly to matrix
- uses: actions/download-artifact@v4
- with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
- path: wheelhouse/
- - name: Package installation and run tests
- run: source scripts/install.sh
-
- Release_rolling:
- if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-rolling-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- name: wheels
- path: wheelhouse/
- - name: Upload wheels for opencv_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
- - name: Upload wheels for opencv_contrib_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-*
- - name: Upload wheels for opencv_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-*
- - name: Upload wheels for opencv_contrib_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-*
-
- Pre-release:
- if: github.event_name == 'release' && github.event.release.prerelease
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: test-opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- name: wheels
- path: wheelhouse/
- - name: Upload all wheels
- run: |
- python -m pip install twine
- python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
-
- Release:
- if: github.event_name == 'release' && !github.event.release.prerelease
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- name: wheels
- path: wheelhouse/
- - name: Upload wheels for opencv_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-*
- - name: Upload wheels for opencv_contrib_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-*
- - name: Upload wheels for opencv_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
- - name: Upload wheels for opencv_contrib_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-*
diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml
deleted file mode 100644
index 6a84bda0..00000000
--- a/.github/workflows/build_wheels_macos.yml
+++ /dev/null
@@ -1,227 +0,0 @@
-name: macOS x86_64
-
-on:
- pull_request:
- branches:
- - 4.x
- - 5.x
- paths-ignore:
- - '.github/workflows/build_wheels_linux*'
- - '.github/workflows/build_wheels_windows*'
- - '.github/workflows/build_wheels_macos_m1.yml'
- release:
- types: [published, edited]
- schedule:
- - cron: '0 3 * * 6'
- workflow_dispatch:
-
-
-jobs:
- Build:
- runs-on: macos-13
- defaults:
- run:
- shell: bash
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.9']
- platform: [x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
- env:
- ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- REPO_DIR: .
- PROJECT_SPEC: opencv-python
- MB_PYTHON_VERSION: ${{ matrix.python-version }}
- TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
- MB_ML_VER: 2014
- TRAVIS_BUILD_DIR: ${{ github.workspace }}
- TRAVIS_OS_NAME: osx
- CONFIG_PATH: travis_config.sh
- USE_CCACHE: 1
- UNICODE_WIDTH: 32
- PLAT: x86_64
- SDIST: ${{ matrix.build_sdist || 0 }}
- ENABLE_HEADLESS: ${{ matrix.without_gui }}
- ENABLE_CONTRIB: ${{ matrix.with_contrib }}
- steps:
- - name: Cleanup
- run: find . -mindepth 1 -delete
- working-directory: ${{ github.workspace }}
- - name: Setup environment
- run: |
- if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
- echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
- fi
- # hack for image issue on mac: https://github.com/actions/runner-images/issues/6817
- rm /usr/local/bin/2to3*
- rm /usr/local/bin/idle3*
- rm /usr/local/bin/pydoc3*
- rm /usr/local/bin/python3*
- # end hack
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: false
- fetch-depth: 0
- - name: Build a package
- run: |
- set -e
- # Check out and prepare the source
- # Multibuild doesn't have releases, so --depth would break eventually (see
- # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
- git submodule update --init multibuild
- source multibuild/common_utils.sh
- # https://github.com/matthew-brett/multibuild/issues/116
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
- source multibuild/travis_steps.sh
- # This sets -x
- # source travis_multibuild_customize.sh
- echo $ENABLE_CONTRIB > contrib.enabled
- echo $ENABLE_HEADLESS > headless.enabled
- set -x
- build_wheel $REPO_DIR $PLAT
- - name: Saving a wheel accordingly to matrix
- uses: actions/upload-artifact@v4
- with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
- path: wheelhouse/opencv*.whl
-
- Test:
- needs: [Build]
- runs-on: macos-13
- defaults:
- run:
- shell: bash
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
- platform: [x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
- env:
- ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- MB_PYTHON_VERSION: ${{ matrix.python-version }}
- NP_TEST_DEP: numpy==1.19.4
- NP_TEST_DEP_LATEST: numpy==2.2.6
- CONFIG_PATH: travis_config.sh
- PLAT: x86_64
- OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata
- PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py
- steps:
- - name: Cleanup
- run: find . -mindepth 1 -delete
- working-directory: ${{ github.workspace }}
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: true
- fetch-depth: 0
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
- with:
- python-version: ${{ matrix.python-version }}
- architecture: ${{ matrix.platform }}
- - name: Setup Environment variables
- run: if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
- - name: Download a wheel accordingly to matrix
- uses: actions/download-artifact@v4
- with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
- path: wheelhouse/
- - name: Package installation
- run: |
- python -m pip install wheelhouse/opencv*.whl
- cd ${{ github.workspace }}/tests
- python get_build_info.py
- - name: Run tests
- run: |
- cd ${{ github.workspace }}/opencv
- python modules/python/test/test.py -v --repo .
- - name: Pylint test
- run: |
- python -m pip install pylint==2.15.9
- cd ${{ github.workspace }}/tests
- python -m pylint $PYLINT_TEST_FILE
-
- Release_rolling:
- if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-rolling-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- name: wheels
- path: wheelhouse/
- - name: Upload wheels for opencv_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
- - name: Upload wheels for opencv_contrib_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-*
- - name: Upload wheels for opencv_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-*
- - name: Upload wheels for opencv_contrib_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-*
-
- Pre-release:
- if: github.event_name == 'release' && github.event.release.prerelease
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: test-opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- name: wheels
- path: wheelhouse/
- - name: Upload all wheels
- run: |
- python -m pip install twine
- python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
-
- Release:
- if: github.event_name == 'release' && !github.event.release.prerelease
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- name: wheels
- path: wheelhouse/
- - name: Upload wheels for opencv_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-*
- - name: Upload wheels for opencv_contrib_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-*
- - name: Upload wheels for opencv_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
- - name: Upload wheels for opencv_contrib_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-*
diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml
deleted file mode 100644
index 875efbf7..00000000
--- a/.github/workflows/build_wheels_macos_m1.yml
+++ /dev/null
@@ -1,193 +0,0 @@
-name: macOS ARM64
-
-on:
- pull_request:
- branches:
- - 4.x
- - 5.x
- paths-ignore:
- - '.github/workflows/build_wheels_linux*'
- - '.github/workflows/build_wheels_windows*'
- - '.github/workflows/build_wheels_macos.yml'
- release:
- types: [published, edited]
- schedule:
- - cron: '0 3 * * 6'
- workflow_dispatch:
-
-
-jobs:
- Build:
- runs-on: python-macos12-m1
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.9']
- platform: [x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
- env:
- CI_BUILD: 1
- SDIST: ${{ matrix.build_sdist || 0 }}
- ENABLE_HEADLESS: ${{ matrix.without_gui }}
- ENABLE_CONTRIB: ${{ matrix.with_contrib }}
- PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
- steps:
- - name: Cleanup
- run: find . -mindepth 1 -delete
- working-directory: ${{ github.workspace }}
- - name: Setup environment
- run: |
- if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
- echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
- fi
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: false
- fetch-depth: 0
- - name: Build a package
- run: |
- git submodule update --init multibuild
- echo $ENABLE_CONTRIB > contrib.enabled
- echo $ENABLE_HEADLESS > headless.enabled
- export MACOSX_DEPLOYMENT_TARGET=13.0
- python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin
- python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
- delocate-wheel ${{ github.workspace }}/wheelhouse/opencv*
- - name: Saving a wheel accordingly to matrix
- uses: actions/upload-artifact@v4
- with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
- path: wheelhouse/opencv*.whl
-
- Test:
- needs: [Build]
- runs-on: python-macos12-m1
- strategy:
- fail-fast: false
- matrix:
- python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
- platform: [x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
- env:
- OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata
- PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py
- PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
- steps:
- - name: Cleanup
- run: find . -mindepth 1 -delete
- working-directory: ${{ github.workspace }}
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: true
- fetch-depth: 0
- - name: Download a wheel accordingly to matrix
- uses: actions/download-artifact@v4
- with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
- path: wheelhouse/
- - name: Create Venv for test
- run: |
- test -d "${{ github.workspace }}/opencv_test" && rm -rf "${{ github.workspace }}/opencv_test"
- python${{ matrix.python-version }} -m venv ${{ github.workspace }}/opencv_test
- - name: Package installation
- run: |
- source ${{ github.workspace }}/opencv_test/bin/activate
- python${{ matrix.python-version }} -m pip install --upgrade pip
- python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl
- cd ${{ github.workspace }}/tests
- python${{ matrix.python-version }} get_build_info.py
- - name: Run tests
- run: |
- source ${{ github.workspace }}/opencv_test/bin/activate
- cd ${{ github.workspace }}/opencv
- python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
- - name: Pylint test
- run: |
- source ${{ github.workspace }}/opencv_test/bin/activate
- python${{ matrix.python-version }} -m pip install pylint==2.15.9
- cd ${{ github.workspace }}/tests
- python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
-
- Release_rolling:
- if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-rolling-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- name: wheels
- path: wheelhouse/
- - name: Upload wheels for opencv_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
- - name: Upload wheels for opencv_contrib_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-*
- - name: Upload wheels for opencv_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-*
- - name: Upload wheels for opencv_contrib_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-*
-
- Pre-release:
- if: github.event_name == 'release' && github.event.release.prerelease
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: test-opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- name: wheels
- path: wheelhouse/
- - name: Upload all wheels
- run: |
- python -m pip install twine
- python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
-
- Release:
- if: github.event_name == 'release' && !github.event.release.prerelease
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- name: wheels
- path: wheelhouse/
- - name: Upload wheels for opencv_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-*
- - name: Upload wheels for opencv_contrib_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-*
- - name: Upload wheels for opencv_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
- - name: Upload wheels for opencv_contrib_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-*
diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml
index 1ee786a9..f615e34d 100644
--- a/.github/workflows/build_wheels_windows.yml
+++ b/.github/workflows/build_wheels_windows.yml
@@ -1,37 +1,81 @@
-name: Windows x86_64
+# GitHub Actions Workflow: Build opencv-python with CUDA support on Windows
+#
+# This workflow compiles opencv-python from source with CUDA enabled on a
+# GitHub-hosted Windows runner. The resulting Python wheel is then uploaded
+# as a build artifact.
+#
+# This is a complex and long-running process. It is configured to run only
+# on manual trigger (workflow_dispatch).
+
+name: Windows CUDA x64
on:
- pull_request:
- branches:
- - 4.x
- - 5.x
- paths-ignore:
- - '.github/workflows/build_wheels_linux*'
- - '.github/workflows/build_wheels_macos*'
- release:
- types: [published, edited]
- schedule:
- - cron: '0 3 * * 6'
workflow_dispatch:
+ inputs:
+ # TODO: Add cuda_version input to allow running only CUDA 12 or 13 builds for debugging
+ # TODO: Right now we don't correctly determine when things have changed and we require a
+ # rebuild, so for now we just manually trigger rebuilds between runs.
+ restore_build_cache:
+ description: "Restore build cache. Uncheck to force re-build."
+ required: false
+ type: boolean
+ default: true
+ save_build_cache:
+ description: "Save build cache."
+ required: false
+ type: boolean
+ default: false
+ rolling_build:
+ description: "Use latest commit from upstream OpenCV repo. Cache settings will be ignored."
+ required: false
+ type: boolean
+ default: false
jobs:
Build:
- runs-on: windows-2025
+ runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
- python-version: ['3.9']
- platform: [x86, x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
+ python-version: ['3.13']
+ platform: [x64]
+ cuda-version: ['12']
+ include:
+ # CUDA 12: Supports Maxwell (5.0) through Blackwell (10.0)
+ - cuda-version: '12'
+ runs-on: 'windows-2025'
+ cuda-installer: 'cuda_12.9.1_windows_network.exe'
+ cuda-path-version: 'v12.9'
+ cudnn-archive: 'cudnn-windows-x86_64-9.18.1.3_cuda12-archive.zip'
+ cudnn-folder: 'cudnn-windows-x86_64-9.18.1.3_cuda12-archive'
+ video-codec-sdk-archive: 'Video_Codec_SDK_13.0.37.zip'
+ video-codec-sdk-folder: 'Video_Codec_SDK_13.0.37'
+ cuda-arch-bin: '5.0;5.2;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0;10.0'
+ cuda-arch-ptx: '10.0'
+ cache-key: 'nvidia-deps-cuda-12.9.1-cudnn-9.18.1.3'
+ # TODO: Re-enable CUDA 13 after updating to OpenCV 4.13+
+ # CUDA 13: Supports Turing (7.5) through Blackwell (12.0)
+ # - cuda-version: '13'
+ # runs-on: 'windows-2025'
+ # cuda-installer: 'cuda_13.1.1_windows_network.exe'
+ # cuda-path-version: 'v13.1'
+ # cudnn-archive: 'cudnn-windows-x86_64-9.18.1.3_cuda13-archive.zip'
+ # cudnn-folder: 'cudnn-windows-x86_64-9.18.1.3_cuda13-archive'
+ # video-codec-sdk-archive: 'Video_Codec_SDK_13.0.37.zip'
+ # video-codec-sdk-folder: 'Video_Codec_SDK_13.0.37'
+ # cuda-arch-bin: '7.5;8.0;8.6;8.9;9.0;10.0;12.0'
+ # cuda-arch-ptx: '12.0'
+ # cache-key: 'nvidia-deps-cuda-13.1.1-cudnn-9.18.1.3'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- SDIST: ${{ matrix.build_sdist || 0 }}
- ENABLE_HEADLESS: ${{ matrix.without_gui }}
- ENABLE_CONTRIB: ${{ matrix.with_contrib }}
+ SDIST: 0
+ ENABLE_HEADLESS: 0
+ ENABLE_CONTRIB: 1
+ ENABLE_ROLLING: ${{ inputs.rolling_build && 1 || 0 }}
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata
+ CUDA_ARCH_BIN: ${{ matrix.cuda-arch-bin }}
+ CUDA_ARCH_PTX: ${{ matrix.cuda-arch-ptx }}
steps:
- name: Cleanup
shell: bash
@@ -39,12 +83,6 @@ jobs:
rm -rf ./* || true
rm -rf ./.??* || true
working-directory: ${{ github.workspace }}
- - name: Setup environment
- shell: bash
- run: |
- if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
- echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
- fi
- name: Checkout
uses: actions/checkout@v4
with:
@@ -59,6 +97,100 @@ jobs:
uses: microsoft/setup-msbuild@v1.1
- name: Setup NASM
uses: ilammy/setup-nasm@v1
+ - name: Cache NVIDIA dependencies
+ id: cache-nvidia-deps
+ uses: actions/cache@v3
+ with:
+ path: .deps/Nvidia
+ key: ${{ matrix.cache-key }}
+ - name: Clone NVIDIA dependencies
+ if: steps.cache-nvidia-deps.outputs.cache-hit != 'true'
+ env:
+ SSH_PRIVATE_KEY: ${{ secrets.DEPS_REPO_SSH_KEY }}
+ run: |
+ eval "$(ssh-agent -s)"
+ ssh-add - <<< "${SSH_PRIVATE_KEY}"
+ ssh-keyscan github.com >> ~/.ssh/known_hosts 2>/dev/null
+ git clone git@github.com:Breakthrough/opencv-python-cuda-deps.git .deps
+ shell: bash
+ - name: đź”§ Install NVIDIA CUDA Toolkit
+ run: |
+ $installer_path = ".deps/Nvidia/${{ matrix.cuda-installer }}"
+ if (-not (Test-Path $installer_path)) {
+ throw "CUDA Toolkit installer not found at $installer_path"
+ }
+ echo "Installing CUDA ${{ matrix.cuda-version }} Toolkit silently..."
+ Start-Process -FilePath $installer_path -ArgumentList "-s" -Wait -NoNewWindow
+ echo "Adding CUDA to PATH..."
+ $CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\${{ matrix.cuda-path-version }}"
+ echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
+ Copy-Item -Path "$CUDA_PATH\bin\*.dll" -Destination .
+ shell: pwsh
+ - name: đź”§ Install NVIDIA CuDNN
+ run: |
+ $cudnn_path = ".deps/Nvidia/${{ matrix.cudnn-archive }}"
+ if (-not (Test-Path $cudnn_path)) {
+ throw "CuDNN archive not found at $cudnn_path"
+ }
+ echo "Installing CuDNN for CUDA ${{ matrix.cuda-version }}..."
+ 7z x $cudnn_path
+ $CUDNN_PATH = "D:/a/opencv-python-cuda/opencv-python-cuda/${{ matrix.cudnn-folder }}"
+ echo "CUDNN_LIBRARY=$CUDNN_PATH/lib/x64/cudnn.lib" | Out-File -FilePath $env:GITHUB_ENV -Append
+ echo "CUDNN_INCLUDE_DIR=$CUDNN_PATH/include" | Out-File -FilePath $env:GITHUB_ENV -Append
+ Copy-Item -Path "$CUDNN_PATH/bin/x64/*" -Destination . -Include "*.dll"
+ shell: pwsh
+ - name: đź”§ Install NVIDIA Video Codec SDK
+ run: |
+ $sdk_path = ".deps/Nvidia/${{ matrix.video-codec-sdk-archive }}"
+ if (-not (Test-Path $sdk_path)) {
+ throw "Video Codec SDK archive not found at $sdk_path"
+ }
+ echo "Installing Video Codec SDK..."
+ 7z x $sdk_path
+ $SDK_PATH = "D:/a/opencv-python-cuda/opencv-python-cuda/${{ matrix.video-codec-sdk-folder }}"
+ echo "CUDA_nvcuvid_LIBRARY=$SDK_PATH/Lib/win/x64/nvcuvid.lib" | Out-File -FilePath $env:GITHUB_ENV -Append
+ echo "CUDA_nvencodeapi_LIBRARY=$SDK_PATH/Lib/win/x64/nvencodeapi.lib" | Out-File -FilePath $env:GITHUB_ENV -Append
+ echo "NVCUVID_INCLUDE_DIR=$SDK_PATH/Interface" | Out-File -FilePath $env:GITHUB_ENV -Append
+ shell: pwsh
+
+ - name: Restore build artifacts
+ uses: actions/cache/restore@v3
+ if: ${{ inputs.restore_build_cache && !inputs.rolling_build }}
+ with:
+ path: _skbuild
+ key: ${{ runner.os }}-${{ matrix.python-version }}-cuda${{ matrix.cuda-version }}-${{ hashFiles('**/CMakeLists.txt') }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.python-version }}-cuda${{ matrix.cuda-version }}-
+
+ - name: Remove unused CUDA DLLs
+ # Only bundle CUDA DLLs that cv2.pyd actually needs (determined via PE import analysis).
+ # This removes ~1.3 GB of unused libraries (cusparse, cusolver, curand, nvrtc, etc.)
+ run: |
+ $keep = @(
+ "cublas64_*", "cublasLt64_*", "cudart64_*", "cudnn*", "cufft64_*",
+ "nppc64_*", "nppial64_*", "nppicc64_*", "nppidei64_*", "nppif64_*",
+ "nppig64_*", "nppim64_*", "nppist64_*", "nppitc64_*"
+ )
+ # Remove from project root (where setup.py picks up *.dll)
+ # and recursively from _skbuild (cmake-install and setuptools staging dirs)
+ foreach ($dir in @(".", "_skbuild")) {
+ Get-ChildItem -Path $dir -Filter "*.dll" -Recurse -ErrorAction SilentlyContinue | Where-Object {
+ $name = $_.Name
+ $is_cuda = $name -match '^\w+64_\d'
+ $is_kept = $false
+ foreach ($pattern in $keep) {
+ if ($name -like $pattern) { $is_kept = $true; break }
+ }
+ $is_cuda -and -not $is_kept
+ } | ForEach-Object {
+ $size = [math]::Round($_.Length / 1MB)
+ $rel = Resolve-Path -Relative $_.FullName
+ echo "Removing $rel (${size} MB)"
+ Remove-Item $_.FullName
+ }
+ }
+ shell: pwsh
+
- name: Build a package
# CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version
run: |
@@ -67,12 +199,40 @@ jobs:
python -m pip install --upgrade setuptools
python -m pip install cmake==3.24.2
python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt
- set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v
- shell: cmd
+ $CI_BUILD = 1
+ if (Test-Path _skbuild) {
+ $SKIP_CMAKE = "--skip-cmake"
+ }
+ python setup.py $SKIP_CMAKE bdist_wheel --py-limited-api=cp37 --dist-dir="$PWD\wheelhouse" -v
+ shell: pwsh
+
+ # TODO(@Breakthrough): This seems to not work with `uv`...
+ - name: Repack wheel with LZMA compression
+ run: |
+ for whl in wheelhouse/opencv*.whl; do
+ src_size=$(stat -c%s "$whl")
+ echo "Repacking $(basename "$whl") ($(numfmt --to=iec $src_size))..."
+ tmpdir=$(mktemp -d)
+ 7z x -o"$tmpdir" "$whl" -y > /dev/null
+ rm "$whl"
+ (cd "$tmpdir" && 7z a -tzip -mm=LZMA -mx=5 "$OLDPWD/$whl" . > /dev/null)
+ rm -rf "$tmpdir"
+ dst_size=$(stat -c%s "$whl")
+ saved=$((src_size - dst_size))
+ echo "Done: $(numfmt --to=iec $dst_size) (saved $(numfmt --to=iec $saved))"
+ done
+ shell: bash
+
+ - name: Save build artifacts to cache
+ uses: actions/cache/save@v3
+ if: ${{ inputs.save_build_cache && !inputs.rolling_build }}
+ with:
+ path: _skbuild
+ key: ${{ runner.os }}-${{ matrix.python-version }}-cuda${{ matrix.cuda-version }}-${{ hashFiles('**/CMakeLists.txt') }}
- name: Saving all wheels
uses: actions/upload-artifact@v4
with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}
+ name: wheel-cuda${{ matrix.cuda-version }}-${{ matrix.platform }}
path: wheelhouse/opencv*
Test:
@@ -84,15 +244,12 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
- platform: [x86, x64]
- with_contrib: [0, 1]
- without_gui: [0, 1]
- build_sdist: [0]
+ python-version: ['3.12']
+ platform: [x64]
+ cuda-version: ['12'] # TODO: Re-enable '13' after updating to OpenCV 4.13+
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata
- PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py
PlatformToolset: v143
steps:
- name: Cleanup
@@ -114,7 +271,7 @@ jobs:
- name: Download a wheel accordingly to matrix
uses: actions/download-artifact@v4
with:
- name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}
+ name: wheel-cuda${{ matrix.cuda-version }}-${{ matrix.platform }}
path: wheelhouse/
- name: Package installation
run: |
@@ -125,85 +282,5 @@ jobs:
shell: powershell
- name: Run tests
run: |
- cd ${{ github.workspace }}/opencv
- python modules\python\test\test.py -v --repo .
- - name: Pylint test
- run: |
- python -m pip install pylint==2.15.9
- cd ${{ github.workspace }}\tests
- python -m pylint $PYLINT_TEST_FILE
-
- Release_rolling:
- if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-rolling-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- path: wheelhouse/
- - name: Upload wheels for opencv_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
- - name: Upload wheels for opencv_contrib_python_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-*
- - name: Upload wheels for opencv_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-*
- - name: Upload wheels for opencv_contrib_python_headless_rolling
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-*
-
- Pre-release:
- if: github.event_name == 'release' && github.event.release.prerelease
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: test-opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- path: wheelhouse/
- - name: Upload all wheels
- run: |
- python -m pip install twine
- python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
-
- Release:
- if: github.event_name == 'release' && !github.event.release.prerelease
- needs: [Build, Test]
- runs-on: ubuntu-22.04
- environment: opencv-python-release
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/download-artifact@v4
- with:
- path: wheelhouse/
- - name: Upload wheels for opencv_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-*
- - name: Upload wheels for opencv_contrib_python
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-*
- - name: Upload wheels for opencv_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
- - name: Upload wheels for opencv_contrib_python_headless
- run: |
- python -m pip install twine
- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-*
+ cd ${{ github.workspace }}/tests
+ python test.py
diff --git a/.github/workflows/cache_nvidia_deps.yml b/.github/workflows/cache_nvidia_deps.yml
new file mode 100644
index 00000000..bf5699a2
--- /dev/null
+++ b/.github/workflows/cache_nvidia_deps.yml
@@ -0,0 +1,45 @@
+# Simple workflow to cache NVIDIA dependencies
+# Run this once to populate the cache, then disable or delete
+
+name: Cache NVIDIA Dependencies
+
+on:
+ workflow_dispatch:
+
+jobs:
+ cache-deps:
+ runs-on: windows-2025
+ strategy:
+ matrix:
+ include:
+ - cuda-version: '12'
+ cache-key: 'nvidia-deps-cuda-12.9.1-cudnn-9.18.1.3'
+ - cuda-version: '13'
+ cache-key: 'nvidia-deps-cuda-13.1.1-cudnn-9.18.1.3'
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ submodules: false
+ fetch-depth: 1
+ - name: Cache NVIDIA dependencies (CUDA ${{ matrix.cuda-version }})
+ id: cache-nvidia-deps
+ uses: actions/cache@v3
+ with:
+ path: .deps/Nvidia
+ key: ${{ matrix.cache-key }}
+ - name: Clone NVIDIA dependencies
+ if: steps.cache-nvidia-deps.outputs.cache-hit != 'true'
+ env:
+ SSH_PRIVATE_KEY: ${{ secrets.DEPS_REPO_SSH_KEY }}
+ run: |
+ eval "$(ssh-agent -s)"
+ ssh-add - <<< "${SSH_PRIVATE_KEY}"
+ ssh-keyscan github.com >> ~/.ssh/known_hosts 2>/dev/null
+ git clone git@github.com:Breakthrough/opencv-python-cuda-deps.git .deps
+ shell: bash
+ - name: Cache populated
+ run: |
+ echo "NVIDIA dependencies for CUDA ${{ matrix.cuda-version }} cached successfully!"
+ ls -la .deps/Nvidia/ || echo "Cache was already populated"
+ shell: bash
diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml
new file mode 100644
index 00000000..6fb4a5b2
--- /dev/null
+++ b/.github/workflows/publish-docs.yml
@@ -0,0 +1,37 @@
+name: Publish Docs
+
+on:
+ push:
+ branches:
+ - 4.x-cuda
+ paths:
+ - 'docs/**.html'
+ - 'docs/**.css'
+ - 'docs/**.js'
+ workflow_dispatch:
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Update gh-pages Branch
+ shell: bash
+ run: |
+ git config --global user.name github-actions
+ git config --global user.email github-actions@github.com
+
+ cp -r docs docs-tmp
+ git fetch origin gh-pages
+ git checkout gh-pages
+ mv -f docs-tmp/* .
+ git add *
+ if git diff --cached --quiet; then
+ echo "No changes to deploy."
+ else
+ git commit -m "[docs] @${{ github.triggering_actor }}: Update Documentation" \
+ -m "Source: ${{ github.ref_name }} (${{ github.sha }})"
+ git push
+ fi
diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt
index b5e8f5e9..68ec9807 100644
--- a/LICENSE-3RD-PARTY.txt
+++ b/LICENSE-3RD-PARTY.txt
@@ -3511,3 +3511,1380 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+
+
+------------------------------------------------------------------------------
+
+Certain DLLs from the NVIDIA® CUDA™ Toolkit are distributed with opencv-python-cuda
+under the following terms:
+
+The terms in this supplement govern your use of the NVIDIA CUDA Toolkit SDK under the terms of your license agreement (“Agreement”) as modified by this supplement. Capitalized terms used but not defined below have the meaning assigned to them in the Agreement.
+
+This supplement is an exhibit to the Agreement and is incorporated as an integral part of the Agreement. In the event of conflict between the terms in this supplement and the terms in the Agreement, the terms in this supplement govern.
+2.1. License Scope
+
+The SDK is licensed for you to develop applications only for use in systems with NVIDIA GPUs.
+2.2. Distribution
+
+The portions of the SDK that are distributable under the Agreement are listed in Attachment A.
+2.3. Operating Systems
+
+Those portions of the SDK designed exclusively for use on the Linux or FreeBSD operating systems, or other operating systems derived from the source code to these operating systems, may be copied and redistributed for use in accordance with this Agreement, provided that the object code files are not modified in any way (except for unzipping of compressed files).
+2.4. Audio and Video Encoders and Decoders
+
+You acknowledge and agree that it is your sole responsibility to obtain any additional third-party licenses required to make, have made, use, have used, sell, import, and offer for sale your products or services that include or incorporate any third-party software and content relating to audio and/or video encoders and decoders from, including but not limited to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A., MPEG-LA, and Coding Technologies. NVIDIA does not grant to you under this Agreement any necessary patent or other rights with respect to any audio and/or video encoders and decoders.
+2.5. Licensing
+
+If the distribution terms in this Agreement are not suitable for your organization, or for any questions regarding this Agreement, please contact NVIDIA at nvidia-compute-license-questions@nvidia.com.
+2.6. Attachment A
+
+The following CUDA Toolkit files may be distributed with applications developed by you, including certain variations of these files that have version number or architecture specific information embedded in the file name - as an example only, for release version 9.0 of the 64-bit Windows software, the file cudart64_90.dll is redistributable.
+
+Component
+
+
+CUDA Runtime
+
+Windows
+
+
+cudart.dll, cudart_static.lib, cudadevrt.lib
+
+Mac OSX
+
+
+libcudart.dylib, libcudart_static.a, libcudadevrt.a
+
+Linux
+
+
+libcudart.so, libcudart_static.a, libcudadevrt.a
+
+Android
+
+
+libcudart.so, libcudart_static.a, libcudadevrt.a
+
+Component
+
+
+CUDA FFT Library
+
+Windows
+
+
+cufft.dll, cufftw.dll, cufft.lib, cufftw.lib
+
+Mac OSX
+
+
+libcufft.dylib, libcufft_static.a, libcufftw.dylib, libcufftw_static.a
+
+Linux
+
+
+libcufft.so, libcufft_static.a, libcufftw.so, libcufftw_static.a
+
+Android
+
+
+libcufft.so, libcufft_static.a, libcufftw.so, libcufftw_static.a
+
+Component
+
+
+CUDA BLAS Library
+
+Windows
+
+
+cublas.dll, cublasLt.dll
+
+Mac OSX
+
+
+libcublas.dylib, libcublasLt.dylib, libcublas_static.a, libcublasLt_static.a
+
+Linux
+
+
+libcublas.so, libcublasLt.so, libcublas_static.a, libcublasLt_static.a
+
+Android
+
+
+libcublas.so, libcublasLt.so, libcublas_static.a, libcublasLt_static.a
+
+Component
+
+
+NVIDIA “Drop-in” BLAS Library
+
+Windows
+
+
+nvblas.dll
+
+Mac OSX
+
+
+libnvblas.dylib
+
+Linux
+
+
+libnvblas.so
+
+Component
+
+
+CUDA Sparse Matrix Library
+
+Windows
+
+
+cusparse.dll, cusparse.lib
+
+Mac OSX
+
+
+libcusparse.dylib, libcusparse_static.a
+
+Linux
+
+
+libcusparse.so, libcusparse_static.a
+
+Android
+
+
+libcusparse.so, libcusparse_static.a
+
+Component
+
+
+CUDA Linear Solver Library
+
+Windows
+
+
+cusolver.dll, cusolver.lib
+
+Mac OSX
+
+
+libcusolver.dylib, libcusolver_static.a
+
+Linux
+
+
+libcusolver.so, libcusolver_static.a
+
+Android
+
+
+libcusolver.so, libcusolver_static.a
+
+Component
+
+
+CUDA Random Number Generation Library
+
+Windows
+
+
+curand.dll, curand.lib
+
+Mac OSX
+
+
+libcurand.dylib, libcurand_static.a
+
+Linux
+
+
+libcurand.so, libcurand_static.a
+
+Android
+
+
+libcurand.so, libcurand_static.a
+
+Component
+
+
+NVIDIA Performance Primitives Library
+
+Windows
+
+
+nppc.dll, nppc.lib, nppial.dll, nppial.lib, nppicc.dll, nppicc.lib, nppicom.dll, nppicom.lib, nppidei.dll, nppidei.lib, nppif.dll, nppif.lib, nppig.dll, nppig.lib, nppim.dll, nppim.lib, nppist.dll, nppist.lib, nppisu.dll, nppisu.lib, nppitc.dll, nppitc.lib, npps.dll, npps.lib
+
+Mac OSX
+
+
+libnppc.dylib, libnppc_static.a, libnppial.dylib, libnppial_static.a, libnppicc.dylib, libnppicc_static.a, libnppicom.dylib, libnppicom_static.a, libnppidei.dylib, libnppidei_static.a, libnppif.dylib, libnppif_static.a, libnppig.dylib, libnppig_static.a, libnppim.dylib, libnppisu_static.a, libnppitc.dylib, libnppitc_static.a, libnpps.dylib, libnpps_static.a
+
+Linux
+
+
+libnppc.so, libnppc_static.a, libnppial.so, libnppial_static.a, libnppicc.so, libnppicc_static.a, libnppicom.so, libnppicom_static.a, libnppidei.so, libnppidei_static.a, libnppif.so, libnppif_static.a libnppig.so, libnppig_static.a, libnppim.so, libnppim_static.a, libnppist.so, libnppist_static.a, libnppisu.so, libnppisu_static.a, libnppitc.so libnppitc_static.a, libnpps.so, libnpps_static.a
+
+Android
+
+
+libnppc.so, libnppc_static.a, libnppial.so, libnppial_static.a, libnppicc.so, libnppicc_static.a, libnppicom.so, libnppicom_static.a, libnppidei.so, libnppidei_static.a, libnppif.so, libnppif_static.a libnppig.so, libnppig_static.a, libnppim.so, libnppim_static.a, libnppist.so, libnppist_static.a, libnppisu.so, libnppisu_static.a, libnppitc.so libnppitc_static.a, libnpps.so, libnpps_static.a
+
+Component
+
+
+NVIDIA JPEG Library
+
+Windows
+
+
+nvjpeg.lib, nvjpeg.dll
+
+Linux
+
+
+libnvjpeg.so, libnvjpeg_static.a
+
+Component
+
+
+Internal common library required for statically linking to cuBLAS, cuSPARSE, cuFFT, cuRAND, nvJPEG and NPP
+
+Mac OSX
+
+
+libculibos.a
+
+Linux
+
+
+libculibos.a
+
+Component
+
+
+NVIDIA Runtime Compilation Library and Header
+
+All
+
+
+nvrtc.h
+
+Windows
+
+
+nvrtc.dll, nvrtc-builtins.dll
+
+Mac OSX
+
+
+libnvrtc.dylib, libnvrtc-builtins.dylib
+
+Linux
+
+
+libnvrtc.so, libnvrtc-builtins.so, libnvrtc_static.a, libnvrtc-builtins_static.a
+
+Component
+
+
+NVIDIA Optimizing Compiler Library
+
+Windows
+
+
+nvvm.dll
+
+Mac OSX
+
+
+libnvvm.dylib
+
+Linux
+
+
+libnvvm.so
+
+Component
+
+
+NVIDIA JIT Linking Library
+
+Windows
+
+
+libnvJitLink.dll, libnvJitLink.lib
+
+Linux
+
+
+libnvJitLink.so, libnvJitLink_static.a
+
+Component
+
+
+NVIDIA Common Device Math Functions Library
+
+Windows
+
+
+libdevice.10.bc
+
+Mac OSX
+
+
+libdevice.10.bc
+
+Linux
+
+
+libdevice.10.bc
+
+Component
+
+
+CUDA Occupancy Calculation Header Library
+
+All
+
+
+cuda_occupancy.h
+
+Component
+
+
+CUDA Floating Point Type Headers
+
+All
+
+
+cuda_fp16.h, cuda_fp16.hpp, cuda_bf16.h, cuda_bf16.hpp, cuda_fp8.h, cuda_fp8.hpp, cuda_fp6.h, cuda_fp6.hpp, cuda_fp4.h, cuda_fp4.hpp
+
+Component
+
+
+CUDA Headers for Runtime Compilation
+
+All
+
+
+crt/host_defines.h, cuComplex.h, cuda_awbarrier_helpers.h, cuda_awbarrier_primitives.h, cuda_wbarrier.h, cuda_pipeline_helpers.h, cuda_pipeline_primitives.h, cuda_pipeline.h, cuda_runtime_api.h, cuda.h, cuda/std/tuple, cuda/std/type_traits, cuda/std/type_traits, cuda/std/utility, device_types.h, vector_functions.h, vector_types.h
+
+Component
+
+
+CUDA Profiling Tools Interface (CUPTI) Library
+
+Windows
+
+
+cupti.dll
+
+Mac OSX
+
+
+libcupti.dylib
+
+Linux
+
+
+libcupti.so
+
+Component
+
+
+NVIDIA Tools Extension Library
+
+Windows
+
+
+nvToolsExt.dll, nvToolsExt.lib
+
+Mac OSX
+
+
+libnvToolsExt.dylib
+
+Linux
+
+
+libnvToolsExt.so
+
+Component
+
+
+NVIDIA CUDA Driver Libraries
+
+Linux
+
+
+libcuda.so, libnvidia-ptxjitcompiler.so, libnvptxcompiler_static.a
+
+Component
+
+
+NVIDIA CUDA File IO Libraries and Header
+
+All
+
+
+cufile.h
+
+Linux
+
+
+libcufile.so, libcufile_rdma.so, libcufile_static.a, libcufile_rdma_static.a
+
+In addition to the rights above, for parties that are developing software intended solely for use on Jetson development kits or Jetson modules, and running Linux for Tegra software, the following shall apply:
+
+ The SDK may be distributed in its entirety, as provided by NVIDIA, and without separation of its components, for you and/or your licensees to create software development kits for use only on the Jetson platform and running Linux for Tegra software.
+
+2.7. Attachment B
+
+Additional Licensing Obligations
+
+The following third party components included in the SOFTWARE are licensed to Licensee pursuant to the following terms and conditions:
+
+ Licensee’s use of the GDB third party component is subject to the terms and conditions of GNU GPL v3:
+
+ This product includes copyrighted third-party software licensed
+ under the terms of the GNU General Public License v3 ("GPL v3").
+ All third-party software packages are copyright by their respective
+ authors. GPL v3 terms and conditions are hereby incorporated into
+ the Agreement by this reference: http://www.gnu.org/licenses/gpl.txt
+
+Consistent with these licensing requirements, the software listed below is provided under the terms of the specified open source software licenses. To obtain source code for software provided under licenses that require redistribution of source code, including the GNU General Public License (GPL) and GNU Lesser General Public License (LGPL), contact oss-requests@nvidia.com. This offer is valid for a period of three (3) years from the date of the distribution of this product by NVIDIA CORPORATION.
+
+Component License
+CUDA-GDB GPL v3
+
+Licensee represents and warrants that any and all third party licensing and/or royalty payment obligations in connection with Licensee’s use of the H.264 video codecs are solely the responsibility of Licensee.
+
+Licensee’s use of the Thrust library is subject to the terms and conditions of the Apache License Version 2.0. All third-party software packages are copyright by their respective authors. Apache License Version 2.0 terms and conditions are hereby incorporated into the Agreement by this reference. http://www.apache.org/licenses/LICENSE-2.0.html
+
+In addition, Licensee acknowledges the following notice: Thrust includes source code from the Boost Iterator, Tuple, System, and Random Number libraries.
+
+Boost Software License - Version 1.0 - August 17th, 2003
+. . . .
+
+Permission is hereby granted, free of charge, to any person or
+organization obtaining a copy of the software and accompanying
+documentation covered by this license (the "Software") to use,
+reproduce, display, distribute, execute, and transmit the Software,
+and to prepare derivative works of the Software, and to permit
+third-parties to whom the Software is furnished to do so, all
+subject to the following:
+
+The copyright notices in the Software and this entire statement,
+including the above license grant, this restriction and the following
+disclaimer, must be included in all copies of the Software, in whole
+or in part, and all derivative works of the Software, unless such
+copies or derivative works are solely in the form of machine-executable
+object code generated by a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
+NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
+OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Licensee’s use of the LLVM third party component is subject to the following terms and conditions:
+
+ ========================================================================================================
+ All LLVM after 8.0 are distributed under Apache-2.0 with LLVM-exception license, an OSI-approved license
+ ========================================================================================================
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-----------------------------------------
+LLVM Exceptions to the Apache 2.0 License
+-----------------------------------------
+
+As an exception, if, as a result of your compiling your source code, portions
+of this Software are embedded into an Object form of such source code, you
+may redistribute such embedded portions in such Object form without complying
+with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
+
+In addition, if you combine or link compiled forms of this Software with
+software that is licensed under the GPLv2 ("Combined Software") and if a
+court of competent jurisdiction determines that the patent provision (Section
+3), the indemnity provision (Section 9) or other Section of the License
+conflicts with the conditions of the GPLv2, you may retroactively and
+prospectively choose to deem waived or otherwise exclude such Section(s) of
+the License, but only in their entirety and only with respect to the Combined
+Software.
+
+========================================================
+Software from third parties included in the LLVM Project
+========================================================
+
+The LLVM Project contains third party software which is under different license
+terms. All such code will be identified clearly using at least one of two
+mechanisms:
+1) It will be in a separate directory tree with its own `LICENSE.txt` or
+`LICENSE` file at the top containing the specific license and restrictions
+which apply to that software, or
+2) It will contain specific license and restriction terms at the top of every
+file.
+
+==================================================================================================
+LLVM releases prior to LLVM 8.0 was licensed under this University of Illinois Open Source License
+==================================================================================================
+
+University of Illinois/NCSA
+Open Source License
+
+Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign.
+All rights reserved.
+
+Developed by:
+
+ LLVM Team
+
+ University of Illinois at Urbana-Champaign
+
+ http://llvm.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimers.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimers in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of the LLVM Team, University of Illinois at
+ Urbana-Champaign, nor the names of its contributors may be used to
+ endorse or promote products derived from this Software without specific
+ prior written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+SOFTWARE.
+
+Licensee’s use of the PCRE third party component is subject to the following terms and conditions:
+
+------------
+PCRE LICENCE
+------------
+PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
+specified below. The documentation for PCRE, supplied in the "doc"
+directory, is distributed under the same terms as the software itself. The
+basic library functions are written in C and are freestanding. Also
+included in the distribution is a set of C++ wrapper functions, and a just-
+in-time compiler that can be used to optimize pattern matching. These are
+both optional features that can be omitted when the library is built.
+
+THE BASIC LIBRARY FUNCTIONS
+---------------------------
+Written by: Philip Hazel
+Email local part: ph10
+Email domain: cam.ac.uk
+University of Cambridge Computing Service,
+Cambridge, England.
+Copyright (c) 1997-2012 University of Cambridge
+All rights reserved.
+
+PCRE JUST-IN-TIME COMPILATION SUPPORT
+-------------------------------------
+Written by: Zoltan Herczeg
+Email local part: hzmester
+Emain domain: freemail.hu
+Copyright(c) 2010-2012 Zoltan Herczeg
+All rights reserved.
+
+STACK-LESS JUST-IN-TIME COMPILER
+--------------------------------
+Written by: Zoltan Herczeg
+Email local part: hzmester
+Emain domain: freemail.hu
+Copyright(c) 2009-2012 Zoltan Herczeg
+All rights reserved.
+
+THE C++ WRAPPER FUNCTIONS
+-------------------------
+Contributed by: Google Inc.
+Copyright (c) 2007-2012, Google Inc.
+All rights reserved.
+
+THE "BSD" LICENCE
+-----------------
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of the University of Cambridge nor the name of Google
+ Inc. nor the names of their contributors may be used to endorse or
+ promote products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+Some of the cuBLAS library routines were written by or derived from code written by Vasily Volkov and are subject to the Modified Berkeley Software Distribution License as follows:
+
+Copyright (c) 2007-2009, Regents of the University of California
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the University of California, Berkeley nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+Some of the cuBLAS library routines were written by or derived from code written by Davide Barbieri and are subject to the Modified Berkeley Software Distribution License as follows:
+
+Copyright (c) 2008-2009 Davide Barbieri @ University of Rome Tor Vergata.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+Some of the cuBLAS library routines were derived from code developed by the University of Tennessee and are subject to the Modified Berkeley Software Distribution License as follows:
+
+Copyright (c) 2010 The University of Tennessee.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer listed in this license in the documentation and/or
+ other materials provided with the distribution.
+ * Neither the name of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Some of the cuBLAS library routines were written by or derived from code written by Jonathan Hogg and are subject to the Modified Berkeley Software Distribution License as follows:
+
+Copyright (c) 2012, The Science and Technology Facilities Council (STFC).
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the STFC nor the names of its contributors
+ may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE STFC BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Some of the cuBLAS library routines were written by or derived from code written by Ahmad M. Abdelfattah, David Keyes, and Hatem Ltaief, and are subject to the Apache License, Version 2.0, as follows:
+
+-- (C) Copyright 2013 King Abdullah University of Science and Technology
+ Authors:
+ Ahmad Abdelfattah (ahmad.ahmad@kaust.edu.sa)
+ David Keyes (david.keyes@kaust.edu.sa)
+ Hatem Ltaief (hatem.ltaief@kaust.edu.sa)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the King Abdullah University of Science and
+ Technology nor the names of its contributors may be used to endorse
+ or promote products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+
+Some of the cuSPARSE library routines were written by or derived from code written by Li-Wen Chang and are subject to the NCSA Open Source License as follows:
+
+Copyright (c) 2012, University of Illinois.
+
+All rights reserved.
+
+Developed by: IMPACT Group, University of Illinois, http://impact.crhc.illinois.edu
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal with the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimers in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the names of IMPACT Group, University of Illinois, nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this Software without specific prior
+ written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+SOFTWARE.
+
+Some of the cuRAND library routines were written by or derived from code written by Mutsuo Saito and Makoto Matsumoto and are subject to the following license:
+
+Copyright (c) 2009, 2010 Mutsuo Saito, Makoto Matsumoto and Hiroshima
+University. All rights reserved.
+
+Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima
+University and University of Tokyo. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the Hiroshima University nor the names of
+ its contributors may be used to endorse or promote products
+ derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Some of the cuRAND library routines were derived from code developed by D. E. Shaw Research and are subject to the following license:
+
+Copyright 2010-2011, D. E. Shaw Research.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions, and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions, and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of D. E. Shaw Research nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Some of the Math library routines were written by or derived from code developed by Norbert Juffa and are subject to the following license:
+
+Copyright (c) 2015-2017, Norbert Juffa
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Licensee’s use of the lz4 third party component is subject to the following terms and conditions:
+
+Copyright (C) 2011-2013, Yann Collet.
+BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The NPP library uses code from the Boost Math Toolkit, and is subject to the following license:
+
+Boost Software License - Version 1.0 - August 17th, 2003
+. . . .
+
+Permission is hereby granted, free of charge, to any person or
+organization obtaining a copy of the software and accompanying
+documentation covered by this license (the "Software") to use,
+reproduce, display, distribute, execute, and transmit the Software,
+and to prepare derivative works of the Software, and to permit
+third-parties to whom the Software is furnished to do so, all
+subject to the following:
+
+The copyright notices in the Software and this entire statement,
+including the above license grant, this restriction and the following
+disclaimer, must be included in all copies of the Software, in whole
+or in part, and all derivative works of the Software, unless such
+copies or derivative works are solely in the form of machine-executable
+object code generated by a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
+NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
+OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Portions of the Nsight Eclipse Edition is subject to the following license:
+
+The Eclipse Foundation makes available all content in this plug-in
+("Content"). Unless otherwise indicated below, the Content is provided
+to you under the terms and conditions of the Eclipse Public License
+Version 1.0 ("EPL"). A copy of the EPL is available at http://
+www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program"
+will mean the Content.
+
+If you did not receive this Content directly from the Eclipse
+Foundation, the Content is being redistributed by another party
+("Redistributor") and different terms and conditions may apply to your
+use of any object code in the Content. Check the Redistributor's
+license that was provided with the Content. If no such license exists,
+contact the Redistributor. Unless otherwise indicated below, the terms
+and conditions of the EPL still apply to any source code in the
+Content and such source code may be obtained at http://www.eclipse.org.
+
+Some of the cuBLAS library routines uses code from OpenAI, which is subject to the following license:
+
+License URL
+https://github.com/openai/openai-gemm/blob/master/LICENSE
+
+License Text
+The MIT License
+
+Copyright (c) 2016 OpenAI (http://openai.com), 2016 Google Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+Licensee’s use of the Visual Studio Setup Configuration Samples is subject to the following license:
+
+The MIT License (MIT)
+Copyright (C) Microsoft Corporation. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Licensee’s use of linmath.h header for CPU functions for GL vector/matrix operations from lunarG is subject to the Apache License Version 2.0.
+
+The DX12-CUDA sample uses the d3dx12.h header, which is subject to the MIT license .
+
+Components of the driver and compiler used for binary management, including nvFatBin, nvcc, and cuobjdump, use the Zstandard library which is subject to the following license:
+
+BSD License
+
+For Zstandard software
+
+Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted
+provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name Facebook, nor Meta, nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+Components of the ctadvisor component, use the SQLite library which is subject to the following license:
+
+All of the code and documentation in SQLite has been dedicated to the public domain by the
+authors. All code authors, and representatives of the companies they work for, have signed
+affidavits dedicating their contributions to the public domain and originals of those signed
+affidavits are stored in a firesafe at the main offices of Hwaci. All contributors are citizens
+of countries that allow creative works to be dedicated into the public domain. Anyone is free
+to copy, modify, publish, use, compile, sell, or distribute the original SQLite code, either
+in source code form or as a compiled binary, for any purpose, commercial or non-commercial,
+and by any means.
+
+Portions of support for math operations on 128-bit floating-point data type in compiler were derived from SLEEF library which is subject to the following license:
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+Portions of support for math operations on 128-bit floating-point data type in compiler were derived from SoftFloat library which is subject to the following license:
+
+The SoftFloat package was written by me, John R. Hauser. Release 3 of SoftFloat
+was a completely new implementation supplanting earlier releases. The project to
+create Release 3 (now through 3e) was done in the employ of the University of
+California, Berkeley, within the Department of Electrical Engineering and
+Computer Sciences, first for the Parallel Computing Laboratory (Par Lab) and
+then for the ASPIRE Lab. The work was officially overseen by Prof. Krste
+Asanovic, with funding provided by these sources:
+
+Par Lab: Microsoft (Award #024263), Intel (Award #024894), and U.C. Discovery
+(Award #DIG07-10227), with additional support from Par Lab affiliates Nokia,
+NVIDIA, Oracle, and Samsung.
+ASPIRE Lab: DARPA PERFECT program (Award #HR0011-12-2-0016), with additional
+support from ASPIRE industrial sponsor Intel and ASPIRE affiliates Google, Nokia,
+NVIDIA, Oracle, and Samsung.
+The following applies to the whole of SoftFloat Release 3e as well as to each
+source file individually.
+
+Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the
+University of California. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions, and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this
+list of conditions, and the following disclaimer in the documentation and/or
+other materials provided with the distribution.
+
+Neither the name of the University nor the names of its contributors may be used
+to endorse or promote products derived from this software without specific prior
+written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT
+SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/LICENSE.txt b/LICENSE.txt
index 328bf506..da75e9a9 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,5 +1,32 @@
MIT License
+Copyright (c) Brandon Castellano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+-------------------------------------------------------------------------------
+
+This is a fork of the opencv-python project originallly by Olli-Pekka Heinisuo
+which is distributed under the following license:
+
+MIT License
+
Copyright (c) Olli-Pekka Heinisuo
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -18,4 +45,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
+SOFTWARE.
diff --git a/MANIFEST.in b/MANIFEST.in
index cb9a7e7b..ee89ec0a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,10 +1,10 @@
include LICENSE-3RD-PARTY.txt
include LICENSE.txt
include README.md
-include find_version.py
include setup.py
include pyproject.toml
include _build_backend/backend.py
+include *.dll
recursive-include cv2 *
recursive-include docker *
recursive-include opencv *
diff --git a/README.md b/README.md
index 6de64d64..d4ca39c9 100644
--- a/README.md
+++ b/README.md
@@ -1,255 +1,54 @@
-[](http://pepy.tech/project/opencv-python)
+## `opencv-python-cuda`
-### Keep OpenCV Free
+Download: [Latest Release (4.12.0-dev1)](https://github.com/Breakthrough/opencv-python-cuda/releases/tag/4.12.0-dev1)
-OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. [Donate to OpenCV on Github](https://github.com/sponsors/opencv) to show your support.
+## What is `opencv-python-cuda`?
-- [OpenCV on Wheels](#opencv-on-wheels)
- - [Installation and Usage](#installation-and-usage)
-- [Frequently Asked Questions](#frequently-asked-questions)
-- [Documentation for opencv-python](#documentation-for-opencv-python)
- - [CI build process](#ci-build-process)
- - [Manual builds](#manual-builds)
- - [Manual debug builds](#manual-debug-builds)
- - [Source distributions](#source-distributions)
- - [Licensing](#licensing)
- - [Versioning](#versioning)
- - [Releases](#releases)
- - [Development builds](#development-builds)
- - [Manylinux wheels](#manylinux-wheels)
- - [Supported Python versions](#supported-python-versions)
- - [Backward compatibility](#backward-compatibility)
+Pre-built NVIDIA® CUDA™ enabled OpenCV packages for Python that come with all batteries included. This is a fork of [the official opencv-python project](https://github.com/opencv/opencv-python). Right now packages are only produced for Windows x64, and devices must be Maxwell class (GeForce 900 series) or newer. Once installed via `pip` (or another Python package manager like `uv`), the following should *just work*:
-## OpenCV on Wheels
-
-Pre-built CPU-only OpenCV packages for Python.
-
-Check the manual build section if you wish to compile the bindings from source to enable additional modules such as CUDA.
+```
+import cv2
+print(cv2.cuda.getCudaEnabledDeviceCount())
+```
### Installation and Usage
1. If you have previous/other manually installed (= not installed via ``pip``) version of OpenCV installed (e.g. cv2 module in the root of Python's site-packages), remove it before installation to avoid conflicts.
2. Make sure that your `pip` version is up-to-date (19.3 is the minimum supported version): `pip install --upgrade pip`. Check version with `pip -V`. For example Linux distributions ship usually with very old `pip` versions which cause a lot of unexpected problems especially with the `manylinux` format.
-3. Select the correct package for your environment:
-
- There are four different packages (see options 1, 2, 3 and 4 below) and you should **SELECT ONLY ONE OF THEM**. Do not install multiple different packages in the same environment. There is no plugin architecture: all the packages use the same namespace (`cv2`). If you installed multiple different packages in the same environment, uninstall them all with ``pip uninstall`` and reinstall only one package.
-
- **a.** Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution)
-
- - Option 1 - Main modules package: ``pip install opencv-python``
- - Option 2 - Full package (contains both main modules and contrib/extra modules): ``pip install opencv-contrib-python`` (check contrib/extra modules listing from [OpenCV documentation](https://docs.opencv.org/master/))
-
- **b.** Packages for server (headless) environments (such as Docker, cloud environments etc.), no GUI library dependencies
-
- These packages are smaller than the two other packages above because they do not contain any GUI functionality (not compiled with Qt / other GUI components). This means that the packages avoid a heavy dependency chain to X11 libraries and you will have for example smaller Docker images as a result. You should always use these packages if you do not use `cv2.imshow` et al. or you are using some other package (such as PyQt) than OpenCV to create your GUI.
-
- - Option 3 - Headless main modules package: ``pip install opencv-python-headless``
- - Option 4 - Headless full package (contains both main modules and contrib/extra modules): ``pip install opencv-contrib-python-headless`` (check contrib/extra modules listing from [OpenCV documentation](https://docs.opencv.org/master/))
-
-4. Import the package:
-
- ``import cv2``
-
- All packages contain Haar cascade files. ``cv2.data.haarcascades`` can be used as a shortcut to the data folder. For example:
-
- ``cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")``
-
-5. Read [OpenCV documentation](https://docs.opencv.org/master/)
-
-6. Before opening a new issue, read the FAQ below and have a look at the other issues which are already open.
+3. Download the latest build `opencv_python_cuda-*-win_amd64.whl` file and install it.
+4. Import the `cv2` package as usual.
Frequently Asked Questions
--------------------------
-**Q: Do I need to install also OpenCV separately?**
-
-A: No, the packages are special wheel binary packages and they already contain statically built OpenCV binaries.
-
-**Q: Pip install fails with ``ModuleNotFoundError: No module named 'skbuild'``?**
-
-Since ``opencv-python`` version 4.3.0.\*, ``manylinux1`` wheels were replaced by ``manylinux2014`` wheels. If your pip is too old, it will try to use the new source distribution introduced in 4.3.0.38 to manually build OpenCV because it does not know how to install ``manylinux2014`` wheels. However, source build will also fail because of too old ``pip`` because it does not understand build dependencies in ``pyproject.toml``. To use the new ``manylinux2014`` pre-built wheels (or to build from source), your ``pip`` version must be >= 19.3. Please upgrade ``pip`` with ``pip install --upgrade pip``.
-
-**Q: Import fails on Windows: ``ImportError: DLL load failed: The specified module could not be found.``?**
-
-A: If the import fails on Windows, make sure you have [Visual C++ redistributable 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145) installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, [Universal C Runtime](https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows) might be also required.
+Please refer to [the FAQ in the upstream project](https://github.com/opencv/opencv-python/?tab=readme-ov-file#frequently-asked-questions) for the most common questions.
-Windows N and KN editions do not include Media Feature Pack which is required by OpenCV. If you are using Windows N or KN edition, please install also [Windows Media Feature Pack](https://support.microsoft.com/en-us/help/3145500/media-feature-pack-list-for-windows-n-editions).
+**Q: How do I install `opencv-python-cuda`?**
-If you have Windows Server 2012+, media DLLs are probably missing too; please install the Feature called "Media Foundation" in the Server Manager. Beware, some posts advise to install "Windows Server Essentials Media Pack", but this one requires the "Windows Server Essentials Experience" role, and this role will deeply affect your Windows Server configuration (by enforcing active directory integration etc.); so just installing the "Media Foundation" should be a safer choice.
+A: Releases can be downloaded from [the Releases page](https://github.com/Breakthrough/opencv-python-cuda/releases). You can download and install the pre-built Python .whl file with `pip install`.
-If the above does not help, check if you are using Anaconda. Old Anaconda versions have a bug which causes the error, see [this issue](https://github.com/opencv/opencv-python/issues/36) for a manual fix.
+**Q: Can you upload `opencv-python-cuda` to PyPI?**
-If you still encounter the error after you have checked all the previous solutions, download [Dependencies](https://github.com/lucasg/Dependencies) and open the ``cv2.pyd`` (located usually at ``C:\Users\username\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\cv2``) file with it to debug missing DLL issues.
+A: No, the package is far too large and exceeds [project size limits](https://docs.pypi.org/project-management/storage-limits/).
-**Q: I have some other import errors?**
+**Q: What do the wheels include?**
-A: Make sure you have removed old manual installations of OpenCV Python bindings (cv2.so or cv2.pyd in site-packages).
+All OpenCV modules that can be enabled with CUDA. All required runtime files are included in the wheels. Non-free algorithms are excluded as per the following question.
-**Q: Function foo() or method bar() returns wrong result, throws exception or crashes interpreter. What should I do?**
-
-A: The repository contains only OpenCV-Python package build scripts, but not OpenCV itself. Python bindings for OpenCV are developed in official OpenCV repository and it's the best place to report issues. Also please check [OpenCV wiki](https://github.com/opencv/opencv/wiki) and [the official OpenCV forum](https://forum.opencv.org/) before file new bugs.
-
-**Q: Why the packages do not include non-free algorithms?**
+**Q: Why are non-free algorithms excluded?**
A: Non-free algorithms such as SURF are not included in these packages because they are patented / non-free and therefore cannot be distributed as built binaries. Note that SIFT is included in the builds due to patent expiration since OpenCV versions 4.3.0 and 3.4.10. See this issue for more info: https://github.com/skvark/opencv-python/issues/126
-**Q: Why the package and import are different (opencv-python vs. cv2)?**
-
-A: It's easier for users to understand ``opencv-python`` than ``cv2`` and it makes it easier to find the package with search engines. `cv2` (old interface in old OpenCV versions was named as `cv`) is the name that OpenCV developers chose when they created the binding generators. This is kept as the import name to be consistent with different kind of tutorials around the internet. Changing the import name or behaviour would be also confusing to experienced users who are accustomed to the ``import cv2``.
-
-## Documentation for opencv-python
-
-[](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_windows.yml)
-[](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_linux.yml)
-[](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_macos.yml)
-
-The aim of this repository is to provide means to package each new [OpenCV release](https://github.com/opencv/opencv/releases) for the most used Python versions and platforms.
-
-### CI build process
-
-The project is structured like a normal Python package with a standard ``setup.py`` file.
-The build process for a single entry in the build matrices is as follows (see for example `.github/workflows/build_wheels_linux.yml` file):
-
-0. In Linux and MacOS build: get OpenCV's optional C dependencies that we compile against
-
-1. Checkout repository and submodules
-
- - OpenCV is included as submodule and the version is updated
- manually by maintainers when a new OpenCV release has been made
- - Contrib modules are also included as a submodule
-
-2. Find OpenCV version from the sources
-
-3. Build OpenCV
-
- - tests are disabled, otherwise build time increases too much
- - there are 4 build matrix entries for each build combination: with and without contrib modules, with and without GUI (headless)
- - Linux builds run in manylinux Docker containers (CentOS 5)
- - source distributions are separate entries in the build matrix
-
-4. Rearrange OpenCV's build result, add our custom files and generate wheel
-
-5. Linux and macOS wheels are transformed with auditwheel and delocate, correspondingly
-
-6. Install the generated wheel
-7. Test that Python can import the library and run some sanity checks
-8. Use twine to upload the generated wheel to PyPI (only in release builds)
-
-Steps 1--4 are handled by ``pip wheel``.
-
-The build can be customized with environment variables. In addition to any variables that OpenCV's build accepts, we recognize:
-
-- ``CI_BUILD``. Set to ``1`` to emulate the CI environment build behaviour. Used only in CI builds to force certain build flags on in ``setup.py``. Do not use this unless you know what you are doing.
-- ``ENABLE_CONTRIB`` and ``ENABLE_HEADLESS``. Set to ``1`` to build the contrib and/or headless version
-- ``ENABLE_JAVA``, Set to ``1`` to enable the Java client build. This is disabled by default.
-- ``CMAKE_ARGS``. Additional arguments for OpenCV's CMake invocation. You can use this to make a custom build.
-
-See the next section for more info about manual builds outside the CI environment.
-
-### Manual builds
-
-If some dependency is not enabled in the pre-built wheels, you can also run the build locally to create a custom wheel.
-
-1. Clone this repository: `git clone --recursive https://github.com/opencv/opencv-python.git`
-2. ``cd opencv-python``
- - you can use `git` to checkout some other version of OpenCV in the `opencv` and `opencv_contrib` submodules if needed
-3. Add custom Cmake flags if needed, for example: `export CMAKE_ARGS="-DSOME_FLAG=ON -DSOME_OTHER_FLAG=OFF"` (in Windows you need to set environment variables differently depending on Command Line or PowerShell)
-4. Select the package flavor which you wish to build with `ENABLE_CONTRIB` and `ENABLE_HEADLESS`: i.e. `export ENABLE_CONTRIB=1` if you wish to build `opencv-contrib-python`
-5. Run ``pip wheel . --verbose``. NOTE: make sure you have the latest ``pip`` version, the ``pip wheel`` command replaces the old ``python setup.py bdist_wheel`` command which does not support ``pyproject.toml``.
- - this might take anything from 5 minutes to over 2 hours depending on your hardware
-6. Pip will print fresh wheel location at the end of build procedure. If you use old approach with `setup.py` file wheel package will be placed in `dist` folder. Package is ready and you can do with that whatever you wish.
- - Optional: on Linux use some of the `manylinux` images as a build hosts if maximum portability is needed and run `auditwheel` for the wheel after build
- - Optional: on macOS use ``delocate`` (same as ``auditwheel`` but for macOS) for better portability
-
-#### Manual debug builds
-
-In order to build `opencv-python` in an unoptimized debug build, you need to side-step the normal process a bit.
-
-1. Install the packages `scikit-build` and `numpy` via pip.
-2. Run the command `python setup.py bdist_wheel --build-type=Debug`.
-3. Install the generated wheel file in the `dist/` folder with `pip install dist/wheelname.whl`.
-
-If you would like the build produce all compiler commands, then the following combination of flags and environment variables has been tested to work on Linux:
-```
-export CMAKE_ARGS='-DCMAKE_VERBOSE_MAKEFILE=ON'
-export VERBOSE=1
-
-python3 setup.py bdist_wheel --build-type=Debug
-```
-
-See this issue for more discussion: https://github.com/opencv/opencv-python/issues/424
-
-#### Source distributions
-
-Since OpenCV version 4.3.0, also source distributions are provided in PyPI. This means that if your system is not compatible with any of the wheels in PyPI, ``pip`` will attempt to build OpenCV from sources. If you need a OpenCV version which is not available in PyPI as a source distribution, please follow the manual build guidance above instead of this one.
-
-You can also force ``pip`` to build the wheels from the source distribution. Some examples:
-
-- ``pip install --no-binary opencv-python opencv-python``
-- ``pip install --no-binary :all: opencv-python``
-
-If you need contrib modules or headless version, just change the package name (step 4 in the previous section is not needed). However, any additional CMake flags can be provided via environment variables as described in step 3 of the manual build section. If none are provided, OpenCV's CMake scripts will attempt to find and enable any suitable dependencies. Headless distributions have hard coded CMake flags which disable all possible GUI dependencies.
-
-On slow systems such as Raspberry Pi the full build may take several hours. On a 8-core Ryzen 7 3700X the build takes about 6 minutes.
-
### Licensing
-Opencv-python package (scripts in this repository) is available under MIT license.
+Opencv-python-cuda package (scripts in this repository) is available under MIT license.
OpenCV itself is available under [Apache 2](https://github.com/opencv/opencv/blob/master/LICENSE) license.
Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/opencv/opencv-python/blob/master/LICENSE-3RD-PARTY.txt).
-All wheels ship with [FFmpeg](http://ffmpeg.org) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html).
+All wheels are distributed with [FFmpeg](http://ffmpeg.org) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html), and redistributable portions of the NVIDIA® CUDA™ SDK under the [NVIDIA Software License Agreement (EULA)](https://docs.nvidia.com/cuda/eula/index.html).
Non-headless Linux wheels ship with [Qt 5](http://doc.qt.io/qt-5/lgpl.html) licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl-3.0.html).
The packages include also other binaries. Full list of licenses can be found from [LICENSE-3RD-PARTY.txt](https://github.com/opencv/opencv-python/blob/master/LICENSE-3RD-PARTY.txt).
-
-### Versioning
-
-``find_version.py`` script searches for the version information from OpenCV sources and appends also a revision number specific to this repository to the version string. It saves the version information to ``version.py`` file under ``cv2`` in addition to some other flags.
-
-### Releases
-
-A release is made and uploaded to PyPI when a new tag is pushed to master branch. These tags differentiate packages (this repo might have modifications but OpenCV version stays same) and should be incremented sequentially. In practice, release version numbers look like this:
-
-``cv_major.cv_minor.cv_revision.package_revision`` e.g. ``3.1.0.0``
-
-The master branch follows OpenCV master branch releases. 3.4 branch follows OpenCV 3.4 bugfix releases.
-
-### Development builds
-
-Every commit to the master branch of this repo will be built. Possible build artifacts use local version identifiers:
-
-``cv_major.cv_minor.cv_revision+git_hash_of_this_repo`` e.g. ``3.1.0+14a8d39``
-
-These artifacts can't be and will not be uploaded to PyPI.
-
-### Manylinux wheels
-
-Linux wheels are built using [manylinux2014](https://github.com/pypa/manylinux). These wheels should work out of the box for most of the distros (which use GNU C standard library) out there since they are built against an old version of glibc.
-
-The default ``manylinux2014`` images have been extended with some OpenCV dependencies. See [Docker folder](https://github.com/skvark/opencv-python/tree/master/docker) for more info.
-
-### Supported Python versions
-
-Python 3.x compatible pre-built wheels are provided for the officially supported Python versions (not in EOL):
-
-- 3.7
-- 3.8
-- 3.9
-- 3.10
-- 3.11
-- 3.12
-- 3.13
-
-### Backward compatibility
-
-Starting from 4.2.0 and 3.4.9 builds the macOS Travis build environment was updated to XCode 9.4. The change effectively dropped support for older than 10.13 macOS versions.
-
-Starting from 4.3.0 and 3.4.10 builds the Linux build environment was updated from `manylinux1` to `manylinux2014`. This dropped support for old Linux distributions.
-
-Starting from version 4.7.0 the Mac OS GitHub Actions build environment was update to version 11. Mac OS 10.x support deprecated. See https://github.com/actions/runner-images/issues/5583
-
-Starting from version 4.9.0 the Mac OS GitHub Actions build environment was update to version 12. Mac OS 10.x support deprecated by Brew and most of used packages.
diff --git a/docker/README.md b/docker/README.md
deleted file mode 100644
index 6e00e8f3..00000000
--- a/docker/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-### Customized manylinux images for opencv-python
-
-The subfolders include Dockerfiles for extending both ``i686`` and ``x86_64`` manylinux1 and manylinux2014 images.
-
-Manylinux2014 is used in wheels with version 3.4.10.* / 4.3.0.* and above.
-
-The extended images were created to be able to build OpenCV in reasonable time with Travis. The images are hosted at https://quay.io/user/skvark.
-
-See the dockerfiles for more info.
diff --git a/docker/manylinux1/Dockerfile_i686 b/docker/manylinux1/Dockerfile_i686
deleted file mode 100644
index cffc998c..00000000
--- a/docker/manylinux1/Dockerfile_i686
+++ /dev/null
@@ -1,111 +0,0 @@
-FROM quay.io/pypa/manylinux1_i686:latest
-
-RUN curl -O -L https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz && \
- tar -xf qt-everywhere-opensource-src-4.8.7.tar.gz && \
- cd qt-everywhere* && \
- #configure does a bootstrap make under the hood
- #manylinux1 is too old to have `nproc`
- export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \
- #OpenCV only links against QtCore, QtGui, QtTest
- ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license -make && \
- make && \
- make install && \
- cd .. && \
- rm -rf qt-everywhere-opensource-src-4.8.7 && \
- rm qt-everywhere-opensource-src-4.8.7.tar.gz
-
-ENV QTDIR /opt/Qt4.8.7
-ENV PATH "$QTDIR/bin:$PATH"
-
-RUN curl -O -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \
- tar -xf cmake-3.9.0.tar.gz && \
- cd cmake-3.9.0 && \
- #manylinux1 provides curl-devel equivalent and libcurl statically linked
- # against the same newer OpenSSL as other source-built tools
- # (1.0.2s as of this writing)
- yum -y install zlib-devel && \
- #configure does a bootstrap make under the hood
- export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \
- ./configure --system-curl && \
- make && \
- make install && \
- cd .. && \
- rm -rf cmake-3.9.0*
-
-# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#GettheDependencies
-# manylinux provides the toolchain and git; we provide cmake
-RUN yum install freetype-devel bzip2-devel zlib-devel -y && \
- mkdir ~/ffmpeg_sources
-
-# Newer openssl configure requires newer perl
-RUN curl -O -L https://www.cpan.org/src/5.0/perl-5.20.1.tar.gz && \
- tar -xf perl-5.20.1.tar.gz && \
- cd perl-5.20.1 && \
- ./Configure -des -Dprefix="$HOME/openssl_build" && \
- #perl build scripts do much redundant work
- # if running "make install" separately
- make install -j$(getconf _NPROCESSORS_ONLN) && \
- cd .. && \
- rm -rf perl-5.20.1*
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \
- tar -xf OpenSSL_1_1_1c.tar.gz && \
- cd openssl-OpenSSL_1_1_1c && \
- #in i686, ./config detects x64 in i686 container without linux32
- # when run from "docker build"
- PERL="$HOME/openssl_build/bin/perl" linux32 ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- #skip installing documentation
- make install_sw && \
- rm -rf ~/openssl_build
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \
- tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \
- ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \
- tar -xf yasm-1.3.0.tar.gz && \
- cd yasm-1.3.0 && \
- ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN cd ~/ffmpeg_sources && \
- git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
- cd libvpx && \
- ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
- tar -xf ffmpeg-snapshot.tar.bz2 && \
- cd ffmpeg && \
- PATH=~/bin:$PATH && \
- PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
- ldconfig && \
- rm -rf ~/ffmpeg_sources
-
-ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
-ENV LDFLAGS -L/root/ffmpeg_build/lib
-
-RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \
- curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \
- curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \
- curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \
- mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux
-
-#in i686, yum metadata ends up with slightly wrong timestamps
-#which inhibits its update
-#https://github.com/skvark/opencv-python/issues/148
-RUN yum clean all
-
-ENV PATH "$HOME/bin:$PATH"
diff --git a/docker/manylinux1/Dockerfile_x86_64 b/docker/manylinux1/Dockerfile_x86_64
deleted file mode 100644
index c4d47bc7..00000000
--- a/docker/manylinux1/Dockerfile_x86_64
+++ /dev/null
@@ -1,106 +0,0 @@
-FROM quay.io/pypa/manylinux1_x86_64:latest
-
-RUN curl -O -L https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz && \
- tar -xf qt-everywhere-opensource-src-4.8.7.tar.gz && \
- cd qt-everywhere* && \
- #configure does a bootstrap make under the hood
- #manylinux1 is too old to have `nproc`
- export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \
- #OpenCV only links against QtCore, QtGui, QtTest
- ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license \
- -no-sql-sqlite -no-qt3support -no-xmlpatterns -no-multimedia \
- -no-webkit -no-script -no-declarative -no-dbus -make libs && \
- make && \
- make install && \
- cd .. && \
- rm -rf qt-everywhere-opensource-src-4.8.7 && \
- rm qt-everywhere-opensource-src-4.8.7.tar.gz
-
-ENV QTDIR /opt/Qt4.8.7
-ENV PATH "$QTDIR/bin:$PATH"
-
-RUN curl -O -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \
- tar -xf cmake-3.9.0.tar.gz && \
- cd cmake-3.9.0 && \
- #manylinux1 provides curl-devel equivalent and libcurl statically linked
- # against the same newer OpenSSL as other source-built tools
- # (1.0.2s as of this writing)
- yum -y install zlib-devel && \
- #configure does a bootstrap make under the hood
- export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \
- ./configure --system-curl && \
- make && \
- make install && \
- cd .. && \
- rm -rf cmake-3.9.0*
-
-# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#GettheDependencies
-# manylinux provides the toolchain and git; we provide cmake
-RUN yum install freetype-devel bzip2-devel zlib-devel -y && \
- mkdir ~/ffmpeg_sources
-
-# Newer openssl configure requires newer perl
-RUN curl -O -L https://www.cpan.org/src/5.0/perl-5.20.1.tar.gz && \
- tar -xf perl-5.20.1.tar.gz && \
- cd perl-5.20.1 && \
- ./Configure -des -Dprefix="$HOME/openssl_build" && \
- #perl build scripts do much redundant work
- # if running "make install" separately
- make install -j$(getconf _NPROCESSORS_ONLN) && \
- cd .. && \
- rm -rf perl-5.20.1*
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \
- tar -xf OpenSSL_1_1_1c.tar.gz && \
- cd openssl-OpenSSL_1_1_1c && \
- PERL="$HOME/openssl_build/bin/perl" ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- #skip installing documentation
- make install_sw && \
- rm -rf ~/openssl_build
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \
- tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \
- ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \
- tar -xf yasm-1.3.0.tar.gz && \
- cd yasm-1.3.0 && \
- ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN cd ~/ffmpeg_sources && \
- git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
- cd libvpx && \
- ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
- tar -xf ffmpeg-snapshot.tar.bz2 && \
- cd ffmpeg && \
- PATH=~/bin:$PATH && \
- PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
- ldconfig && \
- rm -rf ~/ffmpeg_sources
-
-ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
-ENV LDFLAGS -L/root/ffmpeg_build/lib
-
-RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \
- curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \
- curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \
- curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \
- mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux
-
-ENV PATH "$HOME/bin:$PATH"
diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64
deleted file mode 100644
index 98cd3125..00000000
--- a/docker/manylinux2014/Dockerfile_aarch64
+++ /dev/null
@@ -1,163 +0,0 @@
-# Version: 20250630
-# Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64
-
-FROM quay.io/pypa/manylinux2014_aarch64:latest
-
-ARG CCACHE_VERSION=3.7.9
-ARG FFMPEG_VERSION=5.1.6
-ARG FREETYPE_VERSION=2.13.3
-ARG LIBPNG_VERSION=1.6.48
-ARG VPX_VERSION=v1.15.1
-ARG NASM_VERSION=2.15.04
-ARG OPENSSL_VERSION=1_1_1w
-ARG QT_VERSION=5.15.16
-ARG YASM_VERSION=1.3.0
-ARG AOM_VERSION=v3.12.1
-ARG AVIF_VERSION=v1.3.0
-
-ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
-
-# epel-release need for aarch64 to get openblas packages
-RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \
- yum install openblas-devel dejavu-sans-fonts -y && \
- cp /usr/include/lapacke/lapacke*.h /usr/include/ && \
- cp /usr/include/openblas/*.h /usr/include/ && \
- # libpng will be built from source
- yum remove libpng -y
-
-RUN mkdir ~/libpng_sources && \
- cd ~/libpng_sources && \
- curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \
- tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \
- cd libpng-${LIBPNG_VERSION} && \
- ./configure --prefix=/usr/local && \
- make && \
- make install && \
- cd .. && \
- rm -rf ~/libpng_sources
-
-# looks like download.savannah.gnu.org suffers from https://savannah.gnu.org/bugs/?48150 in Manylinux 2014 env on aarch64
-RUN mkdir ~/freetype_sources && \
- cd ~/freetype_sources && \
- curl -O -L https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
- tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \
- cd freetype-${FREETYPE_VERSION} && \
- ./configure --prefix="/ffmpeg_build" --enable-freetype-config && \
- make && \
- make install && \
- cd .. && \
- rm -rf ~/freetype_sources
-
-RUN curl -C - -O -L https://download.qt.io/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
- tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
- cd qt-everywhere-src-${QT_VERSION} && \
- export MAKEFLAGS=-j$(nproc) && \
- ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \
- make && \
- make install && \
- cd .. && \
- rm -rf qt-everywhere*
-
-ENV QTDIR /opt/Qt${QT_VERSION}
-ENV PATH "$QTDIR/bin:$PATH"
-
-RUN mkdir ~/openssl_sources && \
- cd ~/openssl_sources && \
- curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \
- tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \
- cd openssl-OpenSSL_${OPENSSL_VERSION} && \
- ./config --prefix="/ffmpeg_build" --openssldir="/ffmpeg_build" no-pinshared shared zlib && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- # skip installing documentation
- make install_sw && \
- cd .. && \
- rm -rf ~/openssl_build ~/openssl_sources
-
-RUN mkdir ~/nasm_sources && \
- cd ~/nasm_sources && \
- curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz && \
- tar -xf nasm-${NASM_VERSION}.tar.gz && cd nasm-${NASM_VERSION} && ./autogen.sh && \
- ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd .. && \
- rm -rf ~/nasm_sources
-
-RUN mkdir ~/yasm_sources && \
- cd ~/yasm_sources && \
- curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \
- tar -xf yasm-${YASM_VERSION}.tar.gz && \
- cd yasm-${YASM_VERSION} && \
- ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd .. && \
- rm -rf ~/yasm_sources
-
-RUN mkdir ~/libvpx_sources && \
- cd ~/libvpx_sources && \
- git clone --depth 1 -b ${VPX_VERSION} https://github.com/webmproject/libvpx.git && \
- cd libvpx && \
- ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd .. && \
- rm -rf ~/libvpx_sources
-
-RUN mkdir ~/aom_sources && \
- cd ~/aom_sources && \
- git clone --depth 1 -b ${AOM_VERSION} https://aomedia.googlesource.com/aom && \
- mkdir build && cd build && \
- cmake -DCMAKE_C_COMPILER=$(dirname $(which g++))/gcc -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF ../aom/ && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd / && rm -rf ~/aom_sources
-
-RUN mkdir ~/avif_sources && \
- cd ~/avif_sources && \
- git clone -b ${AVIF_VERSION} https://github.com/AOMediaCodec/libavif.git && \
- mkdir build && cd build && \
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DAVIF_CODEC_AOM=SYSTEM -DAVIF_LIBYUV=LOCAL -DAVIF_BUILD_APPS=OFF ../libavif && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd / && rm -rf ~/avif_sources
-
-RUN mkdir ~/ffmpeg_sources && \
- cd ~/ffmpeg_sources && \
- curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
- tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \
- cd ffmpeg-${FFMPEG_VERSION} && \
- PATH=~/bin:$PATH && \
- PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
- ldconfig && \
- rm -rf ~/ffmpeg_sources
-
-RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \
- tar -xf ccache-${CCACHE_VERSION}.tar.gz && \
- cd ccache-${CCACHE_VERSION} && \
- linux32 ./configure && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd .. && \
- rm -rf ccache-${CCACHE_VERSION}.tar.gz
-
-# Self-hosted runner UID is 1004
-RUN useradd ci -m -s /bin/bash -G users --uid=1004 && \
- mkdir /io && \
- chown -R ci:ci /io && \
- # This needs to find ffmpeg packages from ci user
- chown -R ci:ci /ffmpeg_build && \
- # This calls in mutlibuild scripts and cannot be run without permissions
- chown -R ci:ci /opt/_internal/pipx/venvs/auditwheel
-
-USER ci
-
-# Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced
-RUN git config --global --add safe.directory /io
-
-ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig
-ENV LDFLAGS -L/ffmpeg_build/lib
-ENV PATH "$HOME/bin:$PATH"
diff --git a/docker/manylinux2014/Dockerfile_i686 b/docker/manylinux2014/Dockerfile_i686
deleted file mode 100644
index 1c94b1fc..00000000
--- a/docker/manylinux2014/Dockerfile_i686
+++ /dev/null
@@ -1,99 +0,0 @@
-FROM quay.io/pypa/manylinux2014_i686:latest
-
-ARG CCACHE_VERSION=3.7.9
-ARG CMAKE_VERSION=3.17.0
-ARG FFMPEG_VERSION=5.1.4
-ARG NASM_VERSION=2.15.04
-ARG OPENSSL_VERSION=1_1_1w
-ARG QT_VERSION=5.15.0
-ARG YASM_VERSION=1.3.0
-
-RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y
-
-RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \
- tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \
- cd qt-everywhere* && \
- export MAKEFLAGS=-j$(nproc) && \
- ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \
- make && \
- make install && \
- cd .. && \
- rm -rf qt-everywhere-src-${QT_VERSION} && \
- rm qt-everywhere-src-${QT_VERSION}.tar.xz
-
-ENV QTDIR /opt/Qt${QT_VERSION}
-ENV PATH "$QTDIR/bin:$PATH"
-
-RUN mkdir ~/ffmpeg_sources && \
- cd ~/ffmpeg_sources && \
- curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \
- tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \
- cd openssl-OpenSSL_${OPENSSL_VERSION} && \
- # in i686, ./config detects x64 in i686 container without linux32
- # when run from "docker build"
- linux32 ./config --prefix="$HOME/ffmpeg_build" no-pinshared shared zlib && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- #skip installing documentation
- make install_sw && \
- rm -rf ~/openssl_build
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \
- tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \
- linux32 ./configure && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \
- tar -xf yasm-${YASM_VERSION}.tar.gz && \
- cd yasm-${YASM_VERSION} && \
- linux32 ./configure && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN cd ~/ffmpeg_sources && \
- git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
- cd libvpx && \
- linux32 ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN cd ~/ffmpeg_sources && \
- curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
- tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
- cd ffmpeg-${FFMPEG_VERSION} && \
- PATH=~/bin:$PATH && \
- PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" linux32 ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
- ldconfig && \
- rm -rf ~/ffmpeg_sources
-
-RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \
- tar -xf ccache-${CCACHE_VERSION}.tar.gz && \
- cd ccache-${CCACHE_VERSION} && \
- linux32 ./configure && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install
-
-RUN curl -O -L https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz && \
- tar -xf cmake-${CMAKE_VERSION}.tar.gz && \
- cd cmake-${CMAKE_VERSION} && \
- export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \
- ./configure --system-curl && \
- make && \
- make install && \
- cd .. && \
- rm -rf cmake-${CMAKE_VERSION}*
-
-ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
-ENV LDFLAGS -L/root/ffmpeg_build/lib
-
-# in i686, yum metadata ends up with slightly wrong timestamps
-# which inhibits its update
-# https://github.com/skvark/opencv-python/issues/148
-RUN yum clean all
-
-ENV PATH "$HOME/bin:$PATH"
diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64
deleted file mode 100644
index 3ed3aa49..00000000
--- a/docker/manylinux2014/Dockerfile_x86_64
+++ /dev/null
@@ -1,162 +0,0 @@
-# Version: 20250630
-# Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64
-
-FROM quay.io/pypa/manylinux2014_x86_64:latest
-
-ARG CCACHE_VERSION=3.7.9
-ARG FFMPEG_VERSION=5.1.6
-ARG FREETYPE_VERSION=2.13.3
-ARG LIBPNG_VERSION=1.6.48
-ARG VPX_VERSION=v1.15.1
-ARG NASM_VERSION=2.15.04
-ARG OPENSSL_VERSION=1_1_1w
-ARG QT_VERSION=5.15.16
-ARG YASM_VERSION=1.3.0
-ARG AOM_VERSION=v3.12.1
-ARG AVIF_VERSION=v1.3.0
-
-ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
-
-# epel-release need for aarch64 to get openblas packages
-RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \
- yum install openblas-devel dejavu-sans-fonts -y && \
- cp /usr/include/openblas/*.h /usr/include/ && \
- cp /usr/include/lapacke/lapacke*.h /usr/include/ && \
- # libpng will be built from source
- yum remove libpng -y
-
-RUN mkdir ~/libpng_sources && \
- cd ~/libpng_sources && \
- curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \
- tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \
- cd libpng-${LIBPNG_VERSION} && \
- ./configure --prefix=/usr/local && \
- make && \
- make install && \
- cd .. && \
- rm -rf ~/libpng_sources
-
-RUN mkdir ~/freetype_sources && \
- cd ~/freetype_sources && \
- curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
- tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \
- cd freetype-${FREETYPE_VERSION} && \
- ./configure --prefix="/ffmpeg_build" --enable-freetype-config && \
- make && \
- make install && \
- cd .. && \
- rm -rf ~/freetype_sources
-
-RUN curl -O -L https://download.qt.io/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
- tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
- cd qt-everywhere-src-${QT_VERSION} && \
- export MAKEFLAGS=-j$(nproc) && \
- ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \
- make && \
- make install && \
- cd .. && \
- rm -rf qt-everywhere*
-
-ENV QTDIR /opt/Qt${QT_VERSION}
-ENV PATH "$QTDIR/bin:$PATH"
-
-RUN mkdir ~/openssl_sources && \
- cd ~/openssl_sources && \
- curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \
- tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \
- cd openssl-OpenSSL_${OPENSSL_VERSION} && \
- ./config --prefix="/ffmpeg_build" --openssldir="/ffmpeg_build" no-pinshared shared zlib && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- # skip installing documentation
- make install_sw && \
- cd .. && \
- rm -rf ~/openssl_build ~/openssl_sources
-
-RUN mkdir ~/nasm_sources && \
- cd ~/nasm_sources && \
- curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz && \
- tar -xf nasm-${NASM_VERSION}.tar.gz && cd nasm-${NASM_VERSION} && ./autogen.sh && \
- ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd .. && \
- rm -rf ~/nasm_sources
-
-RUN mkdir ~/yasm_sources && \
- cd ~/yasm_sources && \
- curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \
- tar -xf yasm-${YASM_VERSION}.tar.gz && \
- cd yasm-${YASM_VERSION} && \
- ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd .. && \
- rm -rf ~/yasm_sources
-
-RUN mkdir ~/libvpx_sources && \
- cd ~/libvpx_sources && \
- git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \
- cd libvpx && \
- ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd .. && \
- rm -rf ~/libvpx_sources
-
-RUN mkdir ~/aom_sources && \
- cd ~/aom_sources && \
- git clone --depth 1 -b ${AOM_VERSION} https://aomedia.googlesource.com/aom && \
- mkdir build && cd build && \
- cmake -DCMAKE_C_COMPILER=$(dirname $(which g++))/gcc -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF ../aom/ && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd / && rm -rf ~/aom_sources
-
-RUN mkdir ~/avif_sources && \
- cd ~/avif_sources && \
- git clone -b ${AVIF_VERSION} https://github.com/AOMediaCodec/libavif.git && \
- mkdir build && cd build && \
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DAVIF_CODEC_AOM=SYSTEM -DAVIF_LIBYUV=LOCAL -DAVIF_BUILD_APPS=OFF ../libavif && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd / && rm -rf ~/avif_sources
-
-RUN mkdir ~/ffmpeg_sources && \
- cd ~/ffmpeg_sources && \
- curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
- tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \
- cd ffmpeg-${FFMPEG_VERSION} && \
- PATH=~/bin:$PATH && \
- PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
- ldconfig && \
- rm -rf ~/ffmpeg_sources
-
-RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \
- tar -xf ccache-${CCACHE_VERSION}.tar.gz && \
- cd ccache-${CCACHE_VERSION} && \
- ./configure && \
- make -j$(getconf _NPROCESSORS_ONLN) && \
- make install && \
- cd .. && \
- rm -rf ccache-${CCACHE_VERSION}.tar.gz
-
-# GitHub Actions user`s UID is 1001
-RUN useradd ci -m -s /bin/bash -G users --uid=1001 && \
- mkdir /io && \
- chown -R ci:ci /io && \
- # This needs to find ffmpeg packages from ci user
- chown -R ci:ci /ffmpeg_build && \
- # This calls in mutlibuild scripts and cannot be run without permissions
- chown -R ci:ci /opt/_internal/pipx/venvs/auditwheel
-
-USER ci
-
-# Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced
-RUN git config --global --add safe.directory /io
-
-ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig
-ENV LDFLAGS -L/ffmpeg_build/lib
-ENV PATH "$HOME/bin:$PATH"
diff --git a/docs/cuda-compatibility.html b/docs/cuda-compatibility.html
new file mode 100644
index 00000000..9bb9da30
--- /dev/null
+++ b/docs/cuda-compatibility.html
@@ -0,0 +1,176 @@
+
+
+
PTX (Parallel Thread Execution): Intermediate code, JIT-compiled at runtime
+
+
+ PTX is forward-compatible only (e.g. PTX 10.0 works on GPUs ≥10.0, not older).
+ SASS is required for older GPUs that are lower than the PTX version.
+ A GPU needs either matching SASS or older PTX which it can JIT compile.
+
By downloading and using the software, you agree to fully comply with the terms and conditions of the CUDA EULA.
+
+
+
+
+
About opencv-python-cuda
+
+ This project provides pre-built NVIDIA® CUDA™ enabled OpenCV packages for Python that come with all batteries included.
+ It is a fork of the official opencv-python project.
+ Currently, packages are only produced for Windows x64, and devices must be Maxwell class (GeForce 900 series) or newer.
+
+
+ The wheel is fully standalone — no CUDA Toolkit, cuDNN, or any other NVIDIA software needs to be installed on your system.
+ All required runtime libraries are bundled directly in the package. Just install the .whl file and you're ready to go.
+
+
+ Once installed via pip (or another Python package manager like uv), the following should just work:
+
The upstream opencv/opencv-python repo has numeric tags (0, 1, 2, ... 90) that will pollute your local repo during fetches. To prevent this, configure the remote to exclude tags:
gh workflow run build_wheels_windows.yml --ref 4.x-cuda -R Breakthrough/opencv-python-cuda
+
Important: Always specify -R Breakthrough/opencv-python-cuda when using gh commands. This repo is a fork of opencv/opencv-python, and gh will default to the parent repository without the explicit -R flag.
gh run list -R Breakthrough/opencv-python-cuda --limit 5
+
Watch a running build:
+
gh run watch <run-id> -R Breakthrough/opencv-python-cuda
+
View build details:
+
gh run view <run-id> -R Breakthrough/opencv-python-cuda
+
+
+
+
Wheel Compression
+
+ The build workflow repacks the output wheel using LZMA (ZIP_LZMA) compression instead of the default DEFLATE.
+ This reduces the wheel size by ~35%, which is necessary to stay under the 2 GiB GitHub release file size limit.
+
+
+ While the wheel spec (PEP 427) defines wheels as ZIP archives,
+ it does not specify which ZIP compression methods are permitted. In practice, LZMA works because both pip and uv delegate
+ decompression to their respective ZIP libraries (Python's zipfile module and Rust's zip crate),
+ both of which support LZMA natively.
+
+
+
+
+
Reference: Git Config for Remotes
+
After setup, your .git/config remote sections should look like:
+
+
+
+
+
+
diff --git a/find_version.py b/find_version.py
deleted file mode 100644
index 13e8003c..00000000
--- a/find_version.py
+++ /dev/null
@@ -1,75 +0,0 @@
-import sys
-import subprocess
-from datetime import date
-
-if __name__ == "__main__":
- contrib = sys.argv[1]
- headless = sys.argv[2]
- rolling = sys.argv[3]
- ci_build = sys.argv[4]
-
- opencv_version = ""
- # dig out the version from OpenCV sources
- version_file_path = "opencv/modules/core/include/opencv2/core/version.hpp"
-
- with open(version_file_path, "r") as f:
- for line in f:
- words = line.split()
-
- if "CV_VERSION_MAJOR" in words:
- opencv_version += words[2]
- opencv_version += "."
-
- if "CV_VERSION_MINOR" in words:
- opencv_version += words[2]
- opencv_version += "."
-
- if "CV_VERSION_REVISION" in words:
- opencv_version += words[2]
- break
-
- # used in local dev releases
- git_hash = (
- subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])
- .splitlines()[0]
- .decode()
- )
- # this outputs the annotated tag if we are exactly on a tag, otherwise --g
- try:
- tag = (
- subprocess.check_output(
- ["git", "describe", "--tags"], stderr=subprocess.STDOUT
- )
- .splitlines()[0]
- .decode()
- .split("-")
- )
- except subprocess.CalledProcessError as e:
- # no tags reachable (e.g. on a topic branch in a fork), see
- # https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything
- if e.output.rstrip() == b"fatal: No names found, cannot describe anything.":
- tag = []
- else:
- print(e.output)
- raise
-
- if len(tag) == 1:
- # tag identifies the build and should be a sequential revision number
- version = tag[0]
- opencv_version += ".{}".format(version)
- # rolling has converted into string using get_and_set_info() function in setup.py
- elif rolling == "True":
- # rolling version identifier, will be published in a dedicated rolling PyPI repository
- version = date.today().strftime('%Y%m%d')
- opencv_version += ".{}".format(version)
- else:
- # local version identifier, not to be published on PyPI
- version = git_hash
- opencv_version += "+{}".format(version)
-
- with open("cv2/version.py", "w") as f:
- f.write('opencv_version = "{}"\n'.format(opencv_version))
- f.write("contrib = {}\n".format(contrib))
- f.write("headless = {}\n".format(headless))
- f.write("rolling = {}\n".format(rolling))
- f.write("ci_build = {}".format(ci_build))
diff --git a/patch_auditwheel_whitelist.py b/patch_auditwheel_whitelist.py
deleted file mode 100644
index b396ab55..00000000
--- a/patch_auditwheel_whitelist.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from os.path import join, dirname, abspath
-import json
-
-from auditwheel import policy
-
-def add_whitelisted_libs():
- policies = None
-
- with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json")) as f:
- policies = json.load(f)
-
- for p in policies:
- p["lib_whitelist"].append("libxcb.so.1")
-
- with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f:
- f.write(json.dumps(policies))
-
-if __name__ == '__main__':
- add_whitelisted_libs()
diff --git a/scripts/__init__.py b/scripts/__init__.py
index 587a42bf..96121dd4 100644
--- a/scripts/__init__.py
+++ b/scripts/__init__.py
@@ -1,24 +1,3 @@
PYTHON_EXTENSIONS_PATHS = [
LOADER_DIR
] + PYTHON_EXTENSIONS_PATHS
-
-ci_and_not_headless = False
-
-try:
- from .version import ci_build, headless
-
- ci_and_not_headless = ci_build and not headless
-except:
- pass
-
-# the Qt plugin is included currently only in the pre-built wheels
-if sys.platform.startswith("linux") and ci_and_not_headless:
- os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), "qt", "plugins"
- )
-
-# Qt will throw warning on Linux if fonts are not found
-if sys.platform.startswith("linux") and ci_and_not_headless:
- os.environ["QT_QPA_FONTDIR"] = os.path.join(
- os.path.dirname(os.path.abspath(__file__)), "qt", "fonts"
- )
diff --git a/scripts/build.sh b/scripts/build.sh
deleted file mode 100755
index e5c83d83..00000000
--- a/scripts/build.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-set -e
-# Check out and prepare the source
-# Multibuild doesn't have releases, so --depth would break eventually (see
-# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
-git submodule update --init multibuild
-source multibuild/common_utils.sh
-# https://github.com/matthew-brett/multibuild/issues/116
-if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
-source multibuild/travis_steps.sh
-# This sets -x
-# source travis_multibuild_customize.sh
-echo $ENABLE_CONTRIB > contrib.enabled
-echo $ENABLE_HEADLESS > headless.enabled
-echo $ENABLE_ROLLING > rolling.enabled
-set -x
-build_wheel $REPO_DIR $PLAT
diff --git a/scripts/install.sh b/scripts/install.sh
deleted file mode 100755
index f20080ae..00000000
--- a/scripts/install.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-set -e
-# Check out and prepare the source
-# Multibuild doesn't have releases, so --depth would break eventually (see
-# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
-git submodule update --init --recursive
-source multibuild/common_utils.sh
-# https://github.com/matthew-brett/multibuild/issues/116
-if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
-source multibuild/travis_steps.sh
-# This sets -x
-# source travis_multibuild_customize.sh
-echo $ENABLE_CONTRIB > contrib.enabled
-echo $ENABLE_HEADLESS > headless.enabled
-echo $ENABLE_ROLLING > rolling.enabled
-set -x
-install_run $PLAT
-set +x
diff --git a/setup.py b/setup.py
index 7c470824..42c1cb4c 100755
--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,9 @@
+from datetime import date
+import glob
import io
import os
import os.path
import sys
-import runpy
import subprocess
import re
import sysconfig
@@ -16,12 +17,20 @@ def main():
CI_BUILD = os.environ.get("CI_BUILD", "False")
is_CI_build = True if CI_BUILD == "1" else False
cmake_source_dir = "opencv"
- minimum_supported_numpy = "1.13.3"
build_contrib = get_build_env_var_by_name("contrib")
build_headless = get_build_env_var_by_name("headless")
build_java = "ON" if get_build_env_var_by_name("java") else "OFF"
build_rolling = get_build_env_var_by_name("rolling")
+ # CUDA architecture configuration - can be overridden via environment variables
+ # CUDA 12.x supports: 5.0+ (Maxwell through Hopper)
+ # CUDA 13.x supports: 7.5+ (Turing through Hopper)
+ # Reference architectures:
+ # maxwell=5.0;5.2, pascal=6.0;6.1, volta=7.0, turing=7.5,
+ # ampere=8.0;8.6, lovelace=8.9, hopper=9.0
+ cuda_arch_bin = os.environ.get("CUDA_ARCH_BIN", "7.5;8.0;8.6;8.9;9.0")
+ cuda_arch_ptx = os.environ.get("CUDA_ARCH_PTX", "9.0")
+
# NOTE: since 2.3.0 numpy upgraded from manylinux2014 to manylinux_2_28
# see https://numpy.org/doc/stable/release/2.3.0-notes.html#numpy-2-3-0-release-notes
install_requires = [
@@ -68,28 +77,16 @@ def main():
["submodule", "update", "--init", "--recursive", "opencv_contrib"]
)
- package_version, build_contrib, build_headless, build_rolling = get_and_set_info(
- build_contrib, build_headless, build_rolling, is_CI_build
+ package_version, build_contrib, build_headless, build_rolling = generate_version_file(
+ build_contrib, build_headless, build_rolling, cuda_arch_bin, cuda_arch_ptx
)
+ print(f"package_version={package_version} build_contrib={build_contrib}, build_headless={build_headless}, build_rolling={build_rolling}, cuda_arch_bin={cuda_arch_bin}, cuda_arch_ptx={cuda_arch_ptx}")
+
# https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode
is64 = sys.maxsize > 2 ** 32
- package_name = "opencv-python"
-
- if build_contrib and not build_headless:
- package_name = "opencv-contrib-python"
-
- if build_contrib and build_headless:
- package_name = "opencv-contrib-python-headless"
-
- if build_headless and not build_contrib:
- package_name = "opencv-python-headless"
-
- if build_rolling:
- package_name += "-rolling"
-
- package_name = os.environ.get('OPENCV_PYTHON_PACKAGE_NAME', package_name)
+ package_name = "opencv-python-cuda"
long_description = io.open("README.md", encoding="utf-8").read()
@@ -154,26 +151,34 @@ def main():
# Files in sourcetree outside package dir that should be copied to package.
# Raw paths relative to sourcetree root.
- files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]}
+ files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt","*.dll"]}
ci_cmake_generator = (
- ["-G", "Visual Studio 17 2022"]
+ ["-G", "Visual Studio 17 2022", "-T", "v143"]
if os.name == "nt"
else ["-G", "Unix Makefiles"]
)
+ cudnn_library = os.environ["CUDNN_LIBRARY"]
+ cudnn_include_dir = os.environ["CUDNN_INCLUDE_DIR"]
+
+ # Video Codec SDK paths for NVCUVID/NVCUVENC (optional, enables hardware video decode/encode)
+ nvcuvid_library = os.environ.get("CUDA_nvcuvid_LIBRARY", "")
+ nvencodeapi_library = os.environ.get("CUDA_nvencodeapi_LIBRARY", "")
+ nvcuvid_include_dir = os.environ.get("NVCUVID_INCLUDE_DIR", "")
+
cmake_args = (
(ci_cmake_generator if is_CI_build else [])
+ [
# skbuild inserts PYTHON_* vars. That doesn't satisfy opencv build scripts in case of Py3
- "-DPYTHON3_EXECUTABLE=%s" % sys.executable,
- "-DPYTHON_DEFAULT_EXECUTABLE=%s" % sys.executable,
- "-DPYTHON3_INCLUDE_DIR=%s" % python_include_dir,
- "-DPYTHON3_LIBRARY=%s" % python_lib_path,
+ f"-DPYTHON3_EXECUTABLE={sys.executable}",
+ f"-DPYTHON_DEFAULT_EXECUTABLE={sys.executable}",
+ f"-DPYTHON3_INCLUDE_DIR={python_include_dir}",
+ f"-DPYTHON3_LIBRARY={python_lib_path}",
"-DBUILD_opencv_python3=ON",
"-DBUILD_opencv_python2=OFF",
# Disable the Java build by default as it is not needed
- "-DBUILD_opencv_java=%s" % build_java,
+ f"-DBUILD_opencv_java={build_java}",
# Relative dir to install the built module to in the build tree.
# The default is generated from sysconfig, we'd rather have a constant for simplicity
"-DOPENCV_PYTHON3_INSTALL_PATH=python",
@@ -187,9 +192,35 @@ def main():
"-DBUILD_TESTS=OFF",
"-DBUILD_PERF_TESTS=OFF",
"-DBUILD_DOCS=OFF",
+ "-DOPENCV_ENABLE_NONFREE=OFF",
"-DPYTHON3_LIMITED_API=ON",
"-DBUILD_OPENEXR=ON",
+ "-DWITH_CUDA=ON",
+ "-DWITH_NVCUVID=ON",
+ "-DWITH_NVCUVENC=ON",
+ f"-DCUDA_ARCH_BIN={cuda_arch_bin}",
+ f"-DCUDA_ARCH_PTX={cuda_arch_ptx}",
+ f"-DCUDNN_LIBRARY={cudnn_library}",
+ f"-DCUDNN_INCLUDE_DIR={cudnn_include_dir}",
]
+ + (
+ # Video Codec SDK paths for hardware video decode/encode support
+ [
+ f"-DCUDA_nvcuvid_LIBRARY={nvcuvid_library}",
+ f"-DCUDA_nvencodeapi_LIBRARY={nvencodeapi_library}",
+ f"-DCMAKE_INCLUDE_PATH={nvcuvid_include_dir}",
+ ]
+ if nvcuvid_library and nvcuvid_include_dir
+ else []
+ )
+ + (
+ # CUDA 12.9+ requires MSVC's conformant preprocessor for CCCL headers.
+ # -Xcompiler passes the flag from nvcc to the host compiler (MSVC).
+ # See: https://github.com/NVIDIA/cccl/issues/5166
+ ["-DCUDA_NVCC_FLAGS=-Xcompiler /Zc:preprocessor"]
+ if sys.platform == "win32"
+ else []
+ )
+ (
# CMake flags for windows/arm64 build
["-DCMAKE_GENERATOR_PLATFORM=ARM64",
@@ -266,17 +297,17 @@ def main():
setup(
name=package_name,
version=package_version,
- url="https://github.com/opencv/opencv-python",
+ url="https://github.com/Breakthrough/opencv-python-cuda",
license="Apache 2.0",
- description="Wrapper package for OpenCV python bindings.",
+ description="[Unofficial] OpenCV Python bindings with CUDA support.",
long_description=long_description,
long_description_content_type="text/markdown",
packages=packages,
package_data=package_data,
- maintainer="OpenCV Team",
+ maintainer="Breakthrough",
ext_modules=EmptyListWithLength(),
install_requires=install_requires,
- python_requires=">=3.6",
+ python_requires=">=3.7",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
@@ -292,7 +323,6 @@ def main():
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
- "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
@@ -310,8 +340,6 @@ def main():
cmake_source_dir=cmake_source_dir,
)
- print("OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. Donate to OpenCV on GitHub:\nhttps://github.com/sponsors/opencv\n")
-
class RearrangeCMakeOutput:
"""
Patch SKBuild logic to only take files related to the Python package
@@ -456,7 +484,10 @@ def _classify_installed_files_override(
for package_name, paths in cls.files_outside_package.items():
package_dest_reldir = package_name.replace(".", os.path.sep)
+ expanded_paths = []
for path in paths:
+ expanded_paths += [path] if '*' not in path else glob.glob(path)
+ for path in expanded_paths:
new_install_relpath = os.path.join(
package_dest_reldir,
# Don't yet have a need to copy
@@ -489,24 +520,84 @@ def _classify_installed_files_override(
)
-def get_and_set_info(contrib, headless, rolling, ci_build):
- # cv2/version.py should be generated by running find_version.py
+def generate_version_file(contrib, headless, rolling, cuda_arch_bin, cuda_arch_ptx):
+
version = {}
- here = os.path.abspath(os.path.dirname(__file__))
- version_file = os.path.join(here, "cv2", "version.py")
- # generate a fresh version.py always when Git repository exists
- # (in sdists the version.py file already exists)
- if os.path.exists(".git"):
- old_args = sys.argv.copy()
- sys.argv = ["", str(contrib), str(headless), str(rolling), str(ci_build)]
- runpy.run_path("find_version.py", run_name="__main__")
- sys.argv = old_args
+ # generate version.py
+ opencv_version = ""
+ # dig out the version from OpenCV sources
+ version_file_path = "opencv/modules/core/include/opencv2/core/version.hpp"
+
+ with open(version_file_path, "r") as f:
+ for line in f:
+ words = line.split()
+
+ if "CV_VERSION_MAJOR" in words:
+ opencv_version += words[2]
+ opencv_version += "."
- with open(version_file) as fp:
- exec(fp.read(), version)
+ if "CV_VERSION_MINOR" in words:
+ opencv_version += words[2]
+ opencv_version += "."
- return version["opencv_version"], version["contrib"], version["headless"], version["rolling"]
+ if "CV_VERSION_REVISION" in words:
+ opencv_version += words[2]
+ break
+
+ # used in local dev releases
+ git_hash = (
+ subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])
+ .splitlines()[0]
+ .decode()
+ )
+ # this outputs the annotated tag if we are exactly on a tag, otherwise --g
+ try:
+ tag = (
+ subprocess.check_output(
+ ["git", "describe", "--tags"], stderr=subprocess.STDOUT
+ )
+ .splitlines()[0]
+ .decode()
+ .split("-")
+ )
+ except subprocess.CalledProcessError as e:
+ # no tags reachable (e.g. on a topic branch in a fork), see
+ # https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything
+ if e.output.rstrip() == b"fatal: No names found, cannot describe anything.":
+ tag = []
+ else:
+ print(e.output)
+ raise
+
+
+ # TODO(@Breakthrough): Update this so that we just use the tag name directly as the version
+ # identifier. We might need to strip off a "v" suffix if we include that in the repo, but it
+ # will greatly simplify things. This can also get out of sync since we cache artifacts now.
+
+ if len(tag) == 1:
+ # tag identifies the build and should be a sequential revision number
+ version = tag[0]
+ opencv_version += ".{}".format(version)
+ # rolling has converted into string using generate_version_file() function in setup.py
+ elif rolling == "True":
+ # rolling version identifier, will be published in a dedicated rolling PyPI repository
+ version = date.today().strftime('%Y%m%d')
+ opencv_version += ".{}".format(version)
+ else:
+ # local version identifier, not to be published on PyPI
+ version = git_hash
+ opencv_version += "+{}".format(version)
+
+ with open("cv2/version.py", "w") as f:
+ f.write('opencv_version = "{}"\n'.format(opencv_version))
+ f.write("contrib = {}\n".format(contrib))
+ f.write("headless = {}\n".format(headless))
+ f.write("rolling = {}\n".format(rolling))
+ f.write("cuda_arch_bin = {}".format(cuda_arch_bin))
+ f.write("cuda_arch_ptx = {}".format(cuda_arch_ptx))
+
+ return opencv_version, contrib, headless, rolling
def get_build_env_var_by_name(flag_name):
diff --git a/tests/pylintrc b/tests/pylintrc
deleted file mode 100644
index a3892018..00000000
--- a/tests/pylintrc
+++ /dev/null
@@ -1,12 +0,0 @@
-# Source: opencv/platforms/scripts/pylintrc
-
-[MESSAGES CONTROL]
-
-# Disable all to choose the Tests one by one
-disable=all
-
-# Tests
-enable=bad-indentation, # Used when an unexpected number of indentation’s tabulations or spaces has been found.
- mixed-indentation, # Used when there are some mixed tabs and spaces in a module.
- unnecessary-semicolon, # Used when a statement is ended by a semi-colon (”;”), which isn’t necessary.
- unused-variable # Used when a variable is defined but not used. (Use _var to ignore var).
diff --git a/tests/test.py b/tests/test.py
index 6411ff39..47e7f374 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -9,6 +9,10 @@ def test_import(self):
""" Test that the cv2 module can be imported. """
import cv2
+ def test_cuda(self):
+ import cv2
+ assert hasattr(cv2.cuda, "createBackgroundSubtractorMOG2"), "Missing expected function!"
+
def test_video_capture(self):
import cv2
diff --git a/tools/repack_wheel.py b/tools/repack_wheel.py
new file mode 100644
index 00000000..a833d6a6
--- /dev/null
+++ b/tools/repack_wheel.py
@@ -0,0 +1,70 @@
+"""Repack a wheel file using LZMA compression.
+
+Recompresses all entries in a .whl (ZIP) file from the default DEFLATE to LZMA,
+which typically reduces size by ~35% for wheels containing large binary files.
+
+Uses a thread pool to decompress and compress entries in parallel.
+"""
+
+import argparse
+import os
+import sys
+import threading
+import zipfile
+from concurrent.futures import ThreadPoolExecutor, as_completed
+
+
+def repack_wheel(src, dst=None, method=zipfile.ZIP_LZMA, workers=None):
+ if dst is None:
+ dst = src
+ tmp = dst + ".tmp"
+ src_size = os.path.getsize(src)
+ print(f"Repacking {os.path.basename(src)} ({src_size / 1e9:.2f} GB)...")
+
+ with zipfile.ZipFile(src, "r") as zin:
+ items = zin.infolist()
+ # Read and recompress all entries in parallel
+ results = {}
+
+ def process(item):
+ data = zin.read(item.filename)
+ # Compress in a temporary single-entry zip in memory to get the
+ # compressed bytes, but it's simpler to just let writestr handle it.
+ return item, data
+
+ with ThreadPoolExecutor(max_workers=workers) as pool:
+ futures = {pool.submit(process, item): item for item in items}
+ for future in as_completed(futures):
+ item, data = future.result()
+ results[item.filename] = (item, data)
+
+ # Write sequentially (ZIP format requires sequential writes)
+ with zipfile.ZipFile(tmp, "w", method) as zout:
+ for item_info in items:
+ item, data = results[item_info.filename]
+ item.compress_type = method
+ zout.writestr(item, data)
+
+ dst_size = os.path.getsize(tmp)
+ saved = src_size - dst_size
+ print(
+ f"Done: {dst_size / 1e9:.2f} GB "
+ f"(saved {saved / 1e6:.1f} MB, {100 * saved / src_size:.1f}%)"
+ )
+ os.replace(tmp, dst)
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("wheel", help="Path to .whl file to repack")
+ parser.add_argument("-o", "--output", help="Output path (default: overwrite input)")
+ parser.add_argument(
+ "-j", "--jobs", type=int, default=None,
+ help="Number of worker threads (default: CPU count)",
+ )
+ args = parser.parse_args()
+ repack_wheel(args.wheel, dst=args.output, workers=args.jobs)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/travis_config.sh b/travis_config.sh
deleted file mode 100644
index 2e5e1a0e..00000000
--- a/travis_config.sh
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/bin/bash
-#Customize multibuild logic that is run after entering docker.
-#Sourced by docker_build_wrap.sh and docker_test_wrap.sh .
-#Runs in Docker, so only the vars passed to `docker run' exist.
-#See multibuild/README.rst
-echo "=== Loading config.sh === "
-
-# To see build progress
-function build_wheel {
- build_bdist_wheel $@
-}
-
-function bdist_wheel_cmd {
- # copied from multibuild's common_utils.sh
- # add osx deployment target so it doesn't default to 10.6
- local abs_wheelhouse=$1
- # install all required packages in pyproject.toml, because bdist_wheel does not do it
- python${PYTHON_VERSION} -m pip install toml && python${PYTHON_VERSION} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${PYTHON_VERSION} -m pip install -r /dev/stdin
- CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api=cp37 -v
- cp dist/*.whl $abs_wheelhouse
- if [ -z "$IS_OSX" ]; then
- # this path can be changed in the latest manylinux image
- TOOLS_PATH=/opt/_internal/pipx/venvs/auditwheel
- /opt/python/cp39-cp39/bin/python -m venv $TOOLS_PATH
- source $TOOLS_PATH/bin/activate
- python patch_auditwheel_whitelist.py
- deactivate
- fi
- if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi
-}
-
-if [ -n "$IS_OSX" ]; then
- echo " > OSX environment "
- export MAKEFLAGS="-j$(sysctl -n hw.ncpu)"
-else
- echo " > Linux environment "
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.16/lib
- export MAKEFLAGS="-j$(grep -E '^processor[[:space:]]*:' /proc/cpuinfo | wc -l)"
- CURRENT_ARCH=$(uname -m)
- if [[ $CURRENT_ARCH == 'aarch64' ]]; then
- # To avoid network issues with pypi.org on OpenCV CN machines
- export PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
- echo "Running for linux aarch64"
- fi
-fi
-
-if [ -n "$IS_OSX" ]; then
-
- source travis_osx_brew_cache.sh
-
- BREW_SLOW_BUILIDING_PACKAGES=$(printf '%s\n' \
- "cmake 15" \
- "ffmpeg 10" \
- )
-
- function generate_ffmpeg_formula {
- local FF="ffmpeg"
- local LFF="ffmpeg"
- local FF_FORMULA; FF_FORMULA=$(brew formula "${FF}")
- local LFF_FORMULA; LFF_FORMULA="$(dirname "$FF_FORMULA")/${LFF}.rb"
-
- local REGENERATE
- if [ -f "$LFF_FORMULA" ]; then
- local UPSTREAM_VERSION VERSION
- _brew_parse_package_info "$FF" " " UPSTREAM_VERSION _ _
- _brew_parse_package_info "$LFF" " " VERSION _ _ || REGENERATE=1
- #`rebuild` clause is ignored on `brew bottle` and deleted
- # from newly-generated formula on `brew bottle --merge` for some reason
- # so can't compare rebuild numbers
- if [ "$UPSTREAM_VERSION" != "$VERSION" ]; then
- REGENERATE=1
- fi
- else
- REGENERATE=1
- fi
- if [ -n "$REGENERATE" ]; then
- echo "Regenerating custom ffmpeg formula"
- # Bottle block syntax: https://docs.brew.sh/Bottles#bottle-dsl-domain-specific-language
- perl -wpe 'BEGIN {our ($found_blank, $bottle_block);}
- if (/(^class )(Ffmpeg)(\s.*)/) {$_=$1."Opencv".$3."\n"; next;}
- if (!$found_blank && /^$/) {$_.="conflicts_with \"ffmpeg\"\n\n"; $found_blank=1; next;}
- if (!$bottle_block && /^\s*bottle do$/) { $bottle_block=1; next; }
- if ($bottle_block) { if (/^\s*end\s*$/) { $bottle_block=0} elsif (/^\s*sha256\s/) {$_=""} next; }
-if (/^\s*depends_on "(x264|x265|xvid|frei0r|rubberband|libvidstab)"$/) {$_=""; next;}
- if (/^\s*--enable-(gpl|libx264|libx265|libxvid|frei0r|librubberband|libvidstab)$/) {$_=""; next;}
- ' <"$FF_FORMULA" >"$LFF_FORMULA"
- diff -u "$FF_FORMULA" "$LFF_FORMULA" || test $? -le 1
-
- ( cd "$(dirname "$LFF_FORMULA")"
- # This is the official way to add a formula
- # https://docs.brew.sh/Formula-Cookbook#commit
- git add "$(basename "$LFF_FORMULA")"
- git commit -m "add/update custom ffmpeg ${VERSION}"
- )
- fi
- }
-
-fi
-
-function pre_build {
- echo "Starting pre-build"
- set -e -o pipefail
-
- if [ -n "$IS_OSX" ]; then
- brew install lapack
- brew install libavif
- fi
-
- if [ -n "$IS_OSX" ]; then
- echo "Running for OSX"
-
- local CACHE_STAGE;# (echo "$TRAVIS_BUILD_STAGE_NAME" | grep -qiF "final") || CACHE_STAGE=1
- CACHE_STAGE=
- export HOMEBREW_NO_AUTO_UPDATE=1
-
- echo 'Installing FFmpeg'
-
- brew update
- generate_ffmpeg_formula
- brew_add_local_bottles
- brew install --build-bottle ffmpeg
- # It needs when we use not the latest ffmpeg formula
- brew link ffmpeg
-
- if [ -n "$CACHE_STAGE" ]; then
- brew_go_bootstrap_mode 0
- return 0
- fi
-
- # Have to install macpython late to avoid conflict with Homebrew Python update
- before_install
-
- else
- echo "Running for linux"
- fi
-}
-
-function run_tests {
- # Runs tests on installed distribution from an empty directory
- echo "Run tests..."
- echo $PWD
-
- PYTHON=python$PYTHON_VERSION
-
- echo "Running for linux"
-
- if [ $PYTHON == "python3.7" ]; then
- $PYTHON -m pip install -U numpy==1.19.4
- fi
- cd /io/tests
- $PYTHON get_build_info.py
-
- cd /io/opencv
- export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata
-
- test_wheels
- pylint_test
-}
-
-function test_wheels {
-
- echo "Starting OpenCV tests..."
-
- #Test package
- $PYTHON modules/python/test/test.py -v --repo .
-}
-
-function pylint_test {
-
- echo "Starting Pylint tests..."
-
- $PYTHON -m pip install pylint==2.15.9
- cd /io/tests
- $PYTHON -m pylint /io/opencv/samples/python/squares.py
-}
-
-export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
-set -x
diff --git a/travis_multibuild_customize.sh b/travis_multibuild_customize.sh
deleted file mode 100644
index 178fd6ec..00000000
--- a/travis_multibuild_customize.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-# Customize multibuild logic that is run before entering Docker. Sourced from travis.yml .
-export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
-set -x
-REPO_DIR=$(dirname "${BASH_SOURCE[0]}")
-DOCKER_IMAGE='quay.io/asenyaev/manylinux2014_$plat'
diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh
deleted file mode 100644
index 42e71446..00000000
--- a/travis_osx_brew_cache.sh
+++ /dev/null
@@ -1,451 +0,0 @@
-# Library to cache downloaded and locally-built Homebrew bottles in Travis OSX build.
-
-
-#Should be in Travis' cache
-BREW_LOCAL_BOTTLE_METADATA="$HOME/local_bottle_metadata"
-
-#FIXME: temporary fix to enable the build, should be replaced with the proper path to the cache dir
-mkdir -p $BREW_LOCAL_BOTTLE_METADATA
-
-# Starting reference point for elapsed build time; seconds since the epoch.
-#TRAVIS_TIMER_START_TIME is set at the start of a log fold, in nanoseconds since the epoch
-BREW_TIME_START=$(($TRAVIS_TIMER_START_TIME/10**9))
-
-# If after a package is built, elapsed time is more than this many seconds, fail the build but save Travis cache
-# The cutoff moment should leave enough time till Travis' job time limit to process the main project.
-# Since we have moved deps into a separate stage, we don't need to leave time for the project any more
-BREW_TIME_LIMIT=$((42*60))
-# If a slow-building package is about to be built and the projected build end moment is beyond this many seconds,
-# skip that build, fail the Travis job and save Travis cache.
-# This cutoff should leave enough time for before_cache and cache save.
-BREW_TIME_HARD_LIMIT=$((43*60))
-
-
-# Auto cleanup can delete locally-built bottles
-# when the caching logic isn't prepared for that
-export HOMEBREW_NO_INSTALL_CLEANUP=1
-
-# Don't query analytical info online on `brew info`,
-# this takes several seconds and we don't need it
-# see https://docs.brew.sh/Manpage , "info formula" section
-export HOMEBREW_NO_GITHUB_API=1
-
-#Packages already installed in the current session to avoid checking them again
-_BREW_ALREADY_INSTALLED='$' #$ = illegal package name; a blank line would cause macos grep to swallow everything
-
-
-#Public functions
-
-function brew_install_and_cache_within_time_limit {
- # Install the package and its dependencies one by one;
- # use bottle if available, build and cache bottle if not.
- # Terminate and exit with status 1 if this takes too long.
- # Exit with status 2 on any other error.
- _brew_install_and_cache_within_time_limit $@ \
- || if test $? -eq 1; then brew_go_bootstrap_mode; return 1; else return 2; fi
-}
-
-function brew_add_local_bottles {
- # Should be called after `brew update` at startup.
- # Adds metadata for cached locally-built bottles to local formulas
- # so that `brew` commands can find them.
- # If the package was updated, removes the corresponding files
- # and the bottle's entry in the formula, if any.
-
- # Bottle entry in formula:
- # bottle do
- # <...>
- # sha256 "" => :
- # <...>
- # end
-
- echo "Cached bottles:"
- ls "$(brew --cache)/downloads" || true #may not exist initially since it's "$(brew --cache)" that is in Travis cache
- echo "Saved .json's and links:"
- ls "$BREW_LOCAL_BOTTLE_METADATA"
-
- for JSON in "$BREW_LOCAL_BOTTLE_METADATA"/*.json; do
- [ -e "$JSON" ] || break # OSX 10.11 bash has no nullglob
- local PACKAGE JSON_VERSION JSON_REBUILD OS_CODENAME BOTTLE_HASH
-
- _brew_parse_bottle_json "$JSON" PACKAGE JSON_VERSION JSON_REBUILD OS_CODENAME BOTTLE_HASH
-
- echo "Adding local bottle: $PACKAGE ${JSON_VERSION}_${JSON_REBUILD}"
-
- local FORMULA_VERSION FORMULA_REBUILD FORMULA_BOTTLE_HASH
-
- _brew_parse_package_info "$PACKAGE" "$OS_CODENAME" FORMULA_VERSION FORMULA_REBUILD FORMULA_BOTTLE_HASH
-
- local FORMULA_HAS_BOTTLE; [ -n "$FORMULA_BOTTLE_HASH" ] && FORMULA_HAS_BOTTLE=1 || true
-
-
- local BOTTLE_LINK BOTTLE=""; BOTTLE_LINK="${JSON}.bottle.lnk";
- local BOTTLE_EXISTS= BOTTLE_MISMATCH= VERSION_MISMATCH=
-
-
- # Check that the bottle file exists and is still appropriate for the formula
- if [[ "$FORMULA_VERSION" != "$JSON_VERSION" || "$JSON_REBUILD" != "$FORMULA_REBUILD" ]]; then
- VERSION_MISMATCH=1;
- echo "The cached bottle is obsolete: formula ${FORMULA_VERSION}_${FORMULA_REBUILD}"
- fi
- if [ -f "$BOTTLE_LINK" ]; then
- BOTTLE=$(cat "$BOTTLE_LINK");
- BOTTLE=$(cd "$(dirname "$BOTTLE")"; pwd)/$(basename "$BOTTLE")
-
- if [ -e "$BOTTLE" ]; then
- BOTTLE_EXISTS=1;
-
- # The hash in `brew --cache $PACKAGE` entry is generated from download URL,
- # which itself is generated from base URL and version
- # (see Homebrew/Library/Homebrew/download_strategy.rb:cached_location).
- # So if version changes, hashes will always mismatch anyway
- # and we don't need a separate message about this.
- # XXX: OSX doesn't have `realpath` so can't compare the entire paths
- if [ -n "$FORMULA_HAS_BOTTLE" -a -z "$VERSION_MISMATCH" -a \
- "$(basename "$(brew --cache "$PACKAGE")")" != "$(basename "$BOTTLE")" ]; then
- BOTTLE_MISMATCH=1;
- echo "Cached bottle file doesn't correspond to formula's cache entry!" \
- "This can happen if download URL has changed." >&2
- fi
- else
- echo "Cached bottle file is missing!" >&2
- fi
- else
- echo "Link file is missing or of invalid type!" >&2
- fi
-
- # Delete cached bottle and all metadata if invalid
- if [[ -z "$BOTTLE_EXISTS" || -n "$VERSION_MISMATCH" || -n "$BOTTLE_MISMATCH" ]]; then
- echo "Deleting the cached bottle and all metadata"
-
- if [ "$FORMULA_BOTTLE_HASH" == "$BOTTLE_HASH" ]; then
- echo "A bottle block for the cached bottle was merged into the updated formula. Removing..."
- local FORMULA; FORMULA=$(brew formula "$PACKAGE")
- perl -wpe 'BEGIN { our $IN_BLOCK=0; }
- if ( ($IN_BLOCK==0) && /^\s*bottle\s+do\s*$/ ) { $IN_BLOCK=1; next; }
- if ( ($IN_BLOCK==1) && /^\s*end\s*$/ ) { $IN_BLOCK=-1; next; }
- if ( ($IN_BLOCK==1) && /^\s*sha256\s+"(\w+)"\s+=>\s+:\w+\s*$/ )
- { if ( $1 eq "'"$BOTTLE_HASH"'" ) {$_="";}; next; }
- ' <"$FORMULA" >"${FORMULA}.new"
- # Depending on diff version, 1 may mean differences found
- # https://stackoverflow.com/questions/6971284/what-are-the-error-exit-values-for-diff
- diff -u "$FORMULA" "${FORMULA}.new" || test $? -le 1
- ( cd $(dirname "$FORMULA")
- FORMULA=$(basename "$FORMULA")
- mv -v "${FORMULA}.new" "$FORMULA"
- git commit -m "Removed obsolete local bottle ${JSON_VERSION}_${JSON_REBUILD} :${OS_CODENAME}" "$FORMULA"
- )
- fi
-
- if [ -n "$BOTTLE" -a -n "$BOTTLE_EXISTS" ]; then rm "$BOTTLE"; fi
- rm -f "$BOTTLE_LINK"
- rm "$JSON"
-
- #(Re)add metadata to the formula otherwise
- else
- if [ "$FORMULA_BOTTLE_HASH" == "$BOTTLE_HASH" ]; then
- echo "The cached bottle is already present in the formula"
- else
- brew bottle --merge --write "$JSON"
- fi
- fi
- done
-}
-
-
-function brew_cache_cleanup {
- #Cleanup caching directories
- # Is supposed to be called in before_cache
-
- #Lefovers from some failure probably
- rm -f "$BREW_LOCAL_BOTTLE_METADATA"/*.tar.gz
-
- #`brew cleanup` may delete locally-built bottles that weren't needed this time
- # so we're saving and restoring them
- local BOTTLE_LINK BOTTLE
- for BOTTLE_LINK in "$BREW_LOCAL_BOTTLE_METADATA"/*.lnk; do
- [ -e "$BOTTLE_LINK" ] || break
- BOTTLE=$(cat "$BOTTLE_LINK")
- ln "$BOTTLE" "$BREW_LOCAL_BOTTLE_METADATA/"
- done
- brew cleanup
- local BOTTLE_BASENAME
- for BOTTLE_LINK in "$BREW_LOCAL_BOTTLE_METADATA"/*.lnk; do
- [ -e "$BOTTLE_LINK" ] || break
- BOTTLE=$(cat "$BOTTLE_LINK")
- BOTTLE_BASENAME=$(basename "$BOTTLE")
- if test ! -e "$BOTTLE"; then
- echo "Restoring: $BOTTLE_BASENAME"
- mv "$BREW_LOCAL_BOTTLE_METADATA/$BOTTLE_BASENAME" "$BOTTLE"
- else
- rm "$BREW_LOCAL_BOTTLE_METADATA/$BOTTLE_BASENAME"
- fi
- done
-}
-
-
-function brew_go_bootstrap_mode {
-# Can be overridden
-# Terminate the build but ensure saving the cache
- local EXIT_CODE=${1:-1}
-
- echo "Going into cache bootstrap mode"
-
- BREW_BOOTSTRAP_MODE=1
-
- #Can't just `exit` because that would terminate the build without saving the cache
- #Have to replace further actions with no-ops
-
- local MESSAGE=""; if [ "$EXIT_CODE" -ne 0 ]; then
- MESSAGE='Building dependencies took too long. Restart the build in Travis UI to continue from cache.';
- fi
-
- eval '
- function '"$cmd"' { return 0; }
- function repair_wheelhouse { return 0; }
- function install_run {'\
- "$(if [ -n "$MESSAGE" ]; then
- echo \
- ' echo -e "\n'"$MESSAGE"'\n"'
- fi)"\
- '
- # Travis runs user scripts via `eval` i.e. in the same shell process.
- # So have to unset errexit in order to get to cache save stage
- set +e; return '"$EXIT_CODE"'
- }'
-}
-
-
-
-#Internal functions
-
-function _brew_install_and_cache_within_time_limit {
- # This fn is run with || so errexit can't be enabled
-
- local PACKAGE TIME_LIMIT TIME_HARD_LIMIT TIME_START MARKED_INSTALLED
- PACKAGE="${1:?}" || return 2
- TIME_LIMIT=${2:-$BREW_TIME_LIMIT} || return 2
- TIME_HARD_LIMIT=${3:-$BREW_TIME_HARD_LIMIT} || return 2
- TIME_START=${4:-$BREW_TIME_START} || return 2
-
- if grep -qxFf <(cat <<<"$_BREW_ALREADY_INSTALLED") <<<"$PACKAGE"; then
- MARKED_INSTALLED=1
- fi
-
- if [ -n "$MARKED_INSTALLED" ] || (brew list --versions "$PACKAGE" >/dev/null && ! (brew outdated | grep -qxF "$PACKAGE")); then
- echo "Already installed and the latest version: $PACKAGE"
- if [ -z "$MARKED_INSTALLED" ]; then _brew_mark_installed "$PACKAGE"; fi
- return 0
- fi
-
- local BUILD_FROM_SOURCE INCLUDE_BUILD KEG_ONLY
-
- _brew_is_bottle_available "$PACKAGE" KEG_ONLY || BUILD_FROM_SOURCE=1
- [ -n "$BUILD_FROM_SOURCE" ] && INCLUDE_BUILD="--include-build" || true
-
- # Whitespace is illegal in package names so converting all whitespace into single spaces due to no quotes is okay.
- DEPS=`brew deps "$PACKAGE" $INCLUDE_BUILD` || return 2
- DEPS=`grep -vxF <(cat <<<"$_BREW_ALREADY_INSTALLED") <<<"$DEPS"` || test $? -eq 1 || return 2
- for dep in $DEPS; do
- #TIME_LIMIT only has to be met if we'll be actually building the main project this iteration, i.e. after the "root" module installation
- #While we don't know that yet, we can make better use of Travis-given time with a laxer limit
- #We still can't overrun TIME_HARD_LIMIT as that wouldn't leave time to save the cache
- _brew_install_and_cache_within_time_limit "$dep" $(((TIME_LIMIT+TIME_HARD_LIMIT)/2)) "$TIME_HARD_LIMIT" "$TIME_START" || return $?
- done
-
- _brew_check_slow_building_ahead "$PACKAGE" "$TIME_START" "$TIME_HARD_LIMIT" || return $?
- _brew_install_and_cache "$PACKAGE" "$([[ -z "$BUILD_FROM_SOURCE" ]] && echo 1 || echo 0)" "$KEG_ONLY" || return 2
- _brew_check_elapsed_build_time "$TIME_START" "$TIME_LIMIT" || return $?
-}
-
-
-function _brew_parse_bottle_json {
- # Parse JSON file resulting from `brew bottle --json`
- # and save data into specified variables
-
- local JSON; JSON="${1:?}"; shift
-
- local JSON_DATA; JSON_DATA=$(python3 -c 'if True:
- import sys,json; j=json.load(open(sys.argv[1],"rb")); [name]=j.keys(); [pdata]=j.values()
- print(name)
- print(pdata["formula"]["pkg_version"])
- print(pdata["bottle"]["rebuild"])
- [(tag_name, tag_dict)]=pdata["bottle"]["tags"].items()
- print(tag_name)
- print(tag_dict["sha256"])
- ' "$JSON")
-
- unset JSON
-
- { local i v; for i in {1..5}; do
- read -r v
- eval "${1:?}=\"$v\""
- shift
- done } <<< "$JSON_DATA"
-}
-
-function _brew_parse_package_info {
- # Get and parse `brew info --json` about a package
- # and save data into specified variables
-
- local PACKAGE OS_CODENAME
- PACKAGE="${1:?}"; shift
- OS_CODENAME="${1:?}"; shift
-
- local JSON_DATA; JSON_DATA=$(python3 -c 'if True:
- import sys, json, subprocess; j=json.loads(subprocess.check_output(("brew","info","--json=v1",sys.argv[1])))
- data=j[0]
- revision=data["revision"]
- # in bottle''s json, revision is included into version; here, they are separate
- print(data["versions"]["stable"]+("_"+str(revision) if revision else ""))
- bottle_data=data["bottle"].get("stable",{"rebuild":"","files":{}})
- print(bottle_data["rebuild"])
- print(bottle_data["files"].get(sys.argv[2],{"sha256":"!?"})["sha256"]) #prevent losing trailing blank line to command substitution
- ' \
- "$PACKAGE" "$OS_CODENAME"); JSON_DATA="${JSON_DATA%\!\?}" #!? can't occur in a hash
-
- unset PACKAGE OS_CODENAME
-
- { local i v; for i in {1..3}; do
- read -r v
- eval "${1:?}=\"$v\""
- shift
- done } <<< "$JSON_DATA"
-}
-
-
-
-function _brew_is_bottle_available {
-
- local PACKAGE;PACKAGE="${1:?}"
- local VAR_KEG_ONLY="$2"
-
- # `brew info` prints "Error: Broken pipe" if piped directly to `head` and the info is long
- # 141 = 128 + SIGPIPE
- local INFO;INFO="$((brew info "$PACKAGE" | cat || test $? -eq 141) | head -n 1)"
- if [ -n "$VAR_KEG_ONLY" ]; then
- if grep -qwF '[keg-only]' <<<"$INFO"; then
- eval "${VAR_KEG_ONLY}=1"
- else
- eval "${VAR_KEG_ONLY}=0"
- fi
- fi
-
- if grep -qxEe '[[:space:]]*bottle :unneeded' $(brew formula "$PACKAGE"); then
- echo "Bottle disabled: $PACKAGE"
- return 0
- fi
-
- if grep -qwF '(bottled)' <<<"$INFO"; then
- echo "Bottle available: $INFO"
- return 0
- else
- echo "Bottle not available: $INFO"
- return 1
- fi
-}
-
-function _brew_install_and_cache {
- # Install bottle or make and cache bottle.
- # assumes that deps were already installed
- # and not already the latest version
-
- local PACKAGE USE_BOTTLE KEG_ONLY
- PACKAGE="${1:?}"
- USE_BOTTLE="${2:?}"
- KEG_ONLY="${3:?}"
- local VERB
-
- if brew list --versions "$PACKAGE"; then
- # Install alongside the old version to avoid to have to update "runtime dependents"
- # https://discourse.brew.sh/t/can-i-install-a-new-version-without-having-to-upgrade-runtime-dependents/4443
- VERB="install --force"
- if [ "$KEG_ONLY" -eq 0 ]; then
- brew unlink "$PACKAGE"
- fi
- else
- VERB=install
- fi
-
- if [[ "$USE_BOTTLE" -gt 0 ]]; then
- echo "Installing bottle for: $PACKAGE"
- brew $VERB "$PACKAGE"
- else
- echo "Building bottle for: $PACKAGE"
- brew $VERB --build-bottle "$PACKAGE"
- exec 3>&1
- local OUT=$(brew bottle --json "$PACKAGE" | tee /dev/fd/3)
- exec 3>&-
-
- ls "$PACKAGE"*
- # doesn't seem to be a documented way to get file names
- local BOTTLE; BOTTLE=$(grep -Ee '^./' <<<"$OUT")
- #proper procedure as per https://discourse.brew.sh/t/how-are-bottle-and-postinstall-related-is-it-safe-to-run-bottle-after-postinstall/3410/4
- brew uninstall --ignore-dependencies "$PACKAGE"
- brew $VERB "$BOTTLE"
-
- local JSON; JSON=$(sed -E 's/bottle(.[[:digit:]]+)?\.tar\.gz$/bottle.json/' <<<"$BOTTLE")
-
- #`brew bottle --merge` doesn't return nonzero on nonexisting json file
- test -f "$JSON" -a -f "$BOTTLE"
-
- brew bottle --merge --write "$JSON"
- local CACHED_BOTTLE; CACHED_BOTTLE="$(brew --cache "$PACKAGE")"
- mv "$BOTTLE" "$CACHED_BOTTLE";
- local CACHED_JSON; CACHED_JSON="${BREW_LOCAL_BOTTLE_METADATA}/$(basename "$JSON")"
- mv "$JSON" "$CACHED_JSON"
- #Symlinks aren't cached by Travis. Will just save paths in files then.
- local BOTTLE_LINK; BOTTLE_LINK="${CACHED_JSON}.bottle.lnk"
- echo "$CACHED_BOTTLE" >"$BOTTLE_LINK"
-
- fi
-
- _brew_mark_installed "$PACKAGE"
-}
-
-function _brew_mark_installed {
- _BREW_ALREADY_INSTALLED="$_BREW_ALREADY_INSTALLED"$'\n'"${1:?}"
-}
-
-function _brew_check_elapsed_build_time {
- # If time limit has been reached,
- # arrange for further build to be skipped and return 1
-
- local TIME_START TIME_LIMIT ELAPSED_TIME
- TIME_START="${1:?}"
- TIME_LIMIT="${2:?}"
-
- ELAPSED_TIME=$(($(date +%s) - $TIME_START))
- echo "Elapsed time: "$(($ELAPSED_TIME/60))"m (${ELAPSED_TIME}s)"
-
- if [[ "$ELAPSED_TIME" -gt $TIME_LIMIT ]]; then
- brew_go_bootstrap_mode
- return 1
- fi
- return 0
-}
-
-function _brew_check_slow_building_ahead {
-
- #If the package's projected build completion is higher than hard limit,
- # skip it and arrange for further build to be skipped and return 1
-
- local PACKAGE TIME_START TIME_HARD_LIMIT
- PACKAGE="${1:?}"
- TIME_START="${2:?}"
- TIME_HARD_LIMIT="${3:?}"
-
- local PROJECTED_BUILD_TIME
- PROJECTED_BUILD_TIME=$(echo "$BREW_SLOW_BUILIDING_PACKAGES" | awk '$1=="'"$PACKAGE"'"{print $2}')
- [ -z "$PROJECTED_BUILD_TIME" ] && return 0 || true
-
- local PROJECTED_BUILD_END_ELAPSED_TIME
- PROJECTED_BUILD_END_ELAPSED_TIME=$(( $(date +%s) - TIME_START + PROJECTED_BUILD_TIME * 60))
-
- if [[ "$PROJECTED_BUILD_END_ELAPSED_TIME" -ge "$TIME_HARD_LIMIT" ]]; then
- echo -e "\nProjected build end elapsed time for $PACKAGE: $((PROJECTED_BUILD_END_ELAPSED_TIME/60))m ($PROJECTED_BUILD_END_ELAPSED_TIMEs)"
- brew_go_bootstrap_mode
- return 1
- fi
- return 0
-}