Merge pull request #96384 from OmnipotentEntity/katago-1.6.1

katago: 1.6.0 -> 1.6.1
This commit is contained in:
Michele Guerini Rocco 2020-08-28 23:45:34 +02:00 committed by GitHub
commit a8b95d8b00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 26 deletions

View File

@ -14,42 +14,43 @@
, ocl-icd ? null , ocl-icd ? null
, gperftools ? null , gperftools ? null
, eigen ? null , eigen ? null
, gpuEnabled ? true , enableAVX2 ? false
, useAVX2 ? false , enableBigBoards ? false
, cudaSupport ? false , enableCuda ? false
, useTcmalloc ? true}: , enableGPU ? true
, enableTcmalloc ? true}:
assert !gpuEnabled -> ( assert !enableGPU -> (
eigen != null && eigen != null &&
!cudaSupport); !enableCuda);
assert cudaSupport -> ( assert enableCuda -> (
libGL_driver != null && libGL_driver != null &&
cudatoolkit != null && cudatoolkit != null &&
cudnn != null); cudnn != null);
assert !cudaSupport -> ( assert !enableCuda -> (
!gpuEnabled || ( !enableGPU || (
opencl-headers != null && opencl-headers != null &&
ocl-icd != null)); ocl-icd != null));
assert useTcmalloc -> ( assert enableTcmalloc -> (
gperftools != null); gperftools != null);
let let
env = if cudaSupport env = if enableCuda
then gcc8Stdenv then gcc8Stdenv
else stdenv; else stdenv;
in env.mkDerivation rec { in env.mkDerivation rec {
pname = "katago"; pname = "katago";
version = "1.6.0"; version = "1.6.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "lightvector"; owner = "lightvector";
repo = "katago"; repo = "katago";
rev = "v${version}"; rev = "v${version}";
sha256 = "1r84ws2rj7j8085v1cqffy9rg65rzrhk6z8jbxivqxsmsgs2zs48"; sha256 = "030ff9prnvpadgcb4x4hx6b6ggg10bwqcj8vd8nwrdz9sjq67yf7";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
@ -60,42 +61,44 @@ in env.mkDerivation rec {
buildInputs = [ buildInputs = [
libzip libzip
boost boost
] ++ lib.optionals (!gpuEnabled) [ ] ++ lib.optionals (!enableGPU) [
eigen eigen
] ++ lib.optionals (gpuEnabled && cudaSupport) [ ] ++ lib.optionals (enableGPU && enableCuda) [
cudnn cudnn
libGL_driver libGL_driver
] ++ lib.optionals (gpuEnabled && !cudaSupport) [ ] ++ lib.optionals (enableGPU && !enableCuda) [
opencl-headers opencl-headers
ocl-icd ocl-icd
] ++ lib.optionals useTcmalloc [ ] ++ lib.optionals enableTcmalloc [
gperftools gperftools
]; ];
cmakeFlags = [ cmakeFlags = [
"-DNO_GIT_REVISION=ON" "-DNO_GIT_REVISION=ON"
] ++ lib.optionals (!gpuEnabled) [ ] ++ lib.optionals (!enableGPU) [
"-DUSE_BACKEND=EIGEN" "-DUSE_BACKEND=EIGEN"
] ++ lib.optionals useAVX2 [ ] ++ lib.optionals enableAVX2 [
"-DUSE_AVX2=ON" "-DUSE_AVX2=ON"
] ++ lib.optionals (gpuEnabled && cudaSupport) [ ] ++ lib.optionals (enableGPU && enableCuda) [
"-DUSE_BACKEND=CUDA" "-DUSE_BACKEND=CUDA"
] ++ lib.optionals (gpuEnabled && !cudaSupport) [ ] ++ lib.optionals (enableGPU && !enableCuda) [
"-DUSE_BACKEND=OPENCL" "-DUSE_BACKEND=OPENCL"
] ++ lib.optionals useTcmalloc [ ] ++ lib.optionals enableTcmalloc [
"-DUSE_TCMALLOC=ON" "-DUSE_TCMALLOC=ON"
] ++ lib.optionals enableBigBoards [
"-DUSE_BIGGER_BOARDS_EXPENSIVE=ON"
]; ];
preConfigure = '' preConfigure = ''
cd cpp/ cd cpp/
'' + lib.optionalString cudaSupport '' '' + lib.optionalString enableCuda ''
export CUDA_PATH="${cudatoolkit}" export CUDA_PATH="${cudatoolkit}"
export EXTRA_LDFLAGS="-L/run/opengl-driver/lib" export EXTRA_LDFLAGS="-L/run/opengl-driver/lib"
''; '';
installPhase = '' installPhase = ''
mkdir -p $out/bin; cp katago $out/bin; mkdir -p $out/bin; cp katago $out/bin;
'' + lib.optionalString cudaSupport '' '' + lib.optionalString enableCuda ''
wrapProgram $out/bin/katago \ wrapProgram $out/bin/katago \
--prefix LD_LIBRARY_PATH : "/run/opengl-driver/lib" --prefix LD_LIBRARY_PATH : "/run/opengl-driver/lib"
''; '';

View File

@ -24691,13 +24691,13 @@ in
katago = callPackage ../games/katago { }; katago = callPackage ../games/katago { };
katagoWithCuda = katago.override { katagoWithCuda = katago.override {
cudaSupport = true; enableCuda = true;
cudnn = cudnn_cudatoolkit_10_2; cudnn = cudnn_cudatoolkit_10_2;
cudatoolkit = cudatoolkit_10_2; cudatoolkit = cudatoolkit_10_2;
}; };
katagoCPU = katago.override { katagoCPU = katago.override {
gpuEnabled = false; enableGPU = false;
}; };
klavaro = callPackage ../games/klavaro {}; klavaro = callPackage ../games/klavaro {};