From 9d7a579b2e8fd4c28861e4a3d4082e458bad68bf Mon Sep 17 00:00:00 2001 From: Michael Reilly Date: Sun, 23 Aug 2020 17:00:52 -0400 Subject: [PATCH] katago: 1.5.0 -> 1.6.0 --- pkgs/games/katago/default.nix | 32 +++++++++++++++++++++++--------- pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/pkgs/games/katago/default.nix b/pkgs/games/katago/default.nix index 492ccbb63abf..c0fe7d282251 100644 --- a/pkgs/games/katago/default.nix +++ b/pkgs/games/katago/default.nix @@ -13,17 +13,25 @@ , opencl-headers ? null , ocl-icd ? null , gperftools ? null +, eigen ? null +, gpuEnabled ? true +, useAVX2 ? false , cudaSupport ? false , useTcmalloc ? true}: +assert !gpuEnabled -> ( + eigen != null && + !cudaSupport); + assert cudaSupport -> ( libGL_driver != null && cudatoolkit != null && cudnn != null); assert !cudaSupport -> ( - opencl-headers != null && - ocl-icd != null); + !gpuEnabled || ( + opencl-headers != null && + ocl-icd != null)); assert useTcmalloc -> ( gperftools != null); @@ -35,13 +43,13 @@ let in env.mkDerivation rec { pname = "katago"; - version = "1.5.0"; + version = "1.6.0"; src = fetchFromGitHub { owner = "lightvector"; repo = "katago"; - rev = "${version}"; - sha256 = "0ajdjdmlzwh7zwk5v0k9zzjawgkf7w30pzqp5bhcsdqz4svvyll2"; + rev = "v${version}"; + sha256 = "1r84ws2rj7j8085v1cqffy9rg65rzrhk6z8jbxivqxsmsgs2zs48"; }; nativeBuildInputs = [ @@ -52,10 +60,12 @@ in env.mkDerivation rec { buildInputs = [ libzip boost - ] ++ lib.optionals cudaSupport [ + ] ++ lib.optionals (!gpuEnabled) [ + eigen + ] ++ lib.optionals (gpuEnabled && cudaSupport) [ cudnn libGL_driver - ] ++ lib.optionals (!cudaSupport) [ + ] ++ lib.optionals (gpuEnabled && !cudaSupport) [ opencl-headers ocl-icd ] ++ lib.optionals useTcmalloc [ @@ -64,9 +74,13 @@ in env.mkDerivation rec { cmakeFlags = [ "-DNO_GIT_REVISION=ON" - ] ++ lib.optionals cudaSupport [ + ] ++ lib.optionals (!gpuEnabled) [ + "-DUSE_BACKEND=EIGEN" + ] ++ lib.optionals useAVX2 [ + "-DUSE_AVX2=ON" + ] ++ lib.optionals (gpuEnabled && cudaSupport) [ "-DUSE_BACKEND=CUDA" - ] ++ lib.optionals (!cudaSupport) [ + ] ++ lib.optionals (gpuEnabled && !cudaSupport) [ "-DUSE_BACKEND=OPENCL" ] ++ lib.optionals useTcmalloc [ "-DUSE_TCMALLOC=ON" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 878615936ce5..65e64e8a85f1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24383,6 +24383,10 @@ in cudatoolkit = cudatoolkit_10_2; }; + katagoCPU = katago.override { + gpuEnabled = false; + }; + klavaro = callPackage ../games/klavaro {}; kobodeluxe = callPackage ../games/kobodeluxe { };