Advertisement
gomasterzero

Untitled

Oct 8th, 2018
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.40 KB | None | 0 0
  1. part 0.1
  2. creating a VM instance
  3.  
  4.  
  5. in google cloud, open the console :
  6. https://console.cloud.google.com/home/
  7.  
  8. then click on the sandwich bar on top left -> compute engine -> WM instances
  9. then create a new VM instance, choose a custom one with these settings :
  10.  
  11. - scroll through the regions and sub regions that have a V100 available, then when you find it, choose :
  12.  
  13. note : the number of vcpu/ram can be changed anytime after instance creation
  14.  
  15. -> (recommended)if you want to run 2 games simultaneously ./autogtp -g 2 (recommended, 20% faster, higher probability to get disconnected by preemptible rules of low priority cost), due to more cloud hardware used by one machine) :
  16. 4 vcpu
  17. 5.5 gb ram
  18. for more details on hardware needs calculation, please see part 5f
  19.  
  20. -> (not recommended) or, if you want to run one game at a time ./autogtp (not recommended, 20% slower, less chance to get disconnected by preemptible rules) :
  21. 2 vcpu
  22. 3.5 gb ram
  23.  
  24.  
  25.  
  26.  
  27. then, the rest is common for both cases :
  28. - 10 GB HDD
  29. - 1 GPU : Tesla V100 (maximum for free trial)
  30. - system : ubuntu 18.04 LTS
  31. - allow HTTP and HTTPS requests
  32. - preemptible settings (-60% discount on the free credit consumption, cost in exchange of occasional power off of the instance, takes 2 minutes to start again, totally worth it :
  33. to activate preemptible machine :
  34. Click Management, security, disks, networking, sole tenancy.
  35. Under Availability policy, set the Preemptibility option to On. This setting disables automatic restart for the instance, and sets the host maintenance action to Terminate.
  36. Click Create to create the instance.
  37. more details about preemptible here : https://cloud.google.com/compute/docs/instances/create-start-preemptible-instance
  38.  
  39.  
  40. for information :
  41. preemptible instances being much cheaper (if i remember well arround 650 dollars vs 1400 dollars per month of free credit consumed on a V100 VM instance), choosing preemptible instance when you create it is a no brainer.
  42. From my experience, the VM instance will be stopped by Google at most 1 or 2, or very rarely 3 times per 24 hours, which leaves on average at least 5-10 hours to use it on a row before first stop.
  43. And then, to restart the instance only takes 1 click and 1 minute as we will see later, then you are good to go again for many hours.
  44. Note that when preemptible instance is stopped by Google every while, the credit stops being consumed too because the instance is stopped, so you dont have to worry about efficiency of the credit.
  45.  
  46.  
  47.  
  48. part 0.2 :
  49. preparations
  50.  
  51. go on google console (compute engine) -> VM instances -> click on SSH button to connect to the instance via SSH (embbed on chrome)
  52.  
  53. To read before starting :
  54. The instance will be opened in a new chrome window that uses SSH protocol to connect to your VM instance.
  55. To make copying commands easier, in the SSH chrome new window, go to : settings → copy paste with ctrl+shift+c/v : click ok
  56. From now on, we will use ctrl+c to copy a command from this text, but ctrl+shift+v to paste it on the SSH window (because it is ubuntu terminal)
  57.  
  58.  
  59. finally, for information, before starting next parts :
  60. About preemptible instances again, if, unfortunately, the instance was to be exited by google while we are installing system packages, the probability of system corruption due to exit during install of packages is high , and if this very rare case happens, i advise you to delete the instance and recreate a new one, and hopefully (unless you are very unlucky, but then try again !) you will not be stopped in this new instance.
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. parts 1 and 2 and 3 :
  68. update, upgrade, then install all pre leela-zero packages, then compile leela-zero+autogtp in one run !
  69.  
  70.  
  71.  
  72.  
  73. (before you start to run it, you may want to read the detail of what every part of the command does)
  74.  
  75. for information : after the first reboot, you lose connection with the VM instance : wait 1-2 minutes and retry 1 or 2 times, and it should reconnect again as long as server is ON (see this page to see if server is ON with a green circle, and to see if SSH is clickable) :
  76. https://console.cloud.google.com/compute/instances
  77. if "retry" does not work and the instance is still ON (green circle), then retry again until you succeed to connect via SSH again
  78.  
  79.  
  80. select all the big all in one command below then copy paste it
  81. note : this command includes NEXT BRANCH as it is much faster and includes all new improvements
  82.  
  83.  
  84.  
  85. sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo add-apt-repository -y ppa:graphics-drivers/ppa && sudo apt-get update && sudo apt-get -y install nvidia-driver-410 linux-headers-generic nvidia-opencl-dev && sudo apt-get -y install clinfo cmake git libboost-all-dev libopenblas-dev zlib1g-dev build-essential qtbase5-dev qttools5-dev qttools5-dev-tools libboost-dev libboost-program-options-dev opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev qt5-default qt5-qmake curl glances zip && git clone https://github.com/gcp/leela-zero && cd leela-zero && git checkout next && git pull && git clone https://github.com/gcp/leela-zero && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build . && cd ../autogtp && cp ../build/autogtp/autogtp . && cp ../build/leelaz . && sudo reboot
  86.  
  87.  
  88.  
  89.  
  90. if you dont want to read details of what this big all-in-one command above does (not needed) you can skip all the text below until part 4 (how to run autogtp)
  91. (note : will be added later : instance templates and managed group instances for preemptible automatic restart : to be made later)
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98. DETAILS OF THE ALL IN ONE BIG COMMAND :
  99.  
  100. part 1o) upgrading system
  101.  
  102. sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade
  103.  
  104.  
  105.  
  106. part 1a (nvidia easiest alternative)
  107. installing nvidia long lived branch drivers (old stable)
  108.  
  109. sudo add-apt-repository -y ppa:graphics-drivers/ppa && sudo apt-get update && sudo apt-get -y install nvidia-driver-410 linux-headers-generic nvidia-opencl-dev
  110.  
  111.  
  112. official website : https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa
  113. Current long-lived branch release at the time of this tutorial : `nvidia-410` (410.66)
  114. at the ppa website linked above.
  115. if in the future Current long-lived branch gets an update, you should replace 410 (in nvidia-driver-410 of the 1st command by the driver version number mentionned.
  116. For example , if next driver update of nvidia "Current long-lived branch release" was to be nvidia-413, you would have to replace nvidia-driver-410 by nvidia-driver-413 without changing the rest of the command)
  117.  
  118. for information 3, before starting the command just under this, you may want to install latest/fresh nvidia driver instead of last long lived branch for potential extra perfomance. If yes, skip next command (under this), and go directly to part 1b
  119.  
  120.  
  121.  
  122.  
  123.  
  124. part 1b (optionnal nvidia 2nd alternative)
  125. installing nvidia driver latest (short lived branch)
  126.  
  127.  
  128.  
  129. starting part 1b requires to have read instructions from part 1a but requires that you didnt run any command from part 1a !
  130. it is optionnal so you can skip it if you are fine with part 1a, but run either part 1a(old branch stable) or 1b(fresh branch latest), but not both !
  131. in this part, we'll install instead latest nvidia driver available, whether it is on short-lived or long-lived branch :
  132.  
  133. -> if you're lazy :
  134. this all in one commands works directly but with possibly not latest version number
  135. at the time i'm writing this tutorial, 396 is latest version number, but in the future, replace 396 with latest driver version available
  136.  
  137. sudo add-apt-repository -y ppa:graphics-drivers/ppa && sudo apt-get update && apt-cache search nvidia && sudo apt-get -y install nvidia-driver-396 linux-headers-generic nvidia-opencl-dev
  138.  
  139.  
  140.  
  141. ->if you want to know which nvidia packages are available for installation and chose latest option available :
  142. then dont run the command above but instead run this one :
  143.  
  144.  
  145. sudo add-apt-repository -y ppa:graphics-drivers/ppa && sudo apt-get update && apt-cache search nvidia
  146. (or apt search nvidia instead of apt-cache search nvidia)
  147.  
  148. as explained in part 1a, at the time i’m writing this tutorial, nvidia 396 is latest short-lived version, we find it at the bottom of the command we ran here, something like this :
  149. nvidia-compute-utils-396 - NVIDIA compute utilities
  150. nvidia-dkms-396 - NVIDIA DKMS package
  151. nvidia-driver-396 - NVIDIA driver metapackage
  152. nvidia-kernel-source-396 - NVIDIA kernel source package
  153. nvidia-utils-396 - NVIDIA driver support binaries
  154. xserver-xorg-video-nvidia-396 - NVIDIA binary Xorg driver
  155. nvidia-kernel-common-396 - Shared files used with the kernel module
  156. nvidia-headless-396 - NVIDIA headless metapackage
  157. nvidia-headless-no-dkms-396 - NVIDIA headless metapackage - no DKMS
  158.  
  159. then run the following command :
  160.  
  161. sudo apt-get -y install nvidia-driver-396 linux-headers-generic nvidia-opencl-dev
  162.  
  163. note : the ppa providing versions will be updated as new versions get released, with time, so you'd want to rerun these steps to upgrade nvidia driver to latest version
  164.  
  165.  
  166.  
  167.  
  168.  
  169. part 2 :
  170. installing all other prerequired packages
  171.  
  172.  
  173. sudo apt-get -y install clinfo cmake git libboost-all-dev libopenblas-dev zlib1g-dev build-essential qtbase5-dev qttools5-dev qttools5-dev-tools libboost-dev libboost-program-options-dev opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev qt5-default qt5-qmake curl glances zip
  174.  
  175.  
  176.  
  177. part 3 :
  178. compiling leela zero, autogtp, and running autogtp (NEXT branch)
  179.  
  180.  
  181. if you want to use MASTER BRANCH (not recommended, slower, possibly more stable), you can see part 6d but since it is slower i will not display the instructions here (go at optionnal part 6d if you're interested)
  182.  
  183.  
  184. at the moment i'm writing this tutorial, NEXT BRANCH is arround 30% faster to produce games than master (leelav15/autogtpv16) from my personal tests, but it can possibly be less stable and possibly have bugs, depending on which commits are approved, etc. It's runing very fine at the moment though.
  185. i recommend using NEXT BRANCH as long as it doesnt have any major bug (thanks @seopsx and @alreadydone for helping me with the instructions)
  186.  
  187. for manual instructions on how to compile and run leela-zero with autogtp, you can see parts 6e and 6f if you're interested, but these are not needed as they are included in the all in one big command
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. after the ALL IN ONE COMMAND, instructions now continue in part 4 :
  196.  
  197.  
  198. part 4 :
  199. how to run autogtp again (if exited)
  200.  
  201.  
  202. this will run next branch (recommended) if you did part 3, or master branch (not recommended) if you skipped until part 6d
  203.  
  204.  
  205. cd leela-zero/autogtp
  206. ./autogtp
  207.  
  208.  
  209. note : this command :
  210. ./autogtp -g 2
  211. instead of ./autogtp produces games significantly faster, because when a 0% resign game is generated, the extra gpu power of the v100 can be used to produce another game simultaneously
  212. (265 games/24 hours VS 208 games/24hours)
  213. see this comment for details :
  214. https://github.com/gcp/leela-zero/issues/1905#issuecomment-428612310
  215.  
  216. note 2 : this part 4 will be replaced by the managed instance groups and instance templates
  217.  
  218.  
  219.  
  220.  
  221. FINISHED !
  222. you can now contribute to leela-zero !
  223. parts 5 and 6 below are optionnal details if you're interested :
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241. part 5 (optionnal) :
  242. monitoring of the VM
  243.  
  244.  
  245.  
  246. a) check if instance is ON or OFF, and manage your instance :
  247. https://console.cloud.google.com/compute/instances
  248. for information : your free credit does NOT get charged as long as the machine is off, the only point of staying always ON is computing as much selfplay games as possible.
  249.  
  250.  
  251.  
  252.  
  253.  
  254. b) of the free 300 dollars credit, you can manage how much credit left you have :
  255. https://console.cloud.google.com/billing/
  256.  
  257. (this credit totally free, you don't get charged at the end of the free trial)
  258.  
  259.  
  260.  
  261. c) with startup-script (will be added soon when i rework part 4)
  262. games can run automatically at startup of the instance without needing to open any SSH window,
  263. and keep runing even if your computer is powered off (independant), as long as green circle is on the instance (started)
  264.  
  265.  
  266.  
  267. d) for whatever reason, if you want to stop the instance :
  268.  
  269. go in the console VM instances page :
  270. https://console.cloud.google.com/compute/instances
  271.  
  272. then, click on the menu settings next to your instance (the 3 dots at the right of SSH button)
  273. and choose STOP
  274.  
  275.  
  276. The grey square shows that the instance is now stopped (not consuming free credit anymore), and the green circle shows that the instance is runing (thus consuming the free credit)
  277.  
  278.  
  279.  
  280.  
  281. e) optimal hardware needs for an instance, how to calculate :
  282.  
  283. to calculate optimal hardware needs, this is what you need to know (as less as possible to trigger as less as possible low priority of preemptible use rules)
  284. we'll have to always assume worst case scenario (most possible consuming situation) to avoid bottlenecks
  285.  
  286.  
  287.  
  288. -> what is optimal number of simultaneous games
  289. after many many tests, i found that -g 2 (run it with : ./autogtp -g 2) is the fastest (16 +/- 1 games in 60 minutes with 5% resign)
  290. "-g 1" (one game after another) gives 13 +/-1 games in 60 minutes with 5% resign, and uses only 90% of the gpu power (checked with nvidia-smi), and during a no resign game the gpu is not using its extra power
  291. -g 3 and more are not optimal either with a v100, as gpu load is already at 100% with -g 2, and my stats shows it's 5% slower than "-g 1", -g 3 produces 12 +/- 1 games in 60 minutes with 5% resign, -g7 produces 8+/-1 games in 60 minutes with 5% resign (8vcpu instance)
  292. -g 3 and more is also less efficient as you'll need at least 6vcpu and 8GB RAM or more, which will make preemptible use rules often disconnect you
  293. if you want to produce more games in parallel, i suggest you rather use a 2nd gpu
  294.  
  295.  
  296. -> how leelaz threads work
  297. 1 selfplay game will use 1 vcpu leelaz thread maxing it at 100%
  298. 1 match game (worst case scenario) will use 2 vcpu leelaz thread, but the cpu load will be shared between both vcpus :
  299. for example 65% in vcpu(core)1 and 35% in vcpu2, both of these vcpu will be used for a match
  300.  
  301. -> for VCPU number needed :
  302. for vcpu number, the worst case scenario is to assume every game will be a match, needing 2 leelaz threads totalling 100% cpu load together
  303. these leelaz pair threads per match can either be on the same vcpu, or in another one
  304. so you'll need at least the same amount of vcpu as the number of games (selfplay or match, no difference), for example with -g 2 you'll need at least 2vcpu for 2 games + 1 vcpu for startup-script (includes ./autogtp which will be loaded at 100%) + 1 vcpu free for system just in case = 4 vcpu at least in total
  305. for example, -g 4 (4 simultaneous games, not recommended, slower, but to show the calculation) will need : 4 vcpu for 4 games + 1 vcpu for startup-script + 1 vcpu free for system in case = minimum 6 vcpu in total for -g 4 (not recommended, slower than -g 2)
  306. for example 2, -g 6 (6 simultaneous games, not recommended, slower, but to show the calculation) will need 6vcpu for 6 games + 1 vcpu for startup-script + 1 vcpu free for system in case = minimum 8 vcpu in total for -g 6 (not recommended, slower than -g 2)
  307.  
  308. -> for RAM quantity needed :
  309. - ubuntu system uses 450 MB RAM
  310. - 1 leelaz thread uses 1000 MB RAM for a 5% resign game, or 1150 MB for a match 0% resign game leelaz thread, or 1300 MB RAM for selfplay 0% resign leelaz thread
  311. - 1 selfplay game needs 1 leelaz thread
  312. - 1 match game (worst case scenario) needs 2 leelaz threads (1 for each network)
  313. - 4x150 MB extra ram needed for a 0% resign match equal 2x300 MB needed for 2 0% resign selfplay game = 600 MB extra RAM needed
  314. a few examples of calculation :
  315. 1 leelaz thread (1 selfplay) uses 1000 MB RAM with 5% resign + 450 MB system RAM => 1.45 GB total RAM
  316. 2 leelaz threads (2 selfplay or 1 match ) use 2x1000= 2 GB RAM all with 5% resign + 450 MB system RAM = 2.4GB total RAM
  317. 3 leelaz threads (with -g 2 : 1 match + 1 selfplay ) use 3x1300= 3.9 GB RAM all with 0% resign + 450 MB system RAM = 4.3 GB total RAM
  318. 4 leelaz threads (with -g 2 : 4 selfplay or 2 matches or 2 selfplay + 1 match) use 4x1000= 4.0GB RAM with 5% resign + 450 MB system RAM => 4.45 GB total RAM
  319. for worst case add 4x150 MB (4 -r 0 match leelaz threads) or 2x300 MB (2 -r 0 selfplay leelaz threads) = 600 MB extra needed, so total is 5.1 GB RAM, and i chose to keep a 500 MB security margin
  320.  
  321.  
  322. for -g 2 (optimal), the worst case scenario (very rare) is 4 matches with 0% resign = 450 + 4 x 1150 MB RAM for each leelaz thread = 5.1 GB RAM)
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329. part 6 (optionnal) :
  330. optionnal extra information
  331.  
  332. a) save all sgf files you generated with autogtp and download them on your personal computer
  333. steps described in this github, with pictures : https://github.com/gcp/leela-zero/issues/1943#issuecomment-430977929
  334.  
  335. i added this paragraph to answer @kwccoin on the github issue linked above
  336.  
  337.  
  338. first, always run, everytime you want to contribute with autogtp ;
  339. ./autogtp -k allsgf
  340.  
  341. secondly, then, click on SSH button in google cloud console again to open a 2nd command line window
  342. in the 2nd SSH window, run these commands :
  343.  
  344. cd leela-zero/autogtp
  345. ls
  346. #replace v1b in all these commands by whatever name you like, always a different one for every new archive
  347. zip -r -0 v1b.zip allsgf
  348. curl --upload-file ./v1b.zip https://transfer.sh/v1b.zip
  349.  
  350. then you will get a download link as i did in my screenshot
  351.  
  352. download link for my example (ctrl+shift+c in ubuntu terminal) :
  353. https://transfer.sh/6Lza1/v1b.zip
  354.  
  355. optionnal :
  356. view sgf uploaded in the allsgf folder, sorted by date :
  357.  
  358.  
  359. steps explained here, with pictures : https://github.com/gcp/leela-zero/issues/1943#issuecomment-431047043
  360. run these commands, in autogtp folder :
  361.  
  362. cd allsgf
  363. ls -t
  364. #(to go back : cd ..)
  365.  
  366. read order :
  367. 1st column top to bottom, then go to column 2 top to bottom, then column 3 etc
  368.  
  369. note that the sgf are also sorted by time in the zip archive :
  370. (2 more sgf were generated since i did this screenshot)
  371.  
  372. alternatively, you can also have a log if you check the journal file, as explained earlier
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379. b) system monitoring :
  380. RAM usage, cpu usage per core, etc
  381.  
  382. open a 2nd SSH command line window by clicking on SSH, and run this command :
  383.  
  384. glances
  385.  
  386. you will get something similar to this picture :
  387. https://github.com/gcp/leela-zero/issues/1905#issuecomment-430529799
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. c) nvidia gpu stats usage
  395.  
  396. in another SSH command line window :
  397. run this command :
  398.  
  399. nvidia-smi
  400.  
  401.  
  402.  
  403.  
  404.  
  405. d) (not recommended) how to compile and run MASTER branch with the ALL IN ONE first boot command :
  406.  
  407. if you want to install master branch (not recommended, slower, possibly more stable) :
  408. select all commands below and copy/paste all the selection :
  409.  
  410.  
  411. this command will :
  412. update system,
  413. upgrade system,
  414. install all nvidia drivers,
  415. install all pre leela-zero required packages
  416. compile leela-zero (here MASTER BRANCH)
  417. reboot
  418.  
  419.  
  420. sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo add-apt-repository -y ppa:graphics-drivers/ppa && sudo apt-get update && sudo apt-get -y install nvidia-driver-410 linux-headers-generic nvidia-opencl-dev && sudo apt-get -y install clinfo cmake git libboost-all-dev libopenblas-dev zlib1g-dev build-essential qtbase5-dev qttools5-dev qttools5-dev-tools libboost-dev libboost-program-options-dev opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev qt5-default qt5-qmake curl glances zip && git clone https://github.com/gcp/leela-zerocd leela-zero/src && make && cd ../autogtp && qmake -qt5 && make && cp ../src/leelaz . && sudo reboot
  421.  
  422.  
  423. -> (will be added later) after reboot, you dont need and should to run autogtp, it will run automatically on the background with the startup-script
  424. you can check system usage in a SSH window with the command :
  425.  
  426. glances
  427.  
  428.  
  429.  
  430. -> (will be added later) or you can see the game production that is happening on background with the journal command :
  431.  
  432. sudo journalctl -u google-startup-scripts.service -b -e -f
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441. part 6e : old manual NEXT BRANCH instructions :
  442.  
  443.  
  444. (if you already installed MASTER branch, exit instance and relaunch it, then start directly at the # go to leela-zero folder command)
  445.  
  446. # show gpu details
  447. clinfo && nvidia-smi
  448. # Clone github repo
  449. git clone https://github.com/gcp/leela-zero
  450. # go to leela-zero folder
  451. cd leela-zero
  452. # pull next branch
  453. git checkout next
  454. git pull
  455. git clone https://github.com/gcp/leela-zero
  456. git submodule update --init --recursive
  457. # create leela-zero/build folder and go inside it
  458. mkdir build && cd build
  459. # compile leelaz and autogtp binaries in leela-zero/build folder
  460. cmake ..
  461. cmake --build .
  462. ./tests
  463. # go to leela-zero/autogtp folder
  464. cd ../autogtp
  465. # copy autogtp in leela-zero/build/autogtp folder to leela-zero/autogtp folder
  466. cp ../build/autogtp/autogtp .
  467. # copy leelaz binary in leela-zero/build folder to leela-zero/autogtp folder
  468. cp ../build/leelaz .
  469. # run autogtp
  470. ./autogtp
  471.  
  472.  
  473.  
  474. and autogtp NEXT is running !
  475.  
  476.  
  477. AutoGTP v16
  478. Using 1 thread(s) for GPU(s).
  479. Starting tuning process, please wait...
  480. Net filename: networks/68824bbc683a0eb482bcdc34ea7c3e4bc3e1dd152e3aa94f9a8bfc6d189f3091.gz
  481. net: 68824bbc683a0eb482bcdc34ea7c3e4bc3e1dd152e3aa94f9a8bfc6d189f3091.
  482. ./leelaz --tune-only -w networks/68824bbc683a0eb482bcdc34ea7c3e4bc3e1dd152e3aa94f9a8bfc6d189f3091.gz
  483. Leela Zero 0.15 Copyright (C) 2017-2018 Gian-Carlo Pascutto and contributors
  484. This program comes with ABSOLUTELY NO WARRANTY.
  485. This is free software, and you are welcome to redistribute it
  486. under certain conditions; see the COPYING file for details.
  487.  
  488. Using 2 thread(s).
  489. RNG seed: 9371137713330324515
  490. BLAS Core: built-in Eigen 3.3.5 library.
  491. Detecting residual layers...v1...256 channels...40 blocks.
  492. Initializing OpenCL (autodetecting precision).
  493. Detected 1 OpenCL platforms.
  494. Platform version: OpenCL 1.2 CUDA 9.1.84
  495. Platform profile: FULL_PROFILE
  496. Platform name: NVIDIA CUDA
  497. Platform vendor: NVIDIA Corporation
  498. Device ID: 0
  499. Device name: Tesla V100-SXM2-16GB
  500. Device type: GPU
  501. Device vendor: NVIDIA Corporation
  502. Device driver: 390.87
  503. Device cores: 80 CU
  504. Device score: 1112
  505. Selected platform: NVIDIA CUDA
  506. Selected device: Tesla V100-SXM2-16GB
  507. with OpenCL 1.2 capability.
  508. Half precision compute support: No.
  509. Detected 1 OpenCL platforms.
  510. Platform version: OpenCL 1.2 CUDA 9.1.84
  511. Platform profile: FULL_PROFILE
  512. Platform name: NVIDIA CUDA
  513. Platform vendor: NVIDIA Corporation
  514. Device ID: 0
  515. Device name: Tesla V100-SXM2-16GB
  516. Device type: GPU
  517. Device vendor: NVIDIA Corporation
  518. Device driver: 390.87
  519. Device speed: 1530 MHz
  520. Device cores: 80 CU
  521. Device score: 1112
  522. Selected platform: NVIDIA CUDA
  523. Selected device: Tesla V100-SXM2-16GB
  524. with OpenCL 1.2 capability.
  525. Half precision compute support: No.
  526.  
  527. Started OpenCL SGEMM tuner.
  528. Will try 290 valid configurations.
  529. (1/290) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=16 NDIMB=8 NDIMC=8 NWG=16 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0525 ms (2247.8 GFLOPS)
  530. (2/290) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=32 NDIMB=8 NDIMC=8 NWG=16 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0468 ms (2518.0 GFLOPS)
  531. (5/290) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0458 ms (2574.3 GFLOPS)
  532. (11/290) KWG=32 KWI=2 MDIMA=8 MDIMC=8 MWG=32 NDIMB=8 NDIMC=8 NWG=16 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0422 ms (2792.7 GFLOPS)
  533. (21/290) KWG=16 KWI=2 MDIMA=16 MDIMC=16 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0379 ms (3113.5 GFLOPS)
  534. (93/290) KWG=32 KWI=8 MDIMA=32 MDIMC=32 MWG=64 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0366 ms (3222.4 GFLOPS)
  535. (136/290) KWG=16 KWI=2 MDIMA=16 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=4 VWN=2 0.0358 ms (3291.4 GFLOPS)
  536. (169/290) KWG=16 KWI=8 MDIMA=16 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=4 VWN=2 0.0346 ms (3413.3 GFLOPS)
  537. (172/290) KWG=32 KWI=8 MDIMA=16 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=4 VWN=2 0.0343 ms (3438.8 GFLOPS)
  538. Found Leela Version : 0.15
  539. Tuning process finished
  540. Starting thread 1 on GPU 0
  541. {
  542. "cmd": "selfplay",
  543. "hash": "68824bbc683a0eb482bcdc34ea7c3e4bc3e1dd152e3aa94f9a8bfc6d189f3091",
  544. "hash_gzip_hash": "2390e5e8fd8f34c494e9775137b282430348a5d450667357345430a9f2dd5c6c",
  545. "minimum_autogtp_version": "16",
  546. "minimum_leelaz_version": "0.15",
  547. "options": {
  548. "noise": "true",
  549. "playouts": "0",
  550. "randomcnt": "999",
  551. "resignation_percent": "5",
  552. "visits": "1601"
  553. },
  554. "options_hash": "b37dca",
  555. "random_seed": "5468405401357328662",
  556. "required_client_version": "16"
  557. }
  558.  
  559. Got new job: selfplay
  560. net: 68824bbc683a0eb482bcdc34ea7c3e4bc3e1dd152e3aa94f9a8bfc6d189f3091.
  561. Engine has started.
  562. time_settings 0 1 0
  563. Thinking time set.
  564. 1 (B D16) 2 (W Q4) 3 (B D4) 4 (W Q16) 5 (B R14)
  565.  
  566.  
  567. you can notice that it's not master version because, at the time i'm writing the tutorial (leelav15/autogtpv16), you dont see these lines (among others) in the master version :
  568. BLAS Core: built-in Eigen 3.3.5 library.
  569. Half precision compute support: No.
  570. time_settings 0 1 0
  571.  
  572.  
  573. and next is ready to use !
  574.  
  575.  
  576.  
  577.  
  578.  
  579. part 6f : old manual MASTER BRANCH instructions :
  580.  
  581.  
  582. # show gpu details
  583. clinfo && nvidia-smi
  584. # Clone github repo
  585. git clone https://github.com/gcp/leela-zero
  586. # go to leela-zero/src folder
  587. cd leela-zero/src
  588. # compile leelaz binary
  589. make
  590. # go to leela-zero/autogtp folder
  591. cd ../autogtp
  592. # compile autogtp binary
  593. qmake -qt5
  594. make
  595. # copy leelaz binary into leela-zero/autogtp folder
  596. cp ../src/leelaz .
  597. # run autogtp
  598. ./autogtp
  599.  
  600.  
  601.  
  602.  
  603. and autogtp finally runs !
  604. AutoGTP v16
  605. Using 1 thread(s) for GPU(s).
  606. Starting tuning process, please wait...
  607. Net filename: networks/25c2313d8c11b9320de4795cf593f237f32e8a61c4524a6305ff30073b760132
  608. net: 25c2313d8c11b9320de4795cf593f237f32e8a61c4524a6305ff30073b760132.
  609. ./leelaz --tune-only -w networks/25c2313d8c11b9320de4795cf593f237f32e8a61c4524a6305ff30073b760132
  610. ./leelaz --tune-only -w networks/25c2313d8c11b9320de4795cf593f237f32e8a61c4524a6305ff30073b760132
  611. Using 2 thread(s).
  612. RNG seed: 17613292517859834344
  613. Detecting residual layers...v1...256 channels...40 blocks.
  614. Initializing OpenCL.
  615. Detected 1 OpenCL platforms.
  616. Platform version: OpenCL 1.2 CUDA 9.1.84
  617. Platform profile: FULL_PROFILE
  618. Platform name: NVIDIA CUDA
  619. Platform vendor: NVIDIA Corporation
  620. Device ID: 0
  621. Device name: Tesla V100-SXM2-16GB
  622. Device type: GPU
  623. Device vendor: NVIDIA Corporation
  624. Device driver: 390.87
  625. Device speed: 1530 MHz
  626. Device cores: 80 CU
  627. Device score: 1112
  628. Selected platform: NVIDIA CUDA
  629. Selected device: Tesla V100-SXM2-16GB
  630. with OpenCL 1.2 capability.
  631.  
  632. Started OpenCL SGEMM tuner.
  633. Will try 290 valid configurations.
  634. (1/290) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=16 NDIMB=8 NDIMC=8 NWG=16 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0689 ms (3045.4 GFLOPS)
  635. (2/290) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=32 NDIMB=8 NDIMC=8 NWG=16 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0548 ms (3828.0 GFLOPS)
  636. (5/290) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0538 ms (3901.0 GFLOPS)
  637. (21/290) KWG=16 KWI=2 MDIMA=16 MDIMC=16 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0509 ms (4116.6 GFLOPS)
  638. (27/290) KWG=32 KWI=2 MDIMA=16 MDIMC=16 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0489 ms (4289.0 GFLOPS)
  639. (88/290) KWG=32 KWI=8 MDIMA=16 MDIMC=16 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=2 0.0479 ms (4380.7 GFLOPS)
  640. (131/290) KWG=32 KWI=2 MDIMA=8 MDIMC=8 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=4 VWN=2 0.0471 ms (4452.2 GFLOPS)
  641. (135/290) KWG=16 KWI=2 MDIMA=16 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=16 SA=1 SB=1 STRM=0 STRN=0 VWM=4 VWN=2 0.0456 ms (4602.2 GFLOPS)
  642. (205/290) KWG=32 KWI=2 MDIMA=16 MDIMC=16 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=4 0.0445 ms (4708.0 GFLOPS)
  643. (238/290) KWG=32 KWI=8 MDIMA=16 MDIMC=16 MWG=32 NDIMB=8 NDIMC=8 NWG=32 SA=1 SB=1 STRM=0 STRN=0 VWM=2 VWN=4 0.0438 ms (4790.6 GFLOPS)
  644. Tuning process finished
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657. part 6g (optionnal, for manual install only) :
  658. how to run autogtp again (if exited)
  659.  
  660.  
  661. this will run next or master branch depending on which branch you installed :
  662.  
  663. cd leela-zero/autogtp
  664. ./autogtp
  665.  
  666.  
  667. note : this command :
  668. ./autogtp -g 2
  669. instead of ./autogtp produces games significantly faster, because when a 0% resign game is generated, the extra gpu power of the v100 can be used to produce another game simultaneously
  670. (265 games/24 hours VS 208 games/24hours)
  671. see this comment for details :
  672. https://github.com/gcp/leela-zero/issues/1905#issuecomment-428612310
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement