Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

katago: 1.3.5 -> 1.4.2 #87676

Merged
merged 1 commit into from May 24, 2020
Merged

katago: 1.3.5 -> 1.4.2 #87676

merged 1 commit into from May 24, 2020

Conversation

OmnipotentEntity
Copy link
Contributor

Motivation for this change

Version bump

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@OmnipotentEntity
Copy link
Contributor Author

OmnipotentEntity commented May 12, 2020

Request for help.

Current version of katagoWithCuda no longer builds. Neither does this version.

The error received is during CMake's configure stage:

-- Check for working CUDA compiler: /nix/store/nzns9piy85q1x5hy43qgp5vny2qzwm1x-cudatoolkit-10.2.89/bin/nvcc
-- Check for working CUDA compiler: /nix/store/nzns9piy85q1x5hy43qgp5vny2qzwm1x-cudatoolkit-10.2.89/bin/nvcc - broken
CMake Error at /nix/store/fi94pv0wrajzx7bjxdabz1dk5nrf4dpb-cmake-3.17.0/share/cmake-3.17/Modules/CMakeTestCUDACompiler.cmake:46 (message):
  The CUDA compiler

    "/nix/store/nzns9piy85q1x5hy43qgp5vny2qzwm1x-cudatoolkit-10.2.89/bin/nvcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /build/source/cpp/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/nix/store/998ykzc5mazwak08hxayqmyqkyz18fcb-gnumake-4.2.1/bin/make cmTC_3083c/fast && /nix/store/998ykzc5mazwak08hxayqmyqkyz18fcb-gnumake-4.2.1/bin/make -f CMakeFiles/cmTC_3083c.dir/build.make CMakeFiles/cmTC_3083c.dir/build
    make[1]: Entering directory '/build/source/cpp/build/CMakeFiles/CMakeTmp'
    Building CUDA object CMakeFiles/cmTC_3083c.dir/main.cu.o
    /nix/store/nzns9piy85q1x5hy43qgp5vny2qzwm1x-cudatoolkit-10.2.89/bin/nvcc -forward-unknown-to-host-compiler   -cudart shared    -x cu -c /build/source/cpp/build/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_3083c.dir/main.cu.o
    Linking CUDA executable cmTC_3083c
    /nix/store/fi94pv0wrajzx7bjxdabz1dk5nrf4dpb-cmake-3.17.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3083c.dir/link.txt --verbose=1
    /nix/store/nr6f7jmhrxb4plz8n535s7fwymq0vns0-gcc-wrapper-7.5.0/bin/g++   CMakeFiles/cmTC_3083c.dir/main.cu.o -o cmTC_3083c  -lcudadevrt -lcudart_static  -L"/nix/store/nzns9piy85q1x5hy43qgp5vny2qzwm1x-cudatoolkit-10.2.89/targets/x86_64-linux/lib/stubs" -L"/nix/store/nzns9piy85q1x5hy43qgp5vny2qzwm1x-cudatoolkit-10.2.89/targets/x86_64-linux/lib" -lcudadevrt -lcudart
    /nix/store/3b3ighb83nhifa1v4n7855hlbdl1mhf9-binutils-2.31.1/bin/ld: /nix/store/8b71qygfrmbl9scwk83d5b589ghlhgbq-cudatoolkit-10.2.89-lib/lib/libcudart_static.a(libcudart_static.a.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
    /nix/store/3b3ighb83nhifa1v4n7855hlbdl1mhf9-binutils-2.31.1/bin/ld: /nix/store/bwzra330vib0ik4d3l8rq6gp6y2ah1fr-glibc-2.30/lib/libdl.so.2: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    make[1]: *** [CMakeFiles/cmTC_3083c.dir/build.make:104: cmTC_3083c] Error 1
    make[1]: Leaving directory '/build/source/cpp/build/CMakeFiles/CMakeTmp'
    make: *** [Makefile:138: cmTC_3083c/fast] Error 2

I encountered this error last time around, and I remember it being a compiler version issue, which is why I was on gcc8Stdenv for the CUDA build. This leads me to believe that there's perhaps an ABI mismatch between the new version of GCC (8.4.0) and the version that was available when this program was initially packaged (8.3.0).

Because ofBorg and hydra won't build Cuda stuff, this won't fail any of the automatic tests.

Soliciting ideas.

@OmnipotentEntity
Copy link
Contributor Author

I've pinned the issue down to a difference between cmake versions.

CMake 3.16.3 works, whereas 3.17.0 does not.

@OmnipotentEntity OmnipotentEntity marked this pull request as ready for review May 13, 2020 22:12
@OmnipotentEntity
Copy link
Contributor Author

Now everything works after a workaround patch to CMakeLists.txt.

Copy link
Contributor

@rnhmjoj rnhmjoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried downgrading cmake instead of patching? You could try cmake_2_8 which already has a top-level attribute. I don't know if it's too old, though.

In any case, I would wait for upstream to comment on the bug before accepting the patch.

pkgs/games/katago/default.nix Show resolved Hide resolved
@OmnipotentEntity
Copy link
Contributor Author

Unfortunately, minimum CMake version required is 3.10.2

@OmnipotentEntity OmnipotentEntity force-pushed the katago-1.4.1 branch 2 times, most recently from e5ae9cc to 59f214f Compare May 18, 2020 15:16
@OmnipotentEntity
Copy link
Contributor Author

Changed the patch to CMake-dev recommended solution, changed patch = changed sha = new push.

@rnhmjoj
Copy link
Contributor

rnhmjoj commented May 18, 2020

@GrahamcOfBorg build katago

Copy link
Contributor

@rnhmjoj rnhmjoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the CMake devs comment, this is the correct solution.

@rnhmjoj rnhmjoj merged commit 919b055 into NixOS:master May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants