SabakiHQ / Sabaki

An elegant Go board and SGF editor for a more civilized age.
https://sabaki.yichuanshen.de/
MIT License
2.41k stars 377 forks source link

Leela zero not working (GTP engine connection error) #629

Closed romton843 closed 4 years ago

romton843 commented 4 years ago

Hi, I can't figure out why I can't make the whole thing working. Could someone please help me out?

Here are my settings: Leela Zero

‪C:\leela-zero\leelaz.exe
--gtp -w C:\leela-zero\networks\c1a5dea7db8f006773ffd6b1914c7b8a9d6593b681f3f1294c426184be0d46f2.gz --noponder
time_settings 0 5 1

The network file has been created using leela zero autogtp.exe which works perfectly (playing moves) and the same Leela zero is working in Lizzie.

Here is what the console gives me back:

● Leela Zero> name 
connection failed
● Leela Zero> version 
connection failed
● Leela Zero> protocol_version 
connection failed
● Leela Zero> list_commands 
connection failed
● Leela Zero> time_settings 0 5 1
connection failed
● Leela Zero> komi 0.5
connection failed
● Leela Zero> genmove W
connection failed
yishn commented 4 years ago

Try executing your command in the command line. What does it say?

romton843 commented 4 years ago

So, I typed that in the command line (I didn't put the time_settings 0 5 1 because I didn't know how to add it):

C:\leela-zero\leelaz.exe --gtp -w C:\leela-zero\networks\c1a5dea7db8f006773ffd6b1914c7b8a9d6593b681f3f1294c426184be0d46f2.gz --noponder

It returned me that and after a while it seemed to stop moving on but in Sabaki, the error message pops up right away, no time to try anything:

Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\Romain Guimard>C:\leela-zero\leelaz.exe --gtp -w C:\leela-zero\networks\c1a5dea7db8f006773ffd6b1914c7b8a9d6593b681f3f1294c426184be0d46f2.gz --noponder
Using OpenCL batch size of 5
Using 10 thread(s).
RNG seed: 5106514745427528980
BLAS Core: Haswell
Detecting residual layers...v1...256 channels...40 blocks.
Initializing OpenCL (autodetecting precision).
Detected 2 OpenCL platforms.
Platform version: OpenCL 2.1
Platform profile: FULL_PROFILE
Platform name:    Intel(R) OpenCL
Platform vendor:  Intel(R) Corporation
Device ID:     0
Device name:   Intel(R) UHD Graphics 630
Device type:   GPU
Device vendor: Intel(R) Corporation
Device driver: 26.20.100.7262
Device speed:  1100 MHz
Device cores:  24 CU
Device score:  621
Device ID:     1
Device name:   Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Device type:   CPU
Device vendor: Intel(R) Corporation
Device driver: 7.6.0.0814
Device speed:  2200 MHz
Device cores:  12 CU
Device score:  521
Platform version: OpenCL 1.2 CUDA 10.2.131
Platform profile: FULL_PROFILE
Platform name:    NVIDIA CUDA
Platform vendor:  NVIDIA Corporation
Device ID:     2
Device name:   GeForce GTX 1050 Ti with Max-Q Design
Device type:   GPU
Device vendor: NVIDIA Corporation
Device driver: 442.19
Device speed:  1417 MHz
Device cores:  6 CU
Device score:  1112
Selected platform: NVIDIA CUDA
Selected device: GeForce GTX 1050 Ti with Max-Q Design
with OpenCL 1.2 capability.
Half precision compute support: No.
Tensor Core support: No.
Detected 2 OpenCL platforms.
Platform version: OpenCL 2.1
Platform profile: FULL_PROFILE
Platform name:    Intel(R) OpenCL
Platform vendor:  Intel(R) Corporation
Device ID:     0
Device name:   Intel(R) UHD Graphics 630
Device type:   GPU
Device vendor: Intel(R) Corporation
Device driver: 26.20.100.7262
Device speed:  1100 MHz
Device cores:  24 CU
Device score:  621
Device ID:     1
Device name:   Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Device type:   CPU
Device vendor: Intel(R) Corporation
Device driver: 7.6.0.0814
Device speed:  2200 MHz
Device cores:  12 CU
Device score:  521
Platform version: OpenCL 1.2 CUDA 10.2.131
Platform profile: FULL_PROFILE
Platform name:    NVIDIA CUDA
Platform vendor:  NVIDIA Corporation
Device ID:     2
Device name:   GeForce GTX 1050 Ti with Max-Q Design
Device type:   GPU
Device vendor: NVIDIA Corporation
Device driver: 442.19
Device speed:  1417 MHz
Device cores:  6 CU
Device score:  1112
Selected platform: NVIDIA CUDA
Selected device: GeForce GTX 1050 Ti with Max-Q Design
with OpenCL 1.2 capability.
Half precision compute support: No.
Tensor Core support: No.

Started OpenCL SGEMM tuner.
Will try 290 valid configurations.
(1/290) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=32 NDIMB=16 NDIMC=16 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=4 0.6123 ms (963.3 GFLOPS)
(7/290) KWG=32 KWI=2 MDIMA=8 MDIMC=8 MWG=64 NDIMB=8 NDIMC=8 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=2 0.6060 ms (973.3 GFLOPS)
(10/290) KWG=32 KWI=8 MDIMA=8 MDIMC=8 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=2 0.6040 ms (976.5 GFLOPS)
(12/290) KWG=16 KWI=8 MDIMA=8 MDIMC=8 MWG=32 NDIMB=8 NDIMC=8 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=4 0.5142 ms (1147.1 GFLOPS)
(88/290) KWG=32 KWI=8 MDIMA=8 MDIMC=8 MWG=32 NDIMB=16 NDIMC=16 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=4 0.5009 ms (1177.4 GFLOPS)
(93/290) KWG=16 KWI=8 MDIMA=8 MDIMC=8 MWG=64 NDIMB=8 NDIMC=8 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=4 0.4692 ms (1257.1 GFLOPS)
(94/290) KWG=32 KWI=2 MDIMA=16 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=4 0.3980 ms (1482.0 GFLOPS)
(127/290) KWG=16 KWI=8 MDIMA=16 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=2 0.3844 ms (1534.4 GFLOPS)
(147/290) KWG=32 KWI=8 MDIMA=16 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=2 0.3699 ms (1594.5 GFLOPS)
(191/290) KWG=16 KWI=8 MDIMA=16 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=4 0.3682 ms (1601.9 GFLOPS)
Wavefront/Warp size: 32
Max workgroup size: 1024
Max workgroup dimensions: 1024 1024 64

Started OpenCL SGEMM tuner.
Will try 290 valid configurations.
(1/290) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=32 NDIMB=16 NDIMC=16 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=4 0.6233 ms (946.4 GFLOPS)
(2/290) KWG=32 KWI=2 MDIMA=8 MDIMC=8 MWG=64 NDIMB=16 NDIMC=16 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=4 0.4705 ms (1253.6 GFLOPS)
(21/290) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=64 NDIMB=16 NDIMC=16 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=4 0.4694 ms (1256.5 GFLOPS)
(61/290) KWG=16 KWI=8 MDIMA=8 MDIMC=8 MWG=64 NDIMB=8 NDIMC=8 NWG=64 SA=1 SB=1 STRM=0 STRN=0 TCE=0 VWM=4 VWN=2 0.4550 ms (1296.2 GFLOPS)
Wavefront/Warp size: 32
Max workgroup size: 1024
Max workgroup dimensions: 1024 1024 64
Using OpenCL single precision (less than 5% slower than half).
Detected 2 OpenCL platforms.
Platform version: OpenCL 2.1
Platform profile: FULL_PROFILE
Platform name:    Intel(R) OpenCL
Platform vendor:  Intel(R) Corporation
Device ID:     0
Device name:   Intel(R) UHD Graphics 630
Device type:   GPU
Device vendor: Intel(R) Corporation
Device driver: 26.20.100.7262
Device speed:  1100 MHz
Device cores:  24 CU
Device score:  621
Device ID:     1
Device name:   Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Device type:   CPU
Device vendor: Intel(R) Corporation
Device driver: 7.6.0.0814
Device speed:  2200 MHz
Device cores:  12 CU
Device score:  521
Platform version: OpenCL 1.2 CUDA 10.2.131
Platform profile: FULL_PROFILE
Platform name:    NVIDIA CUDA
Platform vendor:  NVIDIA Corporation
Device ID:     2
Device name:   GeForce GTX 1050 Ti with Max-Q Design
Device type:   GPU
Device vendor: NVIDIA Corporation
Device driver: 442.19
Device speed:  1417 MHz
Device cores:  6 CU
Device score:  1112
Selected platform: NVIDIA CUDA
Selected device: GeForce GTX 1050 Ti with Max-Q Design
with OpenCL 1.2 capability.
Half precision compute support: No.
Tensor Core support: No.
Loaded existing SGEMM tuning.
Wavefront/Warp size: 32
Max workgroup size: 1024
Max workgroup dimensions: 1024 1024 64
Setting max tree size to 3736 MiB and cache size to 415 MiB.
romton843 commented 4 years ago

I can't make Katago work neither, same thing happening.

yang-james commented 4 years ago

I have exactly the same problem. This is my engine setting. image Try to start the engine: image

According to task manager, leelaz.exe is not even executed.

romton843 commented 4 years ago

Thank you, I feel less lonely now. I was wondering if it was a matter of Sabaki or Leela not being allowed to run commands and I tried to give them all rights but no success.

yang-james commented 4 years ago

I spent more time trying. I downloaded CPU only version of leela zero and it worked fine under Sabaki. I also used process monitor to track why Sabaki does nor run the GPU version of leela zero. Finally, I decide to rename the folder for leela zero from "leela-zero-0.17-win64" to something else, then Sabaki is now able to run leela zero. I still don't understand what is wrong with the folder name "leela-zero-0.17-win64" but at least the we have a solution.

romton843 commented 4 years ago

I tried to rename the folder, to put it in different places on my drive but still doesn't work. I'll try the CPU version.

romton843 commented 4 years ago

So, Leela zero CPU version works with Sabaki, that's a lead, isn't it? Leela zero GPU version works with Lizzie and ELF CPU and GPU both work with Sabaki. I still get the "GTP engine connection error" for Leela zero GPU and Katago in Sabaki but they work when I type the command line in the command prompt.

Gargantuar314 commented 4 years ago

I think I solved it.

You have to leave out the path to the neural net:

C:\leela-zero\leelaz.exe
--gtp -w networks\c1a5dea7db8f006773ffd6b1914c7b8a9d6593b681f3f1294c426184be0d46f2.gz --noponder
time_settings 0 5 1

Because Sabaki will use your information to input into command line, thus writing the path twice is weird if you alredy changed into the directory, I think.

Hope it helps.

BTW: KataGo is still not working for me, any help? Thx

romton843 commented 4 years ago

Thank you Gargantuar314 but it doesn't work for me. Actually, since Leela CPU is working now, I tried both (with or without C:\leela-zero\ before network) and both work for Leela CPU and both don't for Leela GPU. And still no KataGo. I'm no expert but it seems that there is a problem of communication with the GPU through Sabaki because Leela GPU works in command line. Thank you for stepping in though.

yishn commented 4 years ago

I'm closing this due to inactivity.

aabbcczz commented 3 years ago

I met the same problem, not sure if Sabaki latest version has been tested with Leela zero 0.17

apetresc commented 3 years ago

@aabbcczz Yup, it definitely works with LZ 0.17 if you have the path and flags set correctly.