Lc0 in GTX video card

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
jshriver
Posts: 1358
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Lc0 in GTX video card

Post by jshriver »

MMarco wrote: Thu Dec 24, 2020 4:58 am Did you use the recent cuda backend? That one works very bad with my 1660 Ti, but cudnn works fine.
Thanks for your help, lc0 is running smoothly on my machine now :) here is a 15 0 game with Fritz 17 I just played and lc0 won

[pgn]
[Event "ARTEMIS, Blitz 15.0min"]
[Site "Morgantown"]
[Date "2020.12.24"]
[Round "1"]
[White "Lc0 v0.26.3 cuda"]
[Black "Fritz 17"]
[Result "1-0"]
[ECO "D15"]
[Annotator "0.16;0.88"]
[PlyCount "155"]
[TimeControl "900"]

{Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz 2496 MHz W=9.6 plies; 1kN/s; B=26.
0 plies; 3,949kN/s;} 1. c4 {B 0} c6 {B 0} 2. Nc3 {0.16/16 28} Nf6 {B 0} 3. Nf3
{B 0} d5 {B 0} 4. d4 {B 0} a6 {B 0} 5. e3 {B 0} Bf5 {B 0} 6. Ne5 {B 0} Nbd7 {
B 0} 7. Qb3 {B 0} Ra7 {B 0 Both last book move} 8. cxd5 {0.55/19 50} cxd5 {
0.88/24 23} 9. f3 {0.58/23 14} Be6 {0.98/24 19 (Nd7xe5)} 10. Bd2 {0.83/13 43
(Ne5xd7)} g6 {1.04/24 33 (Nd7xe5)} 11. Nd3 {0.88/11 27} Bg7 {1.03/23 29} 12.
Nf4 {0.89/14 15} O-O {0.91/22 12} 13. Nxe6 {0.89/13 8 (Bf1-d3)} fxe6 {0.99/23
23} 14. e4 {0.99/13 17 (g2-g3)} dxe4 {0.84/23 45} 15. fxe4 {0.98/15 17} b5 {
0.77/23 18} 16. e5 {0.95/13 6} Nh5 {0.92/23 39} 17. O-O-O {0.86/12 25 (Qb3xe6+)
} Nb6 {0.89/22 14} 18. Bg5 {0.89/13 23} Nf4 {0.95/23 13 (Ra7-d7)} 19. Kb1 {
1.11/11 18} Kh8 {1.03/24 20} 20. g3 {1.06/11 15} Qa8 {1.12/24 17 (Nf4-d5)} 21.
Rg1 {1.16/11 18} Nfd5 {0.81/25 31} 22. Nxd5 {1.15/10 17 (Nc3-e4)} exd5 {
0.99/25 17} 23. h4 {1.25/9 20 (Bf1-h3)} Nc4 {0.75/21 14} 24. Be2 {1.11/10 46
(Bf1-h3)} Qe8 {1.04/21 25 (Rf8-f2)} 25. Qd3 {1.53/7 15} Kg8 {1.24/22 13 (e7-e6)
} 26. h5 {2.33/7 17 (g3-g4)} Rf2 {1.68/23 28} 27. Rdf1 {3.09/9 22} Rxf1+ {
1.54/25 13} 28. Rxf1 {2.87/9 5} gxh5 {1.52/26 12} 29. Qf3 {3.15/10 13} e6 {
1.69/27 27} 30. Qxh5 {3.30/10 15} Qxh5 {1.62/29 8} 31. Bxh5 {2.99/9 8} Rc7 {
1.71/28 8} 32. Bg4 {3.27/10 24 (Rf1-c1)} Rc6 {1.61/29 9} 33. b3 {3.97/12 17
(Rf1-c1)} Na3+ {1.58/27 7} 34. Kb2 {3.79/11 9} Nc2 {1.56/28 6} 35. Bxe6+ {
3.72/10 15} Rxe6 {1.56/27 18} 36. Kxc2 {3.71/9 11} h6 {1.56/26 7 (Re6-g6)} 37.
Bh4 {3.28/8 43 (Bg5-f4)} Rc6+ {1.39/27 9 (Bg7-f8)} 38. Kd3 {2.95/8 24 (Kc2-b2)}
Bf8 {1.36/24 7} 39. Ke3 {2.71/10 15} Kg7 {1.37/23 5} 40. Kf4 {2.66/11 8
(Rf1-f2)} Kg6 {1.31/26 4} 41. Re1 {2.94/11 8 (Kf4-g4)} Bb4 {1.44/24 8 (h6-h5)}
42. Re2 {1.84/11 16} Rc1 {1.20/25 14} 43. e6 {1.48/12 11 (Kf4-f3)} Rf1+ {
1.40/25 11} 44. Ke3 {1.21/13 10} Kg7 {1.39/26 4 (a6-a5)} 45. Rc2 {3.54/10 21
(g3-g4)} Re1+ {1.70/25 11} 46. Kf4 {4.03/11 11} Kg6 {1.69/26 8} 47. Rc6 {
4.29/10 10} Bd2+ {1.76/26 16} 48. Kf3 {4.47/10 12} Bg5 {1.88/25 14 (Re1-e3+)}
49. Bxg5 {7.00/9 18} hxg5 {2.04/27 10} 50. Rd6 {7.48/9 10 (Rc6xa6)} g4+ {
1.50/24 6 (Kg6-f6)} 51. Kxg4 {6.36/10 12} Re4+ {1.67/25 15} 52. Kf3 {5.28/10 7}
Rxd4 {1.83/28 15} 53. Rxa6 {4.79/10 13 (g3-g4)} Kf6 {1.83/28 9} 54. Rb6 {
4.91/9 9 (g3-g4)} Rd3+ {1.94/28 17 (b5-b4)} 55. Kf4 {6.29/9 7} Rd4+ {1.90/29 7}
56. Ke3 {4.71/10 4} Re4+ {2.04/29 9} 57. Kf3 {4.61/9 6} b4 {1.84/29 5} 58. g4 {
4.51/9 4} Rd4 {1.99/27 13} 59. g5+ {4.60/10 4 (Kf3-g3)} Kxg5 {2.03/29 3} 60. e7
{4.36/11 3} Rf4+ {2.04/29 3 (Rd4-e4)} 61. Ke3 {6.19/9 13 (Kf3-e2)} Re4+ {
2.13/30 7} 62. Kd3 {6.18/9 0} Rxe7 {2.17/29 3 (Kg5-f5)} 63. Kd4 {14.89/6 3
(Rb6xb4)} Re2 {1.30/24 5} 64. Kxd5 {45.89/6 2 (Rb6xb4)} Rd2+ {1.79/25 5
(Re2xa2)} 65. Kc4 {49.34/5 4 (Kd5-c5)} Rxa2 {2.04/25 7} 66. Kxb4 {116.54/4 1
(Rb6xb4)} Kf4 {3.30/28 9 (Kg5-f5)} 67. Rb5 {103.59/4 2 (Kb4-c5)} Rh2 {3.66/27
10 (Kf4-e4)} 68. Rc5 {118.54/3 1 (Kb4-c4)} Ke3 {3.65/27 8 (Kf4-e4)} 69. Rc8 {
95.35/3 1 (Kb4-c4)} Kd4 {4.03/26 7 (Ke3-d3)} 70. Rd8+ {39.34/4 1} Ke5 {5.37/32
7} 71. Kb5 {111.35/5 1 (Kb4-c4)} Ke6 {5.47/32 2 (Rh2-h7)} 72. b4 {58.95/4 1}
Rh1 {5.47/34 1 (Rh2-h4)} 73. Kb6 {115.82/3 1 (Kb5-a5)} Rb1 {5.57/29 2 (Rh1-h6)}
74. b5 {121.47/4 0} Rc1 {5.67/30 1 (Rb1-h1)} 75. Rd2 {118.37/3 0 (Kb6-a6)} Rb1
{7.95/26 6 (Rc1-g1)} 76. Rd3 {122.86/3 0 (Kb6-c6)} Ke5 {9.08/24 5 (Rb1-d1)} 77.
Rd8 {124.52/3 0 (Kb6-c6)} Rb3 {7.52/25 5 (Rb1-b2)} 78. Kc6 {123.84/2 0 (Kb6-a6)
} 1-0


[/pgn]
MMarco
Posts: 212
Joined: Sun Apr 12, 2020 1:09 am
Full name: Marc-O Moisan-Plante

Re: Lc0 in GTX video card

Post by MMarco »

Great. :D

Just in case you wouldn't be aware of this, also thick the option cudnn-fp16 in the engine parameters. I'm not sure your card supports this, but if it does, Lc0 (or Fat Fritz) will run faster.
User avatar
RubiChess
Posts: 643
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: Lc0 in GTX video card

Post by RubiChess »

jshriver wrote: Thu Dec 24, 2020 6:51 am
MMarco wrote: Thu Dec 24, 2020 4:58 am Did you use the recent cuda backend? That one works very bad with my 1660 Ti, but cudnn works fine.
Thanks for your help, lc0 is running smoothly on my machine now :) here is a 15 0 game with Fritz 17 I just played and lc0 won
Hmm. So the official Lc0 site http://lczero.org/play/download/ is wrong? There I find
Newest (2018+) NVidia GPUs: GTX 16xx, ...: Use CUDA backend.
Or what did you change to fix your problem?

Regards, Andreas (having notebook with GTX1660 and PC with GTX 1050 TI and using Lc0 only rarely)
Nay Lin Tun
Posts: 710
Joined: Mon Jan 16, 2012 6:34 am

Re: Lc0 in GTX video card

Post by Nay Lin Tun »

RubiChess wrote: Thu Dec 24, 2020 9:16 am
jshriver wrote: Thu Dec 24, 2020 6:51 am
MMarco wrote: Thu Dec 24, 2020 4:58 am Did you use the recent cuda backend? That one works very bad with my 1660 Ti, but cudnn works fine.
Thanks for your help, lc0 is running smoothly on my machine now :) here is a 15 0 game with Fritz 17 I just played and lc0 won
Hmm. So the official Lc0 site http://lczero.org/play/download/ is wrong? There I find
Newest (2018+) NVidia GPUs: GTX 16xx, ...: Use CUDA backend.
Or what did you change to fix your problem?

Regards, Andreas (having notebook with GTX1660 and PC with GTX 1050 TI and using Lc0 only rarely)
To my knowledge, it is like 5% speed improvement from CUDA backend, however , there are bugs in Cuda code and you may actually ended up losing -50% speed with Cuda.

My 0.02c, try both backends and choose whichever is faster for you, or go lco discord # help channel.
User avatar
jshriver
Posts: 1358
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Lc0 in GTX video card

Post by jshriver »

RubiChess wrote: Thu Dec 24, 2020 9:16 am
Hmm. So the official Lc0 site http://lczero.org/play/download/ is wrong? There I find
Newest (2018+) NVidia GPUs: GTX 16xx, ...: Use CUDA backend.
Or what did you change to fix your problem?

Regards, Andreas (having notebook with GTX1660 and PC with GTX 1050 TI and using Lc0 only rarely)
I ended up downloading the latest cuda https://developer.nvidia.com/cuda-downloads then I downloaded the latest lc0 from the official website cuda version not cudann, instead of using the one that game with Fritz 17.

The cuda one from the official website works like a charm on my 1660.
Ferdy
Posts: 4848
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Lc0 in GTX video card

Post by Ferdy »

This is what I have.

CPU: i7-2600K, 3.4Ghz 4cores/8threads
GPU: GTX 1650 super
Cuda: V11.2.67
Lc0 options: default
Command: position startpos, go movetime 60000

Code: Select all

                name     backend nn_name nn_size    nps
0   Lc0 v.26.3 cudnn   cuda-fp16  703810  10x128  26971
1   Lc0 v.26.3 cudnn  cudnn-fp16  703810  10x128  26687
2   Lc0 v.26.3 cudnn   cuda-fp16   42850  20x256   7823
3   Lc0 v.26.3 cudnn  cudnn-fp16   42850  20x256   7691
4   Lc0 v0.26.3 cuda   cuda-fp16  703810  10x128   5361
5   Lc0 v.26.3 cudnn   cuda-fp16   66511  24x320   3985
6   Lc0 v.26.3 cudnn  cudnn-fp16   66511  24x320   3923
7   Lc0 v.26.3 cudnn   cuda-fp16   66595  30x384   2512
8   Lc0 v.26.3 cudnn  cudnn-fp16   66595  30x384   2490
9   Lc0 v0.26.3 cuda   cuda-fp16   42850  20x256    679
10  Lc0 v0.26.3 cuda   cuda-fp16   66511  24x320    334
11  Lc0 v0.26.3 cuda   cuda-fp16   66595  30x384    213
Pi4Chess
Posts: 253
Joined: Mon Nov 16, 2020 12:13 pm
Full name: Manuel Rivera

Re: Lc0 in GTX video card

Post by Pi4Chess »

Ferdy wrote: Fri Dec 25, 2020 10:52 am This is what I have.

CPU: i7-2600K, 3.4Ghz 4cores/8threads
GPU: GTX 1650 super
Cuda: V11.2.67
Lc0 options: default
Command: position startpos, go movetime 60000

Code: Select all

                name     backend nn_name nn_size    nps
0   Lc0 v.26.3 cudnn   cuda-fp16  703810  10x128  26971
1   Lc0 v.26.3 cudnn  cudnn-fp16  703810  10x128  26687
2   Lc0 v.26.3 cudnn   cuda-fp16   42850  20x256   7823
3   Lc0 v.26.3 cudnn  cudnn-fp16   42850  20x256   7691
4   Lc0 v0.26.3 cuda   cuda-fp16  703810  10x128   5361
5   Lc0 v.26.3 cudnn   cuda-fp16   66511  24x320   3985
6   Lc0 v.26.3 cudnn  cudnn-fp16   66511  24x320   3923
7   Lc0 v.26.3 cudnn   cuda-fp16   66595  30x384   2512
8   Lc0 v.26.3 cudnn  cudnn-fp16   66595  30x384   2490
9   Lc0 v0.26.3 cuda   cuda-fp16   42850  20x256    679
10  Lc0 v0.26.3 cuda   cuda-fp16   66511  24x320    334
11  Lc0 v0.26.3 cuda   cuda-fp16   66595  30x384    213
Can you try bench with 66680 net? It seems the best net atm after Stefan Pohl sp-cc.de testing.
Nay Lin Tun
Posts: 710
Joined: Mon Jan 16, 2012 6:34 am

Re: Lc0 in GTX video card

Post by Nay Lin Tun »

No difference between cuda vs cudnn in 1060 GTX , 3 GB, i5 4 cores , 3 ghz.
Network J98.3-8, 30x384, start po, go movetime 60000, average 1.3 knps for both.
Ferdy
Posts: 4848
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Lc0 in GTX video card

Post by Ferdy »

Pi4Chess wrote: Fri Dec 25, 2020 11:18 am Can you try bench with 66680 net? It seems the best net atm after Stefan Pohl sp-cc.de testing.
Update with 66680 and a bug fix from the script. Note this is not a full bench, just from a startpos.

CPU: i7-2600K, 3.4Ghz 4cores/8threads
GPU: GTX 1650 super
Cuda: V11.2.67
Lc0 options: default
Command: position startpos, go movetime 60000

Code: Select all

                name     backend nn_name nn_size    nps
0   Lc0 v.26.3 cudnn  cudnn-fp16  703810  10x128  27069
1   Lc0 v.26.3 cudnn   cuda-fp16  703810  10x128  26268
2   Lc0 v.26.3 cudnn  cudnn-fp16   42850  20x256   7769
3   Lc0 v.26.3 cudnn   cuda-fp16   42850  20x256   7614
4   Lc0 v0.26.3 cuda   cuda-fp16  703810  10x128   5281
5   Lc0 v.26.3 cudnn  cudnn-fp16   66511  24x320   3934
6   Lc0 v.26.3 cudnn   cuda-fp16   66511  24x320   3883
7   Lc0 v.26.3 cudnn   cuda-fp16   66680  30x384   2499
8   Lc0 v.26.3 cudnn   cuda-fp16   66595  30x384   2481
9   Lc0 v.26.3 cudnn  cudnn-fp16   66680  30x384   2480
10  Lc0 v.26.3 cudnn  cudnn-fp16   66595  30x384   2472
11  Lc0 v0.26.3 cuda   cuda-fp16   42850  20x256    683
12  Lc0 v0.26.3 cuda   cuda-fp16   66511  24x320    334
13  Lc0 v0.26.3 cuda   cuda-fp16   66595  30x384    213
14  Lc0 v0.26.3 cuda   cuda-fp16   66680  30x384    207
Pi4Chess
Posts: 253
Joined: Mon Nov 16, 2020 12:13 pm
Full name: Manuel Rivera

Re: Lc0 in GTX video card

Post by Pi4Chess »

Thx !