Notifications
Clear all

Using eGPU for Chess  

  RSS

OliverB
(@oliverb)
Noble Member
Joined: 2 years ago
 

Hello,

I am totally stunned because of my discovery. Perhaps some of you know that I am the author of the chess engine OliThink. It was quite well known, because it had some unique approaches regarding chess engines, many years ago.

Now I detected Leela Chess Zero, a self learning chess program which doesn't have any chess knowledge except the basic rules. This goes in the direction of my chess engine "OliThink".

The best part is: Leela Chess Zero uses eGPU and it makes it very, very strong.

On my computer with a dGPU Radeon Pro 560X and eGPU Radeon RX 570 Leela Chess Zero dominated a game against the best best chess engine of the world, "Stockfish"

It can use every gpu which is attached, in this case the command was:

./lc0 --backend=multiplexing --backend-opts='(gpu=2,backend=opencl),(gpu=3,backend=opencl)'

They say that with CUDA it is even stronger. (which is a big pity for Mojave or Catalina).

Lc0 vs Stockfish

 

 

 

 

 

This topic was modified 5 months ago

2018 15" MBP & 2015 13" MBP connected to RTX2080Ti GTX1080Ti GTX1080 Vega56 RX580 R9-290 GTX680

 
2018 15" MacBook Pro (RP560X) [8th,6C,H] + RX 5700 XT @ 32Gbps-TB3 (ASUS XG Station Pro) + Win10 & macOS 10.15.4 [build link]  


ReplyQuote
Topic Tags
OliverB
(@oliverb)
Noble Member
Joined: 2 years ago
 

Some more background about chess engines:

When I started programming chess engines in the year 1996, human were still stronger. The ELO rating of the best human is 2700 (as it is today), the best chess engines were 2600, OliThink is about 2400. A ELO difference of 100 points is already a sign for a much stronger player. A typical club player (like myself) has ELO 1700, which still is much better than a player, who just knows the rules with 800.

Meanwhile things have changed, Stockfish and Leelo Chess Zero do have ELO ratings about 3600. Stockfish does have a lot of chess knowledge from the programming, but Leelo Chess Zero does not. It just has the power of eGPUs 😉

2018 15" MBP & 2015 13" MBP connected to RTX2080Ti GTX1080Ti GTX1080 Vega56 RX580 R9-290 GTX680

 
2018 15" MacBook Pro (RP560X) [8th,6C,H] + RX 5700 XT @ 32Gbps-TB3 (ASUS XG Station Pro) + Win10 & macOS 10.15.4 [build link]  


itsage liked
ReplyQuote
OliverB
(@oliverb)
Noble Member
Joined: 2 years ago
 

Hello dear community, I have some information:
First of all the Lc0 benchmarks for different OpenCL GPUs:

Intel UHD 630: 325
Radeon Pro 560X: 1301
Radeon RX 570: 2346
GTX 1080 Ti: 4453

The interesting part is, when you combine two or more CPUs, there is the interesting fact, that not every combination yields better result, especially when more than two GPUs are being used. The best result, so far is:

GTX 1080 Ti + Radeon RX 570 (OpenCL): 6908
Benchmark final time 10.0896s calculating 6908.48 nodes per second.

This looks promising but actually it isn't. Because I was successful in compiling Leelo Chess Zero with CUDA Support for MacOSX and the result is amazing:

./lc0 benchmark --backend=cudnn
GTX 1080 Ti (CUDA): 40938
Benchmark final time 10.0133s calculating 40937.8 nodes per second.

It means that CUDA is about 9 times (900%) more effective in calculation than OpenCL. It also means, that you lose a lot of calculation power once you upgrade you MacOSX to Mojave or Catalina, because they do no support CUDA.

 

PS: Any Combination with other OpenCL Gpus lowers the score:

./lc0 benchmark --backend=multiplexing --backend-opts='(backend=cudnn),(gpu=2,backend=opencl)'
Benchmark final time 10.1303s calculating 31887.1 nodes per second.

 

@itsage: Is Chess an interesting application for the eGPU community?

2018 15" MBP & 2015 13" MBP connected to RTX2080Ti GTX1080Ti GTX1080 Vega56 RX580 R9-290 GTX680

 
2018 15" MacBook Pro (RP560X) [8th,6C,H] + RX 5700 XT @ 32Gbps-TB3 (ASUS XG Station Pro) + Win10 & macOS 10.15.4 [build link]  


ReplyQuote
OliverB
(@oliverb)
Noble Member
Joined: 2 years ago
 

Here is a match between LC0 (0.42.1) and Stockfish 11. It's quite typical, LC0 dominating midgame but doing strange things in the endgame. This happens when you have hardly any chess knowledge. The match was win since about move 35, but still neede 160 more moves :/

 

1. e4 {+0.30/6} c5 {+0.11/26 9} 2. Nf3 {+0.29/10 2.9} d6 {+0.06/25 3} 3. d4
{+0.30/9 2.8} cxd4 {+0.10/26 0.1} 4. Nxd4 {+0.33/9 2.1} Nf6 {+0.11/23 4} 5.
Nc3 {+0.30/9 1.0} a6 {+0.17/20 0.3} 6. f3 {+0.27/8 9} e5 {+0.53/21 1.7} 7.
Nb3 {+0.25/10 0.6} Be7 {+0.44/23 4} 8. Be3 {+0.27/10 2.5} Be6
{+0.44/23 1.3} 9. Qd2 {+0.28/11 1.8} Nbd7 {+0.65/23 4} 10. g4 {+0.33/9 5}
O-O {+0.14/26 9} 11. g5 {+0.42/10 4} Nh5 {+0.00/22 1.7} 12. O-O-O
{+0.44/9 1.0} Nb6 {+0.00/27 5} 13. Rg1 {+0.46/8 10} Rc8 {+0.00/30 1.4} 14.
Kb1 {+0.46/8 1.8} g6 {+0.00/27 0.9} 15. h4 {+0.51/8 3} Qc7 {+0.00/28 13}
16. Qf2 {+0.35/10 4} Nc4 {+0.00/27 0.3} 17. Bxc4 {+0.34/11 0.7} Bxc4
{-0.15/30 3} 18. Bb6 {+0.51/11 1.8} Qb8 {+0.08/25 0.3} 19. Qd2 {+0.46/8 7}
Be6 {+0.00/29 0.1} 20. Nd5 {+0.45/9 2.9} Bxd5 {+0.00/30 1.6} 21. Qxd5
{+0.45/10 1.3} Rc6 {+0.00/29 2.1} 22. Be3 {+0.43/9 1.2} Qc8 {+0.00/24 1.6}
23. Na5 {+0.46/14 5} Rxc2 {+0.27/25 1.7} 24. Qxb7 {+0.48/14 1.2} Rh2
{+0.00/27 4} 25. Qxc8 {+0.49/10 5} Rxc8 {+0.13/26 1.8} 26. Rc1 {+0.44/13 3}
Rxc1+ {+0.00/23 1.6} 27. Rxc1 {+0.50/15 1.3} Rxh4 {+0.00/26 0.5} 28. Rc8+
{+0.51/14 4} Kg7 {+0.00/30 0.1} 29. Nc6 {+0.41/12 2.5} Rh1+ {+0.00/32 0.1}
30. Kc2 {+0.14/11 3} Rh2+ {+0.00/32 0.1} 31. Kb1 {+0.20/14 7} Bf8
{+0.00/35 0.1} 32. a4 {+0.60/10 4} Nf4 {-1.16/29 17} 33. b4 {+0.98/11 1.6}
Re2 {-0.82/28 5} 34. Bb6 {+1.73/9 4} Ne6 {-2.54/30 5} 35. a5 {+2.05/10 2.9}
Re1+ {-3.00/26 1.6} 36. Kc2 {+2.04/10 6} Re2+ {-1.79/27 1.7} 37. Kc3
{+1.90/10 2.6} Ra2 {-1.86/29 0.1} 38. Kb3 {+1.82/12 2.8} Ra1 {-1.99/29 0.8}
39. Kb2 {+1.80/12 2.4} Ra4 {-2.01/30 0.8} 40. Be3 {+2.04/10 6} f6
{-1.91/31 0.2} 41. Ra8 {+2.32/8 2.4} fxg5 {-1.87/29 0.8} 42. Rxa6
{+2.11/10 1.9} h5 {-1.92/27 1.4} 43. Rb6 {+2.12/10 5} h4 {-2.24/25 4} 44.
a6 {+2.22/9 0.4} Kh6 {-3.86/27 12} 45. Bg1 {+1.92/8 4} h3 {-3.32/26 2.8}
46. Bh2 {+2.35/9 1.4} g4 {-4.80/27 2.7} 47. fxg4 {+2.59/8 1.8} Kg5
{-4.56/25 1.1} 48. a7 {+2.75/8 2.6} Kxg4 {-5.49/26 4} 49. Rb7 {+2.66/8 3}
Rxa7 {-5.49/25 1.0} 50. Rxa7 {+2.57/10 1.1} Kf3 {-5.30/23 0.2} 51. Rf7+
{+2.63/8 5} Kg2 {-2.67/23 0.7} 52. Rf6 {+2.69/9 0.5} Nf4 {-2.66/26 0.8} 53.
b5 {+2.31/10 2.1} Kxh2 {-2.70/24 1.1} 54. Rxf8 {+2.33/12 0.9} Kg3
{-2.82/27 2.0} 55. b6 {+2.57/8 2.0} h2 {-3.17/25 0.1} 56. Rh8 {+2.58/9 0.9}
Nh5 {-3.50/29 6} 57. b7 {+2.71/10 0.5} h1=Q {-3.17/26 0.6} 58. b8=Q
{+2.66/9 0.4} Qd1 {-3.06/22 0.4} 59. Qb3+ {+3.59/7 1.5} Qxb3+
{-3.97/27 2.3} 60. Kxb3 {+2.86/8 0.3} Kf3 {-4.30/29 6} 61. Rg8
{+3.40/8 0.7} Nf4 {-3.16/22 0.7} 62. Ne7 {+3.81/7 0.7} Kxe4 {-3.59/22 0.7}
63. Nxg6 {+5.04/6 0.7} d5 {-2.99/22 1.2} 64. Nxf4 {+13.97/5 1.0} exf4
{-1000.35/30 2.2} 65. Kc2 {+16.51/6 0.7} Ke3 {-1000.24/39 0.9} 66. Kd1
{+20.03/5 0.3} Kd3 {-1000.25/36 0.6} 67. Rf8 Ke3 {-1000.26/38 0.3} 68. Ke1
{+66.41/2 0.3} d4 {-1000.24/40 0.5} 69. Rg8 {+44.43/4 0.2} d3
{-1000.23/39 0.5} 70. Re8+ {+19.96/4 0.2} Kd4 {-1000.21/42 0.2} 71. Kd2
{+34.95/3 0.1} f3 {-1000.20/43 0.3} 72. Rf8 {+59.54/2 0.2} Ke4
{-1000.19/41 0.2} 73. Rf7 {+71.96/4 0.1} f2 {-1000.18/40 0.3} 74. Rxf2 Kd4
{-1000.17/41 0.5} 75. Rf4+ {+102.32/4 0.1} Ke5 {-1000.15/42 0.7} 76. Rh4
{+104.86/3 0.1} Kf5 {-1000.15/41 0.4} 77. Kxd3 Ke5 {-1000.14/39 0.2} 78.
Rc4 Ke6 {-1000.13/39 0.4} 79. Ke2 Kd5 {-1000.15/40 0.4} 80. Ra4 Ke6
{-1000.14/39 0.3} 81. Rb4 Kd7 {-1000.14/38 0.3} 82. Re4 {+84.20/2 0.2} Kd6
{-1000.14/39 0.4} 83. Rd4+ Ke6 {-1000.13/39 0.3} 84. Kf1 {+65.32/2 0.2} Ke5
{-1000.16/36 0.3} 85. Rd3 Kf4 {-1000.15/38 0.2} 86. Rd5 Ke4
{-1000.15/38 0.4} 87. Rd8 Ke3 {-1000.15/39 0.3} 88. Rh8 Ke4
{-1000.15/41 0.7} 89. Kg2 Kd4 {-1000.14/39 0.3} 90. Rh1 Kc5
{-1000.15/38 0.3} 91. Rb1 Kc4 {-1000.15/37 0.3} 92. Rc1+ {+30.98/1 0.2} Kd3
{-1000.15/39 0.3} 93. Kh2 Kd4 {-1000.16/34 0.3} 94. Rb1 Kd5
{-1000.16/36 0.4} 95. Rf1 Ke5 {-1000.16/39 0.5} 96. Rf3 Ke4
{-1000.17/42 1.6} 97. Rf2 {+20.74/4 0.1} Kd5 {-1000.16/40 0.7} 98. Kh3 Ke4
{-1000.16/38 0.3} 99. Rb2 Kd4 {-1000.15/37 0.4} 100. Ra2 Kc5
{-1000.15/41 1.3} 101. Rf2 {+14.61/6 17} Kd4 {-1000.15/52 4} 102. Rf8
{+14.12/6 15} Ke5 {-1000.14/56 4} 103. Ra8 {+14.78/6 13} Kd6
{-1000.14/55 4} 104. Ra4 {+13.67/6 12} Kd5 {-1000.15/52 4} 105. Rh4
{+12.89/6 11} Kd6 {-1000.15/52 4} 106. Kg3 {+13.05/6 10} Kd5
{-1000.14/53 4} 107. Kg4 {+12.57/5 9} Ke5 {-1000.14/53 2.6} 108. Rh7
{+12.56/5 8} Ke4 {-1000.14/58 3} 109. Rg7 {+13.79/5 7} Kd5 {-1000.13/64 3}
110. Kf5 {+13.77/5 6} Kc4 {-1000.12/65 0.1} 111. Ke4 {+14.22/5 6} Kc5
{-1000.11/62 3} 112. Rg3 {+14.23/5 5} Kc6 {-1000.12/52 4} 113. Ke5
{+14.21/5 5} Kc5 {-1000.11/63 3} 114. Rc3+ {+13.11/5 4} Kb4
{-1000.10/70 0.2} 115. Kd4 {+16.98/5 4} Kb5 {-1000.09/70 0.1} 116. Kd5
{+15.85/5 4} Kb6 {-1000.08/66 0.1} 117. Rc5 {+16.49/5 3} Kb7
{-1000.07/74 0.1} 118. Kd6 {+18.79/5 3} Kb6 {-1000.06/86 0.1} 119. Rf5
{+25.37/5 2.7} Kb7 {-1000.05/154 2.9} 120. Rb5+ {+128.00/6 2.2} Ka6
{-1000.04/245 0.2} 121. Kc5 {+128.00/5 2.1} Ka7 {-53.93/1 0.1} 122. Kc6
{+128.00/5 2.1} Ka6 {-1000.03/245 0.1} 123. Rd5 {+128.00/3 1.9} Ka7
{-1000.03/1 0.1} 124. Kc7 {+128.00/3 1.7} Ka6 {-1000.02/245 0.1} 125. Rg5
{+128.00/2 1.6} Ka7 {-1000.01/1 0.1} 126. Rg6 {+128.00/2 1.4} Ka8
{-1000.01/1 0.1} 127. Ra6# {+128.00/2 0.6}
{Xboard adjudication: Checkmate} 1-0

2018 15" MBP & 2015 13" MBP connected to RTX2080Ti GTX1080Ti GTX1080 Vega56 RX580 R9-290 GTX680

 
2018 15" MacBook Pro (RP560X) [8th,6C,H] + RX 5700 XT @ 32Gbps-TB3 (ASUS XG Station Pro) + Win10 & macOS 10.15.4 [build link]  


ReplyQuote
itsage
(@itsage)
Illustrious Member Admin
Joined: 4 years ago
 

@oliverb, Thank you for sharing your chess engine, OliThink and how effective external graphics can be with the right application. I wish I had learnt to play chess to understand this better.

 

external graphics card builds
best laptops for external GPU
eGPU enclosure buyer's guide

 
2013 Mac Pro (FP D500 x2) [3rd,12C,E] + RX 5700 XT @ 16Gbps-TB2>TB3 (Mantiz Saturn Pro) + macOS 11 [build link]  


ReplyQuote
jangoloti
(@jangoloti_1)
Estimable Member
Joined: 11 months ago
 

@oliverb, Do professional chess players read those numbers and understand the play in real time?

 

Mac Mini 2018 i7 16 GB 512 GB SSD, Mac Book Pro 2016, HP Z31x, Sonnet Breakaway Box 550 W, Nitro+ RX5700 XT, KFA2 SNPR 1060 6GB eGPU,...


ReplyQuote
OliverB
(@oliverb)
Noble Member
Joined: 2 years ago
 
Posted by: @jangoloti_1

@oliverb, Do professional chess players read those numbers and understand the play in real time?

 

Yes, they do. I am a non-professional mediocre chess player (about low club level) and I understand the numbers. Of course it's easier and quicker to use a graphical interface like xboard/winboard where you can replay the match. This is the position after the 34. Nd6 when it was very clear, that black was in serious trouble.

Screen Shot 2020 05 08 at 15.14.55

The most interesting part is, that black (Stockfish 11) is actually the best chess program/player ever, but self learning Leela Chess Zero combined with eGPU power looks even stronger.

This post was modified 4 months ago

2018 15" MBP & 2015 13" MBP connected to RTX2080Ti GTX1080Ti GTX1080 Vega56 RX580 R9-290 GTX680

 
2018 15" MacBook Pro (RP560X) [8th,6C,H] + RX 5700 XT @ 32Gbps-TB3 (ASUS XG Station Pro) + Win10 & macOS 10.15.4 [build link]  


jangoloti and itsage liked
ReplyQuote
OliverB
(@oliverb)
Noble Member
Joined: 2 years ago
 

It is a scandal that the feud between Apple and nVidia causes that CUDA on MacOSX is dead after High Sierra.
They spit on science and progress.

2018 15" MBP & 2015 13" MBP connected to RTX2080Ti GTX1080Ti GTX1080 Vega56 RX580 R9-290 GTX680

 
2018 15" MacBook Pro (RP560X) [8th,6C,H] + RX 5700 XT @ 32Gbps-TB3 (ASUS XG Station Pro) + Win10 & macOS 10.15.4 [build link]  


ReplyQuote