Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 913654 Details for
Bug 946150
media-libs/opencv-4.10.0: CUDA 10.2 compatiblity
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
change how the version is parsed from `ncc --version` and also how g++ compilers are found that are candidates for being CUDA host C++ compilers
0001-Allow-opencv-compatibility-with-CUDA-10.2.patch (text/plain), 2.64 KB, created by
Dirk Tilger
on 2024-12-09 13:23:58 UTC
(
hide
)
Description:
change how the version is parsed from `ncc --version` and also how g++ compilers are found that are candidates for being CUDA host C++ compilers
Filename:
MIME Type:
Creator:
Dirk Tilger
Created:
2024-12-09 13:23:58 UTC
Size:
2.64 KB
patch
obsolete
>From 1191da5a1aaf0a4790c54e739909a5d4d2b79bbb Mon Sep 17 00:00:00 2001 >From: Dirk <dirk@systemication.com> >Date: Mon, 9 Dec 2024 12:54:43 +0100 >Subject: [PATCH] Allow opencv compatibility with CUDA 10.2 > >open seems very careful to keep CUDA 10.2 compatibility. Only the Gentoo build >system is not prepared to handle the CUDA 10.2 case. This patch makes it the build >system able to build opencv with CUDA 10.2. > >2 issues are addressed: > >1.) >gcc compilers use SLOT for their naming scheme, not major version. There are 2 gcc >versions in the main tree that are older than 10: 8.5.0 and 9.5.0 and their SLOT's are >called the same. Therefore calling g++ happens with g++-8.5.0 and g++-9.5.0 respectively. > >CUDA 10.2 is only compatible with g++ up to 8.5, hence the need for the above >compiler fix. > >The universal solution would have been something like: >NVCC_CCBIN="${compiler}-$(portageq metadata / installed ${package}-${package_version} SLOT)" >I couldn't find a way to determine the SLOT for a ${P}. > >2.) >Parsing the version from `nvcc --version` wasn't implemented universal enough which >is why I implemented it again using sed. > >Signed-off-by: Dirk <dirk@systemication.com> >--- > media-libs/opencv/opencv-4.10.0.ebuild | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/media-libs/opencv/opencv-4.10.0.ebuild b/media-libs/opencv/opencv-4.10.0.ebuild >index 0fddb4ef92d5..61ba6f075aae 100644 >--- a/media-libs/opencv/opencv-4.10.0.ebuild >+++ b/media-libs/opencv/opencv-4.10.0.ebuild >@@ -390,7 +390,11 @@ cuda_get_host_compiler() { > die "could not find a supported version of ${compiler}" > fi > >- NVCC_CCBIN="${compiler}-$(ver_cut 1 "${package_version/#<${package}-/}")" >+ if [ "${compiler_type}" == "gcc" ] && ver_test ${package_version/#<${package}-/} -lt 10; then >+ NVCC_CCBIN="${compiler}-$(ver_cut 1-3 "${package_version/#<${package}-/}")" >+ else >+ NVCC_CCBIN="${compiler}-$(ver_cut 1 "${package_version/#<${package}-/}")" >+ fi > > [[ "${NVCC_CCBIN}" != "${NVCC_CCBIN_default}" ]] && break > done >@@ -459,7 +463,7 @@ src_prepare() { > cd "${WORKDIR}/${PN}_contrib-${PV}" || die > eapply "${FILESDIR}/${PN}_contrib-4.8.1-rgbd.patch" > eapply "${FILESDIR}/${PN}_contrib-4.8.1-NVIDIAOpticalFlowSDK-2.0.tar.gz.patch" >- if type -P nvcc &> /dev/null && ver_test "$(nvcc --version | tail -n 1 | cut -d '_' -f 2- | cut -d '.' -f 1-2)" -ge 12.4; then >+ if type -P nvcc &> /dev/null && ver_test "$(nvcc --version | tail -n 1 | sed -n 's/.*release \([0-9]\{1,\}\.[0-9]\{1,\}\),.*/\1/p')" -ge 12.4; then > eapply "${DISTDIR}/${PN}_contrib-4.10.0-3607.patch" > eapply "${FILESDIR}/${PN}_contrib-4.10.0-CUDA-12.6-tuple_size.patch" # 3785 > fi >-- >2.45.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 946150
: 913654 |
913655