Skip to content

Commit

Permalink
katago: 1.5.0 -> 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OmnipotentEntity committed Aug 24, 2020
1 parent f9a5d85 commit 9d7a579
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
32 changes: 23 additions & 9 deletions pkgs/games/katago/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 = [
Expand All @@ -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 [
Expand All @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24383,6 +24383,10 @@ in
cudatoolkit = cudatoolkit_10_2;
};

katagoCPU = katago.override {
gpuEnabled = false;
};

klavaro = callPackage ../games/klavaro {};

kobodeluxe = callPackage ../games/kobodeluxe { };
Expand Down

0 comments on commit 9d7a579

Please sign in to comment.