|
| 1 | +name: OCV Contrib PR:4.x U20 CUDA |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - '.github/workflows/OCV-Contrib-PR-4.x-U20-Cuda.yaml' |
| 9 | + workflow_call: |
| 10 | + |
| 11 | +env: |
| 12 | + EXTRA_CMAKE_OPTIONS: '-DBUILD_DOCS=ON -DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 -DOPENCV_DOWNLOAD_PATH=/home/ci/binaries_cache -DBUILD_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_CUDA=ON -DWITH_NVCUVID=ON -DCUDA_ARCH_BIN=6.1 -DWITH_VA=OFF' |
| 13 | + PR_AUTHOR: ${{ github.event.pull_request.user.login }} |
| 14 | + PR_AUTHOR_FORK: ${{ github.event.pull_request.head.repo.full_name }} |
| 15 | + SOURCE_BRANCH_NAME: ${{ github.head_ref }} |
| 16 | + TARGET_BRANCH_NAME: ${{ github.base_ref }} |
| 17 | + ANT_HOME: '/usr/share/ant' |
| 18 | + GIT_CACHE_DOCKER: '/home/ci/git_cache' |
| 19 | + OPENCV_TEST_DATA_PATH: '/home/ci/opencv_extra/testdata' |
| 20 | + OPENCV_CONTRIB_DOCKER_WORKDIR: '/home/ci/opencv_contrib' |
| 21 | + PARALLEL_JOBS: 8 |
| 22 | + |
| 23 | +jobs: |
| 24 | + BuildAndTest: |
| 25 | + runs-on: opencv-cn-lin-x86-64 |
| 26 | + defaults: |
| 27 | + run: |
| 28 | + shell: bash |
| 29 | + container: |
| 30 | + image: quay.io/opencv-ci/opencv-ubuntu-20.04:20220901 |
| 31 | + options: --gpus all -m 8G |
| 32 | + volumes: |
| 33 | + - /home/opencv-cn/git_cache:/home/ci/git_cache |
| 34 | + - /home/opencv-cn/ci_cache/opencv:/home/ci/.ccache |
| 35 | + - /home/opencv-cn/binaries_cache:/home/ci/binaries_cache |
| 36 | + - /usr/local/cuda:/usr/local/cuda |
| 37 | + steps: |
| 38 | + - name: Brief system information |
| 39 | + timeout-minutes: 60 |
| 40 | + run: bash ${{ env.GIT_CACHE_DOCKER }}/print_system_information.sh |
| 41 | + - name: Define proper HOME path |
| 42 | + timeout-minutes: 60 |
| 43 | + run: echo "HOME=/home/ci" >> $GITHUB_ENV |
| 44 | + - name: Setup infra environment |
| 45 | + timeout-minutes: 60 |
| 46 | + if: ${{ github.event.repository.name == 'ci-gha-workflow' }} |
| 47 | + run: echo "TARGET_BRANCH_NAME=4.x" >> $GITHUB_ENV |
| 48 | + - name: PR info |
| 49 | + timeout-minutes: 60 |
| 50 | + run: | |
| 51 | + echo "PR Author: ${{ env.PR_AUTHOR }}" |
| 52 | + echo "PR Author fork: ${{ env.PR_AUTHOR_FORK }}" |
| 53 | + echo "Source branch name: ${{ env.SOURCE_BRANCH_NAME }}" |
| 54 | + echo "Target branch name: ${{ env.TARGET_BRANCH_NAME }}" |
| 55 | + - name: Clean |
| 56 | + timeout-minutes: 60 |
| 57 | + run: find ${{ env.OPENCV_CONTRIB_DOCKER_WORKDIR }} -mindepth 1 -delete |
| 58 | + - name: Fetch opencv_contrib |
| 59 | + timeout-minutes: 60 |
| 60 | + run: git clone --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv_contrib.git https://github.com/opencv/opencv_contrib.git ${{ env.OPENCV_CONTRIB_DOCKER_WORKDIR }} |
| 61 | + - name: Merge opencv_contrib with ${{ env.SOURCE_BRANCH_NAME }} branch |
| 62 | + timeout-minutes: 60 |
| 63 | + if: ${{ github.event.repository.name != 'ci-gha-workflow' }} |
| 64 | + run: | |
| 65 | + cd ${{ env.OPENCV_CONTRIB_DOCKER_WORKDIR }} |
| 66 | + git pull -v "https://github.com/${{ env.PR_AUTHOR_FORK }}" "${{ env.SOURCE_BRANCH_NAME }}" |
| 67 | + - name: Clone opencv |
| 68 | + timeout-minutes: 60 |
| 69 | + run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv.git https://github.com/opencv/opencv.git $HOME/opencv |
| 70 | + - name: Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch |
| 71 | + timeout-minutes: 60 |
| 72 | + if: ${{ github.event.repository.name != 'ci-gha-workflow' }} |
| 73 | + run: | |
| 74 | + OPENCV_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv" "${{ env.SOURCE_BRANCH_NAME }}") || true |
| 75 | + if [[ ! -z "$OPENCV_FORK" ]]; then |
| 76 | + echo "Merge opencv with ${{ env.SOURCE_BRANCH_NAME }} branch" |
| 77 | + cd $HOME/opencv |
| 78 | + git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv" "${{ env.SOURCE_BRANCH_NAME }}" |
| 79 | + else |
| 80 | + echo "No merge since ${{ env.PR_AUTHOR }}/opencv does not have branch ${{ env.SOURCE_BRANCH_NAME }}" |
| 81 | + fi |
| 82 | + - name: Clone opencv_extra |
| 83 | + timeout-minutes: 60 |
| 84 | + run: git clone --single-branch --branch ${{ env.TARGET_BRANCH_NAME }} --reference ${{ env.GIT_CACHE_DOCKER }}/opencv_extra.git https://github.com/opencv/opencv_extra.git $HOME/opencv_extra |
| 85 | + - name: Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch |
| 86 | + timeout-minutes: 60 |
| 87 | + if: ${{ github.event.repository.name != 'ci-gha-workflow' }} |
| 88 | + run: | |
| 89 | + OPENCV_EXTRA_FORK=$(git ls-remote --heads "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}") || true |
| 90 | + if [[ ! -z "$OPENCV_EXTRA_FORK" ]]; then |
| 91 | + echo "Merge opencv_extra with ${{ env.SOURCE_BRANCH_NAME }} branch" |
| 92 | + cd $HOME/opencv_extra |
| 93 | + git pull -v "https://github.com/${{ env.PR_AUTHOR }}/opencv_extra" "${{ env.SOURCE_BRANCH_NAME }}" |
| 94 | + else |
| 95 | + echo "No merge since ${{ env.PR_AUTHOR }}/opencv_extra does not have branch ${{ env.SOURCE_BRANCH_NAME }}" |
| 96 | + fi |
| 97 | + - name: Configure OpenCV |
| 98 | + timeout-minutes: 60 |
| 99 | + run: | |
| 100 | + cd $HOME/build |
| 101 | + cmake -G Ninja ${{ env.EXTRA_CMAKE_OPTIONS }} -DOPENCV_EXTRA_MODULES_PATH=${{ env.OPENCV_CONTRIB_DOCKER_WORKDIR }}/modules $HOME/opencv |
| 102 | + - name: Build OpenCV |
| 103 | + timeout-minutes: 60 |
| 104 | + id: build-opencv-contrib |
| 105 | + run: | |
| 106 | + cd $HOME/build |
| 107 | + ninja -j ${{ env.PARALLEL_JOBS }} | tee $HOME/build/build-log.txt |
| 108 | + # Tests are not stable, failures after 'CUDA/GpuMat_SetTo.Zero' test happen everytime |
| 109 | + # - name: Accuracy:cudaarithm |
| 110 | + # timeout-minutes: 60 |
| 111 | + # if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 112 | + # run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudaarithm --test_threads=${{ env.PARALLEL_JOBS }} |
| 113 | + - name: Accuracy:cudabgsegm |
| 114 | + timeout-minutes: 60 |
| 115 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 116 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudabgsegm --test_threads=${{ env.PARALLEL_JOBS }} |
| 117 | + # All tests fail if '-DWITH_NVCUVID=ON' flag is set |
| 118 | + # - name: Accuracy:cudacodec |
| 119 | + # timeout-minutes: 60 |
| 120 | + # if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 121 | + # run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudacodec --test_threads=${{ env.PARALLEL_JOBS }} |
| 122 | + - name: Accuracy:cudafeatures2d |
| 123 | + timeout-minutes: 60 |
| 124 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 125 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudafeatures2d --test_threads=${{ env.PARALLEL_JOBS }} |
| 126 | + - name: Accuracy:cudafilters |
| 127 | + timeout-minutes: 60 |
| 128 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 129 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudafilters --test_threads=${{ env.PARALLEL_JOBS }} |
| 130 | + - name: Accuracy:cudaimgproc |
| 131 | + timeout-minutes: 60 |
| 132 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 133 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudaimgproc --test_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} |
| 134 | + env: |
| 135 | + GTEST_FILTER_STRING: '-CUDA_ImgProc/HoughLinesProbabilistic.Accuracy/1:CUDA_ImgProc/HoughLinesProbabilistic.Accuracy/2:CUDA_ImgProc/HoughLinesProbabilistic.Accuracy/3:CUDA_ImgProc/HoughCircles.Accuracy/0' |
| 136 | + - name: Accuracy:cudalegacy |
| 137 | + timeout-minutes: 60 |
| 138 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 139 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudalegacy --test_threads=${{ env.PARALLEL_JOBS }} |
| 140 | + - name: Accuracy:cudaobjdetect |
| 141 | + timeout-minutes: 60 |
| 142 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 143 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudaobjdetect --test_threads=${{ env.PARALLEL_JOBS }} |
| 144 | + - name: Accuracy:cudaoptflow |
| 145 | + timeout-minutes: 60 |
| 146 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 147 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudaoptflow --test_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} |
| 148 | + env: |
| 149 | + GTEST_FILTER_STRING: '-CUDA_OptFlow/NvidiaOpticalFlow_1_0.Regression/0:CUDA_OptFlow/NvidiaOpticalFlow_1_0.OpticalFlowNan/0:CUDA_OptFlow/NvidiaOpticalFlow_2_0.Regression/0:CUDA_OptFlow/NvidiaOpticalFlow_2_0.OpticalFlowNan/0' |
| 150 | + - name: Accuracy:cudastereo |
| 151 | + timeout-minutes: 60 |
| 152 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 153 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudastereo --test_threads=${{ env.PARALLEL_JOBS }} |
| 154 | + - name: Accuracy:cudawarping |
| 155 | + timeout-minutes: 60 |
| 156 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 157 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudawarping --test_threads=${{ env.PARALLEL_JOBS }} |
| 158 | + - name: Accuracy:cudev |
| 159 | + timeout-minutes: 60 |
| 160 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 161 | + run: cd $HOME/build && xvfb-run -a bin/opencv_test_cudev --test_threads=${{ env.PARALLEL_JOBS }} |
| 162 | + - name: Performance:cudaarithm |
| 163 | + timeout-minutes: 60 |
| 164 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 165 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudaarithm --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} |
| 166 | + env: |
| 167 | + GTEST_FILTER_STRING: '-Sz_Type_AngleInDegrees_PolarToCart.PolarToCart/0:Sz_Type_AngleInDegrees_PolarToCart.PolarToCart/4' |
| 168 | + - name: Performance:cudabgsegm |
| 169 | + timeout-minutes: 60 |
| 170 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 171 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudabgsegm --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} |
| 172 | + # All tests fail if '-DWITH_NVCUVID=ON' flag is set |
| 173 | + # - name: Performance:cudacodec |
| 174 | + # timeout-minutes: 60 |
| 175 | + # if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 176 | + # run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudacodec --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} |
| 177 | + - name: Performance:cudafeatures2d |
| 178 | + timeout-minutes: 60 |
| 179 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 180 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudafeatures2d --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} |
| 181 | + - name: Performance:cudafilters |
| 182 | + timeout-minutes: 60 |
| 183 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 184 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudafilters --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} |
| 185 | + - name: Performance:cudaimgproc |
| 186 | + timeout-minutes: 60 |
| 187 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 188 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudaimgproc --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} |
| 189 | + env: |
| 190 | + GTEST_FILTER_STRING: '-Sz_Depth_Code_CvtColor.CvtColor/17:Sz_Depth_Code_CvtColor.CvtColor/38:Sz_Depth_Code_CvtColor.CvtColor/39:Sz_Depth_Code_CvtColor.CvtColor/40:Sz_Depth_Code_CvtColor.CvtColor/41:Sz_Depth_Code_CvtColor.CvtColor/59:Sz_Depth_Code_CvtColor.CvtColor/80:Sz_Depth_Code_CvtColor.CvtColor/81:Sz_Depth_Code_CvtColor.CvtColor/82:Sz_Depth_Code_CvtColor.CvtColor/83:Sz_Depth_Code_CvtColor.CvtColor/101:Sz_Depth_Code_CvtColor.CvtColor/122:Sz_Depth_Code_CvtColor.CvtColor/123:Sz_Depth_Code_CvtColor.CvtColor/124:Sz_Depth_Code_CvtColor.CvtColor/125:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/12:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/13:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/14:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/15:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/28:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/29:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/30:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/31:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/44:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/45:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/46:Sz_Depth_Code_CvtColorBayer.CvtColorBayer/47:Image_HoughLinesP.HoughLinesP/0:Image_HoughLinesP.HoughLinesP/1:Sz_TemplateSz_Cn_Method_MatchTemplate8U.MatchTemplate8U/46:Sz_TemplateSz_Cn_Method_MatchTemplate8U.MatchTemplate8U/47:Sz_TemplateSz_Cn_Method_MatchTemplate8U.MatchTemplate8U/52:Sz_TemplateSz_Cn_Method_MatchTemplate8U.MatchTemplate8U/53' |
| 191 | + - name: Performance:cudalegacy |
| 192 | + timeout-minutes: 60 |
| 193 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 194 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudalegacy --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} |
| 195 | + - name: Performance:cudaobjdetect |
| 196 | + timeout-minutes: 60 |
| 197 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 198 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudaobjdetect --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} |
| 199 | + - name: Performance:cudaoptflow |
| 200 | + timeout-minutes: 60 |
| 201 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 202 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudaoptflow --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} |
| 203 | + env: |
| 204 | + GTEST_FILTER_STRING: '-ImagePair_Gray_NPts_WinSz_Levels_Iters_PyrLKOpticalFlowSparse.PyrLKOpticalFlowSparse/0:ImagePair_Gray_NPts_WinSz_Levels_Iters_PyrLKOpticalFlowSparse.PyrLKOpticalFlowSparse/1:ImagePair_Gray_NPts_WinSz_Levels_Iters_PyrLKOpticalFlowSparse.PyrLKOpticalFlowSparse/2:ImagePair_Gray_NPts_WinSz_Levels_Iters_PyrLKOpticalFlowSparse.PyrLKOpticalFlowSparse/3' |
| 205 | + - name: Performance:cudastereo |
| 206 | + timeout-minutes: 60 |
| 207 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 208 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudastereo --perf_threads=${{ env.PARALLEL_JOBS }} |
| 209 | + - name: Performance:cudawarping |
| 210 | + timeout-minutes: 60 |
| 211 | + if: ${{ always() && steps.build-opencv-contrib.outcome == 'success' }} |
| 212 | + run: cd $HOME/build && xvfb-run -a bin/opencv_perf_cudawarping --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity --skip_unstable=1 --perf_threads=${{ env.PARALLEL_JOBS }} --gtest_filter=${{ env.GTEST_FILTER_STRING }} |
| 213 | + env: |
| 214 | + GTEST_FILTER_STRING: '-Sz_Depth_Cn_Inter_Rotate.Rotate/7:Sz_Depth_Cn_Inter_Rotate.Rotate/34:Sz_Depth_Cn_Inter_Rotate.Rotate/55' |
0 commit comments