GithubHelp home page GithubHelp logo

Comments (12)

dje-dev avatar dje-dev commented on July 25, 2024

I assume this procedure was followed? https://github.com/dje-dev/Ceres/blob/main/BuildDLL.md
Key steps:

  1. Replace one c++ file in the LC0 distribution with the version in Ceres source code. Sorry, there is a typo in the instructions, it is network_cudnn.cc and not network_cuda.cc, taken from \src\Ceres.Chess\NNEvaluators\LC0DLL\network_cudnn.cc
  2. Change the c++ project file to output a DLL instead of EXE
    Then build and copy the LC0.DLL to the appropriate directory (if not already there).

from ceres.

cyrenaique avatar cyrenaique commented on July 25, 2024

Thanks a lot for the answer, I actually did that and still have the same issue. I will double check. Thanks again.

from ceres.

eahova avatar eahova commented on July 25, 2024

@cyrenaique - I was having the same issues. I did this to get around the error:

  1. Downloaded cudnn and changed my build paths to be cudnn for cudnn_path (previously I had it as the same as CUDA but then it didn't even use the network_cudnn.cc file in the build process...I could delete that file and it didn't care)
    set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2
    set CUDNN_PATH=C:\Users\e\Downloads\cudnn-11.1-windows-x64-v8.0.5.39\cuda

  2. Commented out the "std::unique_ptr MakeCudaNetworkAuto" method declaration in the network_cuda.cc file. I just slapped a /* */ around it and also took out the 3 REGISTER_NETWORKS at the end..not sure that was needed . It was giving me a build error "Class already defined in src_neural_cuda_network_cudnn.cc.obj"

It seems to build for me now and now doesn't crash when i try "go nodes 10" like the setupexample....

Perhaps someone else has a better solution, or maybe there are some changes needed to the network_cuda.cc file as well that weren't included.

Good luck

from ceres.

gsobala avatar gsobala commented on July 25, 2024

You don't need to build the cuda backend at all, only the cudnn backend. Either edit meson_options.txt and change plain_cuda to false or add SET PLAIN_CUDA=false at the top of build.cmd. That gets rid of the clashes between the two files in src/neural/cuda.

Secondly the current dll build instructions are an unholy mess, partly because nVidia currently have cudnn files for cuda 11.1 but not for 11.2. Its perfectly possible to build lc0.dll just against 11.1 but it will only run if the user has cuda 11.1 libs installed or available runtimes.

from ceres.

eahova avatar eahova commented on July 25, 2024

Thanks for the info. I reverted my changes to network_cuda.cc to try @gsobala suggestions.

  1. add SET PLAIN_CUDA=false at the top of build.cmd --> this didn't seem to work...still got the clash on build
  2. tried to use CUDA\v11.1 instead of CUDA\v11.2 --> for me didn't detect cudnn-11.1 in that v11.1 CUDNN_PATH directory so I assume it would go back to having the missing entry point named 'Alloc' errors
  3. keep CUDNN_PATH pointed to cudnn-11.1 directory, edit meson_options.txt to change plain_cuda to false --> this worked, no clash, built fine

I think it makes sense to clarify the build instructions with these tips:

  1. Edit meson_options.txt to disable plain_cuda (if you get build clashes)
  2. Verify you see that "Library cudnn found: YES" when you run build.cmd (otherwise it isn't going to build the new files)

from ceres.

dje-dev avatar dje-dev commented on July 25, 2024

Thank you all for the clarifications. To be frank I don't understand these build issues very well. I will add the suggested tips.

The LC0.DLL code is not particularly clean or elegant (but does work flawlessly if you can get it to build). I have not invested a lot of time here because I'm hoping the LC0 developers will create an API to make the backends reusable by any engine, not just Ceres. They are a gem (very well tuned and run on many different types of hardware). If that happens, they will do so with a better design and better C++ project build skills than I have.

from ceres.

AlexanderSWilliams avatar AlexanderSWilliams commented on July 25, 2024

I followed eahova's steps and am receiving the same error. The only obvious difference is that I installed CUDA 11.2 because I do not have an older version of the installer. Library cudnn is found and I edited the meson_options.txt file. Is there anything else I should try?

from ceres.

eahova avatar eahova commented on July 25, 2024

I followed eahova's steps and am receiving the same error. The only obvious difference is that I installed CUDA 11.2 because I do not have an older version of the installer. Library cudnn is found and I edited the meson_options.txt file. Is there anything else I should try?

Are you getting the build error (code clash) or the runtime error (unable to find "alloc")?

from ceres.

AlexanderSWilliams avatar AlexanderSWilliams commented on July 25, 2024

from ceres.

eahova avatar eahova commented on July 25, 2024

You want to make sure it is compiling using the new network_cudnn.cc file. One thing to try is to make certain it is actually using the file in the build.

Go rename that file so it no longer exists as "network_cudnn.cc" and then rebuild the solution....if it still builds fine even without that file then you know what the problem is....

You might also want to verify that the cudnn directory is in your PATH so Visual Studios can find it....

from ceres.

AlexanderSWilliams avatar AlexanderSWilliams commented on July 25, 2024

Does anyone know the commit hash of the lc0 project where network_cudnn.cc was forked from? The diffs of the most current versions are rather substantial.

from ceres.

AlexanderSWilliams avatar AlexanderSWilliams commented on July 25, 2024

I got past that error with "network_cudnn.cc". However, I'm opening a new issue for a new problem I'm running into.

from ceres.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.