From b8c7244baec13d29cb499beb0cfc29fe3eb98422 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Fri, 24 May 2024 20:50:15 +0000 Subject: [PATCH] opencv3: don't build with CUDA newer than 11 --- pkgs/development/libraries/opencv/3.x.nix | 4 +++- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index 140eee9c06e8..adb6532bd682 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -15,7 +15,7 @@ , enableContrib ? true , enableCuda ? config.cudaSupport -, cudaPackages ? { } +, cudaPackages , enableUnfree ? false , enableIpp ? false , enablePython ? false, pythonPackages ? null @@ -295,6 +295,8 @@ stdenv.mkDerivation { meta = with lib; { description = "Open Computer Vision Library with more than 500 algorithms"; homepage = "https://opencv.org/"; + # OpenCV 3 won't build with CUDA 12+ + broken = enableCuda && cudaPackages.cudaAtLeast "12"; license = with licenses; if enableUnfree then unfree else bsd3; maintainers = with maintainers; [mdaiter basvandijk]; platforms = with platforms; linux ++ darwin; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index acc4b8c93379..0862c0595889 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23631,6 +23631,8 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) AVFoundation Cocoa VideoDecodeAcceleration CoreMedia MediaToolbox Accelerate; ffmpeg = ffmpeg_4; + # OpenCV3 won't build with anything newer than CUDA 11 due to API changes. + cudaPackages = cudaPackages_11; }; opencv4 = callPackage ../development/libraries/opencv/4.x.nix {