Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

changed dlib to actually use cuda properly and switched back to default blas and added lapack to make it easier to override, removed fftw because dlib hasn't supported it since 2015

Signed-off-by: Robbie Buxton <robbiesbuxton@gmail.com>

+54 -17
+46 -14
pkgs/development/libraries/dlib/default.nix
··· 3 3 , fetchFromGitHub 4 4 , cmake 5 5 , pkg-config 6 - , fftw 7 6 , libpng 8 7 , libjpeg 9 8 , libwebp 10 - , openblas 9 + , blas 10 + , lapack 11 + , config 11 12 , guiSupport ? false 12 13 , libX11 13 - 14 - # see http://dlib.net/compile.html 15 14 , sse4Support ? stdenv.hostPlatform.sse4_1Support 16 15 , avxSupport ? stdenv.hostPlatform.avxSupport 17 - , cudaSupport ? true 18 - }: 19 - 20 - stdenv.mkDerivation rec { 16 + , cudaSupport ? config.cudaSupport 17 + , cudaPackages 18 + }@inputs: 19 + (if cudaSupport then cudaPackages.backendStdenv else inputs.stdenv).mkDerivation rec { 21 20 pname = "dlib"; 22 21 version = "19.24.2"; 23 22 24 23 src = fetchFromGitHub { 25 24 owner = "davisking"; 26 25 repo = "dlib"; 27 - rev ="v${version}"; 26 + rev = "v${version}"; 28 27 sha256 = "sha256-Z1fScuaIHjj2L1uqLIvsZ7ARKNjM+iaA8SAtWUTPFZk="; 29 28 }; 30 29 ··· 33 32 ''; 34 33 35 34 cmakeFlags = [ 36 - (lib.cmakeBool "USE_DLIB_USE_CUDA" cudaSupport) 37 35 (lib.cmakeBool "USE_SSE4_INSTRUCTIONS" sse4Support) 38 36 (lib.cmakeBool "USE_AVX_INSTRUCTIONS" avxSupport) 37 + (lib.cmakeBool "DLIB_USE_CUDA" cudaSupport) 38 + ] ++ lib.optionals cudaSupport [ 39 + (lib.cmakeFeature "DLIB_USE_CUDA_COMPUTE_CAPABILITIES" (builtins.concatStringsSep "," (with cudaPackages.flags; map dropDot cudaCapabilities))) 39 40 ]; 40 41 41 - nativeBuildInputs = [ cmake pkg-config ]; 42 + nativeBuildInputs = [ 43 + cmake 44 + pkg-config 45 + ] ++ lib.optionals cudaSupport (with cudaPackages; [ 46 + cuda_nvcc 47 + ]); 42 48 43 49 buildInputs = [ 44 - fftw 45 50 libpng 46 51 libjpeg 47 52 libwebp 48 - openblas 49 - ] ++ lib.optional guiSupport libX11; 53 + blas 54 + lapack 55 + ] 56 + ++ lib.optionals guiSupport [ libX11 ] 57 + ++ lib.optionals config.cudaSupport (with cudaPackages; [ 58 + cuda_cudart.dev 59 + cuda_cudart.lib 60 + cuda_cudart.static 61 + cuda_nvcc.dev 62 + libcublas.dev 63 + libcublas.lib 64 + libcublas.static 65 + libcurand.dev 66 + libcurand.lib 67 + libcurand.static 68 + libcusolver.dev 69 + libcusolver.lib 70 + libcusolver.static 71 + cudnn.dev 72 + cudnn.lib 73 + cudnn.static 74 + cuda_cccl.dev 75 + ]); 76 + 77 + passthru = { 78 + inherit 79 + cudaSupport cudaPackages 80 + sse4Support avxSupport; 81 + }; 50 82 51 83 meta = with lib; { 52 84 description = "A general purpose cross-platform C++ machine learning library";
+8 -3
pkgs/development/python-modules/face-recognition/default.nix
··· 2 2 , fetchPypi 3 3 , lib 4 4 5 - # propagates 5 + # propagates 6 6 , click 7 7 , dlib 8 8 , face-recognition-models 9 9 , numpy 10 10 , pillow 11 11 12 - # tests 12 + # tests 13 13 , pytestCheckHook 14 + , config 15 + , cudaSupport ? config.cudaSupport 14 16 }: 15 17 16 18 buildPythonPackage rec { ··· 18 20 version = "1.3.0"; 19 21 format = "setuptools"; 20 22 21 - src = fetchPypi { 23 + src = fetchPypi { 22 24 pname = "face_recognition"; 23 25 inherit version; 24 26 hash = "sha256-Xl790WhqpWavDTzBMTsTHksZdleo/9A2aebT+tknBew="; ··· 35 37 nativeCheckInputs = [ 36 38 pytestCheckHook 37 39 ]; 40 + 41 + # Disables tests when running with cuda due to https://github.com/NixOS/nixpkgs/issues/225912 42 + doCheck = !config.cudaSupport; 38 43 39 44 meta = with lib; { 40 45 license = licenses.mit;