Skip to content

Commit

Permalink
update cuda to 12.6 (#8922)
Browse files Browse the repository at this point in the history
* update cuda to 12.6
* remove cuda from opencv2 and opencv3
  • Loading branch information
cenit authored Oct 10, 2024
1 parent d02cc3a commit d17ec15
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 278 deletions.
44 changes: 7 additions & 37 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
path: ${{ github.workspace }}/uselib*


ubuntu-vcpkg-opencv3-cuda:
ubuntu-vcpkg-opencv3:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -161,16 +161,6 @@ jobs:
- name: Clean downloads
run: sudo apt-get clean

- name: 'Install CUDA'
run: ${{ github.workspace }}/scripts/deploy-cuda.sh

- name: 'Create softlinks for CUDA'
run: |
source ${{ github.workspace }}/scripts/requested_cuda_version.sh
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so.1
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so.1
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so
- name: 'Setup vcpkg and NuGet artifacts backend'
shell: bash
run: >
Expand All @@ -192,15 +182,10 @@ jobs:
- name: 'Build'
shell: pwsh
env:
CUDACXX: "/usr/local/cuda/bin/nvcc"
CUDA_PATH: "/usr/local/cuda"
CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda"
LD_LIBRARY_PATH: "/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH"
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -EnableCUDA -EnableCUDNN -ForceOpenCVVersion 3 -DisableInteractive -DoNotUpdateTOOL
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -ForceOpenCVVersion 3 -DisableInteractive -DoNotUpdateTOOL


ubuntu-vcpkg-opencv2-cuda:
ubuntu-vcpkg-opencv2:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -214,16 +199,6 @@ jobs:
- name: Clean downloads
run: sudo apt-get clean

- name: 'Install CUDA'
run: ${{ github.workspace }}/scripts/deploy-cuda.sh

- name: 'Create softlinks for CUDA'
run: |
source ${{ github.workspace }}/scripts/requested_cuda_version.sh
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so.1
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so.1
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so
- name: 'Setup vcpkg and NuGet artifacts backend'
shell: bash
run: >
Expand All @@ -245,12 +220,7 @@ jobs:
- name: 'Build'
shell: pwsh
env:
CUDACXX: "/usr/local/cuda/bin/nvcc"
CUDA_PATH: "/usr/local/cuda"
CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda"
LD_LIBRARY_PATH: "/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH"
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -EnableCUDA -EnableCUDNN -ForceOpenCVVersion 2 -DisableInteractive -DoNotUpdateTOOL
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -ForceOpenCVVersion 2 -DisableInteractive -DoNotUpdateTOOL


ubuntu:
Expand Down Expand Up @@ -693,9 +663,9 @@ jobs:

- name: 'Build'
env:
CUDA_PATH: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.2"
CUDA_TOOLKIT_ROOT_DIR: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.2"
CUDACXX: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.2\\bin\\nvcc.exe"
CUDA_PATH: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6"
CUDA_TOOLKIT_ROOT_DIR: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6"
CUDACXX: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\bin\\nvcc.exe"
shell: pwsh
run: ${{ github.workspace }}/build.ps1 -EnableCUDA -DisableInteractive -DoNotUpdateTOOL

Expand Down
44 changes: 7 additions & 37 deletions .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -EnableCUDA -EnableCUDNN -DisableInteractive -DoNotUpdateTOOL


ubuntu-vcpkg-opencv3-cuda:
ubuntu-vcpkg-opencv3:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -120,16 +120,6 @@ jobs:
- name: Clean downloads
run: sudo apt-get clean

- name: 'Install CUDA'
run: ${{ github.workspace }}/scripts/deploy-cuda.sh

- name: 'Create softlinks for CUDA'
run: |
source ${{ github.workspace }}/scripts/requested_cuda_version.sh
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so.1
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so.1
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so
- name: 'Setup vcpkg and NuGet artifacts backend'
shell: bash
run: >
Expand All @@ -141,15 +131,10 @@ jobs:
- name: 'Build'
shell: pwsh
env:
CUDACXX: "/usr/local/cuda/bin/nvcc"
CUDA_PATH: "/usr/local/cuda"
CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda"
LD_LIBRARY_PATH: "/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH"
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -EnableCUDA -EnableCUDNN -ForceOpenCVVersion 3 -DisableInteractive -DoNotUpdateTOOL
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -ForceOpenCVVersion 3 -DisableInteractive -DoNotUpdateTOOL


ubuntu-vcpkg-opencv2-cuda:
ubuntu-vcpkg-opencv2:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand All @@ -163,16 +148,6 @@ jobs:
- name: Clean downloads
run: sudo apt-get clean

- name: 'Install CUDA'
run: ${{ github.workspace }}/scripts/deploy-cuda.sh

- name: 'Create softlinks for CUDA'
run: |
source ${{ github.workspace }}/scripts/requested_cuda_version.sh
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so.1
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so.1
sudo ln -s /usr/local/cuda-${CUDA_VERSION}/lib64/stubs/libcuda.so /usr/local/cuda-${CUDA_VERSION}/lib64/libcuda.so
- name: 'Setup vcpkg and NuGet artifacts backend'
shell: bash
run: >
Expand All @@ -184,12 +159,7 @@ jobs:
- name: 'Build'
shell: pwsh
env:
CUDACXX: "/usr/local/cuda/bin/nvcc"
CUDA_PATH: "/usr/local/cuda"
CUDA_TOOLKIT_ROOT_DIR: "/usr/local/cuda"
LD_LIBRARY_PATH: "/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH"
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -EnableCUDA -EnableCUDNN -ForceOpenCVVersion 2 -DisableInteractive -DoNotUpdateTOOL
run: ${{ github.workspace }}/build.ps1 -UseVCPKG -DoNotUpdateVCPKG -EnableOPENCV -ForceOpenCVVersion 2 -DisableInteractive -DoNotUpdateTOOL


ubuntu:
Expand Down Expand Up @@ -435,9 +405,9 @@ jobs:

- name: 'Build'
env:
CUDA_PATH: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.2"
CUDA_TOOLKIT_ROOT_DIR: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.2"
CUDACXX: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.2\\bin\\nvcc.exe"
CUDA_PATH: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6"
CUDA_TOOLKIT_ROOT_DIR: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6"
CUDACXX: "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\bin\\nvcc.exe"
shell: pwsh
run: ${{ github.workspace }}/build.ps1 -EnableCUDA -DisableInteractive -DoNotUpdateTOOL

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ build/detect_cuda_compute_capabilities.cu
build/.ninja_deps
build/.ninja_log
build/Makefile
CMakeFiles/
CMakeCache.txt
*/vcpkg-manifest-install.log
build.log
__pycache__/
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ if(ENABLE_OPENCV)
if(VCPKG_USE_OPENCV4)
list(APPEND VCPKG_MANIFEST_FEATURES "opencv-cuda")
elseif(VCPKG_USE_OPENCV3)
list(APPEND VCPKG_MANIFEST_FEATURES "opencv3-cuda")
list(APPEND VCPKG_MANIFEST_FEATURES "opencv3")
elseif(VCPKG_USE_OPENCV2)
list(APPEND VCPKG_MANIFEST_FEATURES "opencv2-cuda")
list(APPEND VCPKG_MANIFEST_FEATURES "opencv2")
endif()
else()
if(VCPKG_USE_OPENCV4)
list(APPEND VCPKG_MANIFEST_FEATURES "opencv-base")
elseif(VCPKG_USE_OPENCV3)
list(APPEND VCPKG_MANIFEST_FEATURES "opencv3-base")
list(APPEND VCPKG_MANIFEST_FEATURES "opencv3")
elseif(VCPKG_USE_OPENCV2)
list(APPEND VCPKG_MANIFEST_FEATURES "opencv2-base")
list(APPEND VCPKG_MANIFEST_FEATURES "opencv2")
endif()
endif()
endif()
Expand Down
12 changes: 0 additions & 12 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -907,21 +907,14 @@ if ($BuildInstaller) {

if (($ForceOpenCVVersion -eq 2) -and $UseVCPKG) {
Write-Host "You requested OpenCV version 2, so vcpkg will install that version" -ForegroundColor Yellow
Write-Host "This requires using vcpkg.json.opencv23 as manifest file" -ForegroundColor Yellow
$AdditionalBuildSetup = $AdditionalBuildSetup + " -DVCPKG_USE_OPENCV4=OFF -DVCPKG_USE_OPENCV2=ON"
}

if (($ForceOpenCVVersion -eq 3) -and $UseVCPKG) {
Write-Host "You requested OpenCV version 3, so vcpkg will install that version" -ForegroundColor Yellow
Write-Host "This requires using vcpkg.json.opencv23 as manifest file" -ForegroundColor Yellow
$AdditionalBuildSetup = $AdditionalBuildSetup + " -DVCPKG_USE_OPENCV4=OFF -DVCPKG_USE_OPENCV3=ON"
}

if($ForceOpenCVVersion -gt 0) {
Move-Item $PSCustomScriptRoot/vcpkg.json $PSCustomScriptRoot/vcpkg.json.bak
Move-Item $PSCustomScriptRoot/vcpkg.json.opencv23 $PSCustomScriptRoot/vcpkg.json
}

if ($UseVCPKG -and $ForceVCPKGCacheRemoval) {
if ($IsWindows -or $IsWindowsPowerShell) {
$vcpkgbinarycachepath = "$env:LOCALAPPDATA/vcpkg/archive"
Expand Down Expand Up @@ -1175,11 +1168,6 @@ if ($vcpkg_host_triplet_set_by_this_script) {
$env:VCPKG_DEFAULT_HOST_TRIPLET = $null
}

if($ForceOpenCVVersion -gt 0) {
Move-Item $PSCustomScriptRoot/vcpkg.json $PSCustomScriptRoot/vcpkg.json.opencv23
Move-Item $PSCustomScriptRoot/vcpkg.json.bak $PSCustomScriptRoot/vcpkg.json
}

if ($vcpkg_branch_set_by_this_script) {
Push-Location $vcpkg_path
$git_args = "checkout -"
Expand Down
2 changes: 1 addition & 1 deletion scripts/requested_cuda_version.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

export CUDA_VERSION="12.2"
export CUDA_VERSION="12.6"
export CUDA_VERSION_DASHED="${CUDA_VERSION//./-}"
Loading

0 comments on commit d17ec15

Please sign in to comment.