Skip to content

Commit af5d3b6

Browse files
committed
Fix CUDA builds
1 parent 3608dfe commit af5d3b6

4 files changed

Lines changed: 97 additions & 8 deletions

File tree

.github/actions/deploy-ubuntu/action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ runs:
5050
export ARCH_CUDA=sbsa
5151
export PREFIX=aarch64-linux-gnu
5252
export CUDA=cuda-repo-rhel8-13-3-local-13.3.1_610.43.02-1.aarch64.rpm
53+
export CCCL=13-3-13.3.3.4.1-1.aarch64
5354
export CUDNN=cuda-13-9.24.0.43-1.aarch64
5455
export NCCL=2.30.7-1+cuda13.3.aarch64
5556
export NVCOMP=nvcomp-linux-sbsa-5.2.0.10_cuda13-archive
@@ -72,6 +73,7 @@ runs:
7273
export ARCH_CUDA=x86_64
7374
export PREFIX=x86_64-linux-gnu
7475
export CUDA=cuda-repo-rhel8-13-3-local-13.3.1_610.43.02-1.x86_64.rpm
76+
export CCCL=13-3-13.3.3.4.1-1.x86_64
7577
export CUDNN=cuda-13-9.24.0.43-1.x86_64
7678
export NCCL=2.30.7-1+cuda13.3.x86_64
7779
export NVCOMP=nvcomp-linux-x86_64-5.2.0.10_cuda13-archive
@@ -180,13 +182,14 @@ runs:
180182
if [[ -n ${ARCH_CUDA:-} ]] && [[ -n ${CI_DEPLOY_NEED_CUDA:-} ]]; then
181183
echo Installing CUDA, cuDNN, nvCOMP, etc
182184
curl -LO https://developer.download.nvidia.com/compute/cuda/13.3.1/local_installers/$CUDA
185+
curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel8/$ARCH_CUDA/cccl-$CCCL.rpm
183186
curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel8/$ARCH_CUDA/libcudnn9-$CUDNN.rpm
184187
curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel8/$ARCH_CUDA/libcudnn9-devel-$CUDNN.rpm
185188
curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel8/$ARCH_CUDA/libcudnn9-headers-$CUDNN.rpm
186189
curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel8/$ARCH_CUDA/libnccl-$NCCL.rpm
187190
curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel8/$ARCH_CUDA/libnccl-devel-$NCCL.rpm
188191
189-
$SUDO rpm -i --force --ignorearch --nodeps $CUDA libcudnn*.rpm libnccl*.rpm
192+
$SUDO rpm -i --force --ignorearch --nodeps $CUDA cccl-*.rpm libcudnn*.rpm libnccl*.rpm
190193
rm -f *.rpm *.tgz *.txz *.tar.*
191194
pushd /var/cuda-repo-rhel8-13-3-local/; $SUDO rpm -i --force --ignorearch --nodeps cuda*.rpm libc*.rpm libn*.rpm; $SUDO rm *.rpm; popd
192195
$SUDO ln -snf $(ls -1d /usr/local/cuda/targets/*/include | tail -n 1) /usr/local/cuda/include
@@ -215,16 +218,17 @@ runs:
215218
# $SUDO sed -i /device_merge_sort.cuh/d /usr/local/cuda/include/cub/cub.cuh
216219
# $SUDO sed -i /device_segmented_sort.cuh/d /usr/local/cuda/include/cub/cub.cuh
217220
# $SUDO sed -i /warp_merge_sort.cuh/d /usr/local/cuda/include/cub/cub.cuh
218-
$SUDO cp -a /usr/local/cuda/include/cccl/* /usr/local/cuda/include/
221+
# $SUDO cp -a /usr/local/cuda/include/cccl/* /usr/local/cuda/include/
219222
220223
# Remove downloaded archives and unused libraries to avoid running out of disk space
221224
$SUDO rm -f $(find /usr/local/cuda/ -name '*.a' -and -not -name libcudart_static.a -and -not -name libcudadevrt.a -and -not -name libnvcomp_device.a)
225+
find /usr/local/cuda/
222226
fi
223227
224228
if [[ "$CI_DEPLOY_MODULE" == "nvcodec" ]]; then
225229
echo Installing NVIDIA Video Codec SDK
226-
python3 -m gdown 1qnRE4nF8XP8ifWH49BwIaYnoYuqH0Zrk
227-
$SUDO unzip Video_Codec_SDK_13.0.37.zip -d /usr/local
230+
python3 -m gdown 1d_i_qrkS9rvDMgYUY7O5vQHCf_rj1Jjy
231+
$SUDO unzip Video_Codec_SDK_13.1.15.zip -d /usr/local
228232
$SUDO ln -sf /usr/local/Video_Codec_SDK_* /usr/local/videocodecsdk
229233
fi
230234

.github/actions/deploy-windows/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,17 @@ runs:
179179
180180
if "%CI_DEPLOY_MODULE%"=="nvcodec" (
181181
echo Installing NVIDIA Video Codec SDK
182-
python -m gdown 1qnRE4nF8XP8ifWH49BwIaYnoYuqH0Zrk
183-
unzip Video_Codec_SDK_13.0.37.zip
184-
move Video_Codec_SDK_13.0.37 "%ProgramFiles%\NVIDIA GPU Computing Toolkit\VideoCodecSDK"
182+
python -m gdown 1d_i_qrkS9rvDMgYUY7O5vQHCf_rj1Jjy
183+
unzip Video_Codec_SDK_13.1.15.zip
184+
move Video_Codec_SDK_13.1.15 "%ProgramFiles%\NVIDIA GPU Computing Toolkit\VideoCodecSDK"
185185
)
186186
187187
if "%CI_DEPLOY_MODULE%"=="tensorrt" (
188188
echo Installing TensorRT
189189
rem python -m gdown 1GfmJ1BKbacLpUU-0i_mGu0sjrAS0Xzzi
190190
curl -LO https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/11.1.0/zip/TensorRT-Enterprise-11.1.0.106-Windows-amd64-cuda-13.3-Release-external.zip
191191
unzip TensorRT-Enterprise-11.1.0.106-Windows-amd64-cuda-13.3-Release-external.zip
192-
move TensorRT-Enterprise-11.1.0.106 "%ProgramFiles%\NVIDIA GPU Computing Toolkit\TensorRT"
192+
move TensorRT-11.1.0.106 "%ProgramFiles%\NVIDIA GPU Computing Toolkit\TensorRT"
193193
)
194194
195195
if "%CI_DEPLOY_MODULE%"=="mkl" (

onnxruntime/onnxruntime-cuda13.patch

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,72 @@ index acbbe0d94d..b340ccc912 100644
155155
num_segments.get(), num_gathered_indices, stream));
156156

157157
// CPU/GPU sync!
158+
diff --git a/cmake/patches/abseil/absl_cuda_warnings.patch b/cmake/patches/abseil/absl_cuda_warnings.patch
159+
index 144b9f904bf0f..b5737165dc248 100644
160+
--- a/cmake/patches/abseil/absl_cuda_warnings.patch
161+
+++ b/cmake/patches/abseil/absl_cuda_warnings.patch
162+
@@ -38,3 +38,64 @@ index 1234567..abcdefg 100644
163+
seed += uint16_t{0xad53};
164+
return seed;
165+
}
166+
+diff --git a/absl/container/internal/common.h b/absl/container/internal/common.h
167+
+index 1234567..abcdefg 100644
168+
+--- a/absl/container/internal/common.h
169+
++++ b/absl/container/internal/common.h
170+
+@@ -67,6 +67,13 @@ struct IfRRef<T&&> {
171+
+ using AddPtr = Other*;
172+
+ };
173+
+
174+
++// Workaround for NVCC (cudafe++) which fails to parse
175+
++// `IfRRef<concrete_type>::AddPtr<Dependent>` when used as a template argument
176+
++// inside a heavily macro-expanded template parameter list. Top-level alias
177+
++// defers the member-template lookup outside the surrounding template-id.
178+
++template <class T, class Other>
179+
++using IfRRefAddPtr = typename IfRRef<T>::template AddPtr<Other>;
180+
++
181+
+ template <class, class = void>
182+
+ struct IsTransparent : std::false_type {};
183+
+ template <class T>
184+
+diff --git a/absl/container/internal/raw_hash_map.h b/absl/container/internal/raw_hash_map.h
185+
+index 1234567..abcdefg 100644
186+
+--- a/absl/container/internal/raw_hash_map.h
187+
++++ b/absl/container/internal/raw_hash_map.h
188+
+@@ -106,8 +106,8 @@
189+
+ typename K = key_type, class V = mapped_type, \
190+
+ ABSL_INTERNAL_IF_##KValue##_NOR_##VValue( \
191+
+ int = (EnableIf<LifetimeBoundKV<K, KValue, V, VValue, \
192+
+- IfRRef<int KQual>::AddPtr<K>, \
193+
+- IfRRef<int VQual>::AddPtr<V>>>()), \
194+
++ IfRRefAddPtr<int KQual, K>, \
195+
++ IfRRefAddPtr<int VQual, V>>>()), \
196+
+ ABSL_INTERNAL_SINGLE_ARG( \
197+
+ int &..., \
198+
+ decltype(EnableIf<LifetimeBoundKV<K, KValue, V, VValue>>()) = \
199+
+diff --git a/absl/container/internal/btree_container.h b/absl/container/internal/btree_container.h
200+
+index 1234567..abcdefg 100644
201+
+--- a/absl/container/internal/btree_container.h
202+
++++ b/absl/container/internal/btree_container.h
203+
+@@ -497,8 +497,8 @@
204+
+ typename K = key_type, class M, \
205+
+ ABSL_INTERNAL_IF_##KValue##_NOR_##MValue( \
206+
+ int = (EnableIf<LifetimeBoundKV<K, KValue, M, MValue, \
207+
+- IfRRef<int KQual>::AddPtr<K>, \
208+
+- IfRRef<int MQual>::AddPtr<M>>>()), \
209+
++ IfRRefAddPtr<int KQual, K>, \
210+
++ IfRRefAddPtr<int MQual, M>>>()), \
211+
+ ABSL_INTERNAL_SINGLE_ARG( \
212+
+ int &..., \
213+
+ decltype(EnableIf<LifetimeBoundKV<K, KValue, M, MValue>>()) = \
214+
+@@ -598,10 +598,10 @@
215+
+ ABSL_INTERNAL_IF_##KValue( \
216+
+ class... Args, \
217+
+ int = (EnableIf< \
218+
+- LifetimeBoundK<K, KValue, IfRRef<int KQual>::AddPtr<K>>>())), \
219+
++ LifetimeBoundK<K, KValue, IfRRefAddPtr<int KQual, K>>>())), \
220+
+ ABSL_INTERNAL_IF_##KValue( \
221+
+ decltype(EnableIf<LifetimeBoundK< \
222+
+- K, KValue, IfRRef<int KQual>::AddPtr<K>>>()) = 0, \
223+
++ K, KValue, IfRRefAddPtr<int KQual, K>>>()) = 0, \
224+
+ class... Args), \
225+
+ std::enable_if_t<!std::is_convertible<K, const_iterator>::value, int> = \
226+
+ 0> \

opencv/opencv_contrib-cuda13.patch

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,19 @@ index d04c9cc1ef9..2bcc2fb3aab 100644
7171

7272
#endif
7373
#endif
74+
diff --git a/modules/videostab/src/cuda/global_motion.cu b/modules/videostab/src/cuda/global_motion.cu
75+
index c20ccfc..678243b 100644
76+
--- a/modules/videostab/src/cuda/global_motion.cu
77+
+++ b/modules/videostab/src/cuda/global_motion.cu
78+
@@ -63,10 +63,10 @@ int compactPoints(int N, float *points0, float *points1, const uchar *mask)
79+
thrust::device_ptr<float2> dpoints1((float2*)points1);
80+
thrust::device_ptr<const uchar> dmask(mask);
81+
82+
- return (int)(thrust::remove_if(thrust::make_zip_iterator(thrust::make_tuple(dpoints0, dpoints1)),
83+
- thrust::make_zip_iterator(thrust::make_tuple(dpoints0 + N, dpoints1 + N)),
84+
+ return (int)(thrust::remove_if(thrust::make_zip_iterator(::cuda::std::make_tuple(dpoints0, dpoints1)),
85+
+ thrust::make_zip_iterator(::cuda::std::make_tuple(dpoints0 + N, dpoints1 + N)),
86+
dmask, is_zero())
87+
- - thrust::make_zip_iterator(make_tuple(dpoints0, dpoints1)));
88+
+ - thrust::make_zip_iterator(::cuda::std::make_tuple(dpoints0, dpoints1)));
89+
}

0 commit comments

Comments
 (0)