Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 946150 - media-libs/opencv-4.10.0: CUDA 10.2 compatiblity
Summary: media-libs/opencv-4.10.0: CUDA 10.2 compatiblity
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal
Assignee: Paul Zander
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-09 13:23 UTC by Dirk Tilger
Modified: 2025-01-04 19:36 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
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,2.64 KB, patch)
2024-12-09 13:23 UTC, Dirk Tilger
Details | Diff
Patch to make changes pertaining to CUDA 12.4+ only apply for such versions (0001-Merge-pull-request-3751-from-peters-4.x.patch,2.43 KB, patch)
2024-12-09 13:24 UTC, Dirk Tilger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Tilger 2024-12-09 13:23:58 UTC
Created attachment 913654 [details, diff]
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

opencv is very careful to support also old CUDA versions. I understand that Gentoo has decided to drop support for CUDA 10.2

I have been working on an overlay to support CUDA 10.2, because software I want to use requires CUDA and my GPU is fairly ancient and is only supported until CUDA 10.2

There are 2 patches required to make this work. Patch "Allow opencv compatibility with CUDA 10.2" changes how the version is parsed from `ncc --version` and also how g++ compilers are found that are candidates for being CUDA host C++ compilers.

The 2nd patch needs to be applied to the opencv_contrib directory and is a cherry-pick from the opencv_contrib repository. It makes some modifications pertaining to CUDA 12.4+ compatibility dependent on such version and hence unbreak CUDA 10.2 compatibility.
Comment 1 Dirk Tilger 2024-12-09 13:24:55 UTC
Created attachment 913655 [details, diff]
Patch to make changes pertaining to CUDA 12.4+ only apply for such versions
Comment 2 Dirk Tilger 2024-12-09 13:28:10 UTC
BTW, I understand Gentoo has decided to drop CUDA 10.2 compatibility, but both changes introduced by the patches are fairly small IMHO and address fairly generic issues which is why I believe this change should go into the mainline repository instead of my cuda-10.2 overlay.
Comment 3 Paul Zander 2024-12-09 13:44:33 UTC
What card or shader model are we talking about 3.0?

I'll backport the patch, but the ebuild changes can't go in like that.

Can you provide the output of your nvcc --version please?

Note that you can already set NVCC_CCBIN in your env so changing the check isn't even needed.
Comment 4 Dirk Tilger 2024-12-09 18:06:27 UTC
(In reply to Paul Zander from comment #3)
> What card or shader model are we talking about 3.0?

I'm interested in getting CUDA working for my NVidia GT 750M. It is compute3.0.

> Can you provide the output of your nvcc --version please?

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:24:38_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89

> Note that you can already set NVCC_CCBIN in your env so changing the check 
> isn't even needed.

That would be good enough for me, actually.
Comment 5 ilovekiruna 2025-01-04 19:36:28 UTC
@Dirk: which useflags did you use for a successful building?