Katago CUDA version how to use

For discussing go computing, software announcements, etc.
Post Reply
dino1019
Dies in gote
Posts: 26
Joined: Fri Feb 14, 2020 8:05 pm
Rank: ogs 12k
GD Posts: 0
KGS: 12k
Tygem: 12k
IGS: 6k+
Wbaduk: 12k
DGS: 5k
OGS: 10k
Online playing schedule: turn-based only
Has thanked: 11 times
Been thanked: 1 time

Katago CUDA version how to use

Post by dino1019 »

Anyone knows how to set up the environment for running the CUDA version? I have a Windows 10 64 bit + ASUS NVIDIA 2060

If I run this command:

C:/katago-v1.3.3-cuda10.1-windows-x64/katago.exe gtp -config C:/katago-v1.3.3-cuda10.1-windows-x64/gtp_example.cfg -model C:/katago-v1.3.3-cuda10.1-windows-x64/g170e_20b_s243G.bin.gz

It complaints the following two dlls not found: cublas64_10.dll, cudnn64_7.dll

In the katago how to use, it seems not telling us how to install CUDA, CUDNN, TensorFlow, etc..

Anyone shed some light?

Thanks, in advance.
Jæja
Dies in gote
Posts: 61
Joined: Thu Oct 31, 2019 2:42 am
GD Posts: 0
Universal go server handle: Jæja
Has thanked: 12 times
Been thanked: 18 times

Re: Katago CUDA version how to use

Post by Jæja »

For macOS and Linux, I find it easiest to use Anaconda (check out Miniconda for just the package manager, without default packages). I notice you use Windows 10, for which Anaconda has support as well, though I haven't tested this myself.

You can then just install packages using the conda command, for example:

Code: Select all

conda install -c anaconda cudatoolkit cudnn
EDIT: the KataGo GitHub repository refers to two GPU-related dependencies (the ones you seem to be missing): CUDA and CUDNN. If that's all you need, then you could try installing manually. The latest Windows release package is named katago-v1.3.3-cuda10.1-windows-x64.zip so you'll need CUDA version 10.1.

Read this if you run into compatibility issues between your graphics card driver and CUDA. On this page Table 1 shows the minimum supported graphics card driver for CUDA toolkit 10.1 is 418.39, so ensure you have at least that version. If you still have issues, check the supported hardware page. For a GeForce 2060 Ti it shows the compute capability is 7.5. On Table 2 of the previously mentioned page you can see that the hardware generation must be Volta and all mentioned drivers are supported. Also notice that it seems that if you have the latest driver, all generations are supported.

I'm a computer scientist and this is how I go about these things. I try to understand what the different components are supposed to do and how I should install them. I can imagine this is not the easiest way for many people, because of the technical terms, but I hope this helps!
User avatar
ez4u
Oza
Posts: 2414
Joined: Wed Feb 23, 2011 10:15 pm
Rank: Jp 6 dan
GD Posts: 0
KGS: ez4u
Location: Tokyo, Japan
Has thanked: 2351 times
Been thanked: 1332 times

Re: Katago CUDA version how to use

Post by ez4u »

First you should search your machine to check whether you already have those dll's somewhere. I had that cudnn64_7.dll error message. I searched my machine and found that it was there but katago simply was not finding it. I copied it straight to the katago directory rather than trying to fool with paths and such issues. Things ran fine.
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21
dino1019
Dies in gote
Posts: 26
Joined: Fri Feb 14, 2020 8:05 pm
Rank: ogs 12k
GD Posts: 0
KGS: 12k
Tygem: 12k
IGS: 6k+
Wbaduk: 12k
DGS: 5k
OGS: 10k
Online playing schedule: turn-based only
Has thanked: 11 times
Been thanked: 1 time

Re: Katago CUDA version how to use

Post by dino1019 »

ez4u wrote:First you should search your machine to check whether you already have those dll's somewhere. I had that cudnn64_7.dll error message. I searched my machine and found that it was there but katago simply was not finding it. I copied it straight to the katago directory rather than trying to fool with paths and such issues. Things ran fine.
I did searched for the two DLLs, and found nothing.

Now I am downloading CUDA 10.2 from the following page, it's about 1.3G in size:

https://developer.nvidia.com/cuda-downl ... e=exelocal

I will if this works.
dino1019
Dies in gote
Posts: 26
Joined: Fri Feb 14, 2020 8:05 pm
Rank: ogs 12k
GD Posts: 0
KGS: 12k
Tygem: 12k
IGS: 6k+
Wbaduk: 12k
DGS: 5k
OGS: 10k
Online playing schedule: turn-based only
Has thanked: 11 times
Been thanked: 1 time

Re: Katago CUDA version how to use

Post by dino1019 »

I have installed it (cuda_10.2.89_441.22_win10.exe), but only one DLL is found: cublas64_10.dll, but the other is not: cudnn64_7.dll, is there something else to install? Thanks again.
Jæja
Dies in gote
Posts: 61
Joined: Thu Oct 31, 2019 2:42 am
GD Posts: 0
Universal go server handle: Jæja
Has thanked: 12 times
Been thanked: 18 times

Re: Katago CUDA version how to use

Post by Jæja »

dino1019 wrote:I have installed it (cuda_10.2.89_441.22_win10.exe), but only one DLL is found: cublas64_10.dll, but the other is not: cudnn64_7.dll, is there something else to install? Thanks again.
Did you read my post at all?
Jæja wrote:KataGo GitHub repository refers to two GPU-related dependencies (the ones you seem to be missing): CUDA and CUDNN. If that's all you need, then you could try installing manually. The latest Windows release package is named katago-v1.3.3-cuda10.1-windows-x64.zip so you'll need CUDA version 10.1.
You installed the wrong version of CUDA (if you're using the latest KataGo pre-built package) and you didn't install CUDNN.
Last edited by Jæja on Sun Mar 08, 2020 7:05 am, edited 1 time in total.
dino1019
Dies in gote
Posts: 26
Joined: Fri Feb 14, 2020 8:05 pm
Rank: ogs 12k
GD Posts: 0
KGS: 12k
Tygem: 12k
IGS: 6k+
Wbaduk: 12k
DGS: 5k
OGS: 10k
Online playing schedule: turn-based only
Has thanked: 11 times
Been thanked: 1 time

Re: Katago CUDA version how to use

Post by dino1019 »

Jæja wrote:
dino1019 wrote:I have installed it (cuda_10.2.89_441.22_win10.exe), but only one DLL is found: cublas64_10.dll, but the other is not: cudnn64_7.dll, is there something else to install? Thanks again.
Did you read my post at all?
Jæja wrote:KataGo GitHub repository refers to two GPU-related dependencies (the ones you seem to be missing): CUDA and CUDNN. If that's all you need, then you could try installing manually. The latest Windows release package is named katago-v1.3.3-cuda10.1-windows-x64.zip so you'll need CUDA version 10.1.
You installed the wrong version of CUDA (if you're using the latest KataGo pre-built package and you didn't install CUDNN.
Thanks again.

I have copied cudnn64_7.dll from the CUDDN download from NVDIA, and it seems to work with the following command:

C:\Users\User>C:/katago-v1.3.3-cuda10.1-windows-x64/katago.exe gtp -config C:/katago-v1.3.3-cuda10.1-windows-x64/gtp_example.cfg -model C:/katago-v1.3.3-cuda10.1-windows-x64/g170e_20b_s2.43G.bin.gz
KataGo v1.3.3
Loaded model C:/katago-v1.3.3-cuda10.1-windows-x64/g170e_20b_s2.43G.bin.gz
Model name: g170-b20c256x2-s2430231552-d525879064
GTP ready, beginning main protocol loop

Note that the CUDA version installed is 10.2, not 10.1, but since the technical support of Ah-Q says "CUDA 10.1 or above should work", so maybe this is not an issue (see note at the bottom). Still Ah-Q to remotely connect via SSH with Katago/CUDA doesn't work, I have raise this issue to the technical support of Ah-Q again; note again, the remote connection with Katago/OpenCL and with Leela Zero works very well.

(note: the following is about CUDA's versions:
Latest Release
CUDA Toolkit 10.2 (Nov 2019), Versioned Online Documentation
Archived Releases
CUDA Toolkit 10.1 update2 (Aug 2019), Versioned Online Documentation
CUDA Toolkit 10.1 update1 (May 2019), Versioned Online Documentation
CUDA Toolkit 10.1 (Feb 2019), Online Documentation)
Jæja
Dies in gote
Posts: 61
Joined: Thu Oct 31, 2019 2:42 am
GD Posts: 0
Universal go server handle: Jæja
Has thanked: 12 times
Been thanked: 18 times

Re: Katago CUDA version how to use

Post by Jæja »

dino1019 wrote:Note that the CUDA version installed is 10.2, not 10.1, but since the technical support of Ah-Q says "CUDA 10.1 or above should work", so maybe this is not an issue (see note at the bottom). Still Ah-Q to remotely connect via SSH with Katago/CUDA doesn't work
I have no idea what Ah-Q Go has to do with this. Your question was about enabling KataGo to work with CUDA and now the topic switches to Ah-Q Go and connecting over SSH. Your should try to be more precise and remain on-topic, because this keeps things clear and saves a lot of time.

I'm glad it works now! :tmbup:
Gomoto
Gosei
Posts: 1733
Joined: Sun Nov 06, 2016 6:56 am
GD Posts: 0
Location: Earth
Has thanked: 621 times
Been thanked: 310 times

Re: Katago CUDA version how to use

Post by Gomoto »

What are your experiences with the CUDA version? Do you see a great difference in performance? Thank you for your feedback.
And
Gosei
Posts: 1464
Joined: Tue Sep 25, 2018 10:28 am
GD Posts: 0
Has thanked: 212 times
Been thanked: 215 times

Re: Katago CUDA version how to use

Post by And »

"It is possible to compile KataGo against various versions of the CUDA toolkit. ...a short performance test (just the default benchmark really) on each."
https://github.com/lightvector/KataGo/i ... -578684523
dino1019
Dies in gote
Posts: 26
Joined: Fri Feb 14, 2020 8:05 pm
Rank: ogs 12k
GD Posts: 0
KGS: 12k
Tygem: 12k
IGS: 6k+
Wbaduk: 12k
DGS: 5k
OGS: 10k
Online playing schedule: turn-based only
Has thanked: 11 times
Been thanked: 1 time

Re: Katago CUDA version how to use

Post by dino1019 »

Hi all,
As an update, I have successfully configured the CUDA version as part of the whole thing as in the following remote scenario:
1. client: Ah-Q pro, android app, SSH client, GUI to play, analyze and review games, can connect local engine or remote engines, GTP compatible.
2. server: Windows 10 64 bit, SSH server, Leela Zero/GPU, Katago/OpenCL, Katago/CUDA.
3. Both Leela Zero and Katago engines are GTP compatible, so the command lines are quite standard.
4. Leela Zero/GPU, Katago/OpenCL, Katago/CUDA require GPU; Katago/CUDA require NVIDIA GPU. (note that it seems Katago/CUDA is not necessarily faster than Katago/OpenCL)
5. Ah-Q pro has an android version, but not Windows version, and PC version is probably also needed in this (remote) area. Ah-Q can have multiple engines configured, but the engine management is not very friendly, so this is an area for future improvement.
If you have any question or comment about remote engine, please let me know. Go AI is evolving quickly, and can be difficult to non-tech-savvy go players; in the meantime, I don't believe go AI is good enough to serve as a sole teacher to help humans improve; so it's important we help each other out.
Post Reply