Skip to content

opencv{3,4}: move cudatoolkit to propagatedBuildInputs#144157

Merged
r-burns merged 1 commit intoNixOS:masterfrom
tpwrules:opencv_cuda_fix
Nov 4, 2021
Merged

opencv{3,4}: move cudatoolkit to propagatedBuildInputs#144157
r-burns merged 1 commit intoNixOS:masterfrom
tpwrules:opencv_cuda_fix

Conversation

@tpwrules
Copy link
Contributor

@tpwrules tpwrules commented Nov 1, 2021

Motivation for this change

OpenCV's cmake files expect to be able to find the same CUDA toolkit they were built with when building packages that depend on OpenCV, even if they do not use CUDA. Fixes #144054 .

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Nov 1, 2021
@r-burns
Copy link
Contributor

r-burns commented Nov 2, 2021

Technically, cudatoolkit should be a propagatedNativeBuildInput since it runs on the build platform. In any case, this is a clear improvement.

@r-burns r-burns merged commit 7fe522a into NixOS:master Nov 4, 2021
YodaEmbedding added a commit to YodaEmbedding/nixos that referenced this pull request Dec 4, 2021
@tpwrules tpwrules deleted the opencv_cuda_fix branch October 12, 2022 03:17
@hacker1024
Copy link
Member

It seems that #221370 has re-introduced the issue that this solved. @ConnorBaker?

@ConnorBaker
Copy link
Contributor

@hacker1024 I tried to reproduce the failure the original issue had but was unable to with

$ cat ~/.config/nixpkgs/config.nix 
{
  allowUnfree = true;
  cudaSupport = true;
  cudaCapabilities = [ "8.9" ];
  cudaForwardCompat = false;
}
$ nix build --impure -L github:nixos/nixpkgs/7fd504ce341d59b0ae2e8dc4469cc3ce3891eeb8#qimgv

(the commit 7fd504c is from earlier today).

We had some changes in how CMake-based projects handle/use CUDA redistributables which could be preventing this issue from occurring again: #233581.

Do you have a reproducer for the failure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qimgv: cudaSupport

4 participants