From c007910a44024451b02d45ba0bb1f7bb7059cc68 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 5 Apr 2022 19:26:32 +0300 Subject: [PATCH] opensubdiv: disable opencl when building cuda --- pkgs/development/libraries/opensubdiv/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/opensubdiv/default.nix b/pkgs/development/libraries/opensubdiv/default.nix index 83eb77b603c..026465c97ae 100644 --- a/pkgs/development/libraries/opensubdiv/default.nix +++ b/pkgs/development/libraries/opensubdiv/default.nix @@ -1,6 +1,10 @@ { config, lib, stdenv, fetchFromGitHub, cmake, pkg-config, xorg, libGLU , libGL, glew, ocl-icd, python3 , cudaSupport ? config.cudaSupport or false, cudatoolkit + # For visibility mostly. The whole approach to cuda architectures and capabilities + # will be reworked soon. +, cudaArch ? "compute_37" +, openclSupport ? !cudaSupport , darwin }: @@ -24,7 +28,7 @@ stdenv.mkDerivation rec { glew xorg.libX11 xorg.libXrandr xorg.libXxf86vm xorg.libXcursor xorg.libXinerama xorg.libXi ] - ++ lib.optional (!stdenv.isDarwin) ocl-icd + ++ lib.optional (openclSupport && !stdenv.isDarwin) ocl-icd ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [OpenCL Cocoa CoreVideo IOKit AppKit AGL ]) ++ lib.optional cudaSupport cudatoolkit; @@ -37,8 +41,10 @@ stdenv.mkDerivation rec { "-DGLEW_INCLUDE_DIR=${glew.dev}/include" "-DGLEW_LIBRARY=${glew.dev}/lib" ] ++ lib.optionals cudaSupport [ - "-DOSD_CUDA_NVCC_FLAGS=--gpu-architecture=compute_30" + "-DOSD_CUDA_NVCC_FLAGS=--gpu-architecture=${cudaArch}" "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc" + ] ++ lib.optionals (!openclSupport) [ + "-DNO_OPENCL=1" ]; postInstall = "rm $out/lib/*.a"; @@ -46,6 +52,7 @@ stdenv.mkDerivation rec { meta = { description = "An Open-Source subdivision surface library"; homepage = "http://graphics.pixar.com/opensubdiv"; + broken = openclSupport && cudaSupport; platforms = lib.platforms.unix; maintainers = [ lib.maintainers.eelco ]; license = lib.licenses.asl20;