LCZero is using my cores, not my GPU.

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Jhoravi
Posts: 248
Joined: Wed May 08, 2013 4:49 am

Re: LCZero is using my cores, not my GPU.

Post by Jhoravi » Tue Apr 24, 2018 2:58 am

kasinp wrote: I should rephrase: the performance will be close, but the GPU will achieve it without breaking sweat (it will never exceed 80% utilization), in my case it doesn't even go above silent mode. OTOH, the i9 will behave like a decent space heater to achieve the similar level of play. In that sense I consider the GPU to be a hands-down better option.
PK
While running in GPU does LCZero use the GPU memory too or just the system RAM?

Milton
Posts: 121
Joined: Wed Mar 08, 2006 11:58 pm

Re: LCZero is using my cores, not my GPU.

Post by Milton » Tue Apr 24, 2018 3:21 am

kasinp wrote:
kasinp wrote:
Milton wrote:I am getting a new computer around May 3 (a Dell Alien Area 51) and I would like to participate in this project.
Based on this configuration, would it be best for me to download the GPU file or the CPU file?

Intel® Core™ i9 7980XE
NVIDIA® GeForce® GTX 1080 with 8GB GDDR5X
32GB Dual Channel HyperX™ DDR4 XMP at 2933MHz
I would say GPU hands down. In my case a 1080 ti outperforms the CPU version running on a 14-core Xeon at 3.00GHz. Seems it really prefers the GPU architecture.
PK
I should rephrase: the performance will be close, but the GPU will achieve it without breaking sweat (it will never exceed 80% utilization), in my case it doesn't even go above silent mode. OTOH, the i9 will behave like a decent space heater to achieve the similar level of play. In that sense I consider the GPU to be a hands-down better option.

PK
OK. So I will download both files, but I will only run the GPU file unless we get cold weather here.

Albert Silver
Posts: 2860
Joined: Wed Mar 08, 2006 8:57 pm
Location: Rio de Janeiro, Brazil

Re: LCZero is using my cores, not my GPU.

Post by Albert Silver » Tue Apr 24, 2018 3:44 am

Jhoravi wrote:
kasinp wrote: I should rephrase: the performance will be close, but the GPU will achieve it without breaking sweat (it will never exceed 80% utilization), in my case it doesn't even go above silent mode. OTOH, the i9 will behave like a decent space heater to achieve the similar level of play. In that sense I consider the GPU to be a hands-down better option.
PK
While running in GPU does LCZero use the GPU memory too or just the system RAM?
I cannot say whether it uses the GPU memory or not, though presume it does, but it definitely uses the system RAM as well, even when running on the GPU.
"Tactics are the bricks and sticks that make up a game, but positional play is the architectural blueprint."

smatovic
Posts: 904
Joined: Wed Mar 10, 2010 9:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic
Contact:

Re: LCZero is using my cores, not my GPU.

Post by smatovic » Tue Apr 24, 2018 5:13 am

Is there a command line flag or something to tell it to use the GPU?

Code: Select all

  --gpu arg                    ID of the OpenCL device(s) to use (disables 
                               autodetection).
You can run lc0 with --tune-only,
that will output a list of your OpenCL devices with OpenCL IDs,
then you can select the device with --gpu arg and run --tune-only and --full-tuner,
that will try a thousands of configuration options and create a config file for your device.

e.g.

Code: Select all

lczero --tune-only
lczero --gpu 0 --tune-only --full-tuner

--
Srdja

Dann Corbit
Posts: 10101
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: LCZero is using my cores, not my GPU.

Post by Dann Corbit » Tue Apr 24, 2018 6:51 am

It does not see my GPU at all.

I have no file weights.txt so I copied network.txt to weights.txt

G:\chess\LCZero>lczero --tune-only
Using 2 thread(s).
Detecting residual layers...v1...64 channels...6 blocks.
Initializing OpenCL.
Detected 1 OpenCL platforms.
Platform version: OpenCL 2.0 AMD-APP (1912.5)
Platform profile: FULL_PROFILE
Platform name: AMD Accelerated Parallel Processing
Platform vendor: Advanced Micro Devices, Inc.
Device ID: 0
Device name: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Device type: CPU
Device vendor: GenuineIntel
Device driver: 1912.5 (sse2,avx)
Device speed: 3392 MHz
Device cores: 8 CU
Device score: 520
Selected platform: AMD Accelerated Parallel Processing
Selected device: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
with OpenCL 2.0 capability.
Loaded existing SGEMM tuning.

G:\chess\LCZero>lczero --gpu 0 --tune-only --full-tuner
Using 2 thread(s).
Detecting residual layers...v1...64 channels...6 blocks.
Initializing OpenCL.
Detected 1 OpenCL platforms.
Platform version: OpenCL 2.0 AMD-APP (1912.5)
Platform profile: FULL_PROFILE
Platform name: AMD Accelerated Parallel Processing
Platform vendor: Advanced Micro Devices, Inc.
Device ID: 0
Device name: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Device type: CPU
Device vendor: GenuineIntel
Device driver: 1912.5 (sse2,avx)
Device speed: 3392 MHz
Device cores: 8 CU
Device score: 520
Selected platform: AMD Accelerated Parallel Processing
Selected device: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
with OpenCL 2.0 capability.

Started OpenCL SGEMM tuner.
RNG seed: 0xb1e44da6 (thread: 3568476555)
Will try 5238 valid configurations.
(1/5238) KWG=16 KWI=2 MDIMA=8 MDIMC=16 MWG=16 NDIMB=8 NDIMC=8 NWG=16 SA=0 SB=0 STRM=0 STRN=0 VWM=1 VWN=1 0.7277 ms (2.9 GFLOPS)
(4/5238) KWG=32 KWI=2 MDIMA=8 MDIMC=16 MWG=64 NDIMB=8 NDIMC=16 NWG=16 SA=0 SB=0 STRM=0 STRN=0 VWM=1 VWN=1 0.6078 ms (3.5 GFLOPS)
(5/5238) KWG=16 KWI=2 MDIMA=16 MDIMC=8 MWG=32 NDIMB=8 NDIMC=8 NWG=16 SA=0 SB=0 STRM=0 STRN=0 VWM=1 VWN=1 0.4344 ms (4.8 GFLOPS)
(78/5238) KWG=32 KWI=2 MDIMA=8 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=16 SA=0 SB=0 STRM=0 STRN=0 VWM=2 VWN=1 0.3680 ms (5.7 GFLOPS)
(107/5238) KWG=32 KWI=8 MDIMA=16 MDIMC=16 MWG=64 NDIMB=8 NDIMC=8 NWG=16 SA=0 SB=0 STRM=0 STRN=0 VWM=2 VWN=1 0.3461 ms (6.1 GFLOPS)
(127/5238) KWG=32 KWI=2 MDIMA=8 MDIMC=8 MWG=32 NDIMB=8 NDIMC=16 NWG=16 SA=0 SB=0 STRM=0 STRN=0 VWM=4 VWN=1 0.3450 ms (6.1 GFLOPS)
(129/5238) KWG=32 KWI=2 MDIMA=16 MDIMC=8 MWG=64 NDIMB=8 NDIMC=8 NWG=16 SA=0 SB=0 STRM=0 STRN=0 VWM=4 VWN=1 0.3315 ms (6.3 GFLOPS)
(133/5238) KWG=32 KWI=2 MDIMA=8 MDIMC=8 MWG=64 NDIMB=16 NDIMC=8 NWG=16 SA=0 SB=0 STRM=0 STRN=0 VWM=4 VWN=1 0.2737 ms (7.7 GFLOPS)
(519/5238) KWG=16 KWI=2 MDIMA=8 MDIMC=8 MWG=64 NDIMB=8 NDIMC=8 NWG=16 SA=0 SB=0 STRM=1 STRN=0 VWM=8 VWN=1 0.2609 ms (8.0 GFLOPS)
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

smatovic
Posts: 904
Joined: Wed Mar 10, 2010 9:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic
Contact:

Re: LCZero is using my cores, not my GPU.

Post by smatovic » Tue Apr 24, 2018 7:17 am

It does not see my GPU at all.
Yes, it lists only the CPU.

On Linux, the command "lspci | grep VGA" should list your GPU as PCI device.

Install and/or run the command "clinfo",
that should list all of your installed OpenCL devices.

Linux distros use usually the open source driver "Nouveau" for Nvidia devices,
so you have to install the proprietary Nvidia driver packages from your repository
(driver, libopencl, opencl-icd) to get OpenCL support.
I have no file weights.txt so I copied network.txt to weights.txt

G:\chess\LCZero>lczero --tune-only
Using 2 thread(s).
Detecting residual layers...v1...64 channels...6 blocks.
64 channels and 6 blocks, looks like you are running still version 0.5. or 0.4.

--
Srdja

smatovic
Posts: 904
Joined: Wed Mar 10, 2010 9:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic
Contact:

Re: LCZero is using my cores, not my GPU.

Post by smatovic » Tue Apr 24, 2018 7:29 am

G:\chess\LCZero>lczero --tune-only
Ah, just see, you are running windows,
so maybe a gpu driver update may help?

Afaik LC0 needs OpenCl >= 1.2, not sure if lower versions will work.

--
Srdja

kasinp
Posts: 189
Joined: Sat Dec 02, 2006 9:47 pm
Location: Toronto

Re: LCZero is using my cores, not my GPU.

Post by kasinp » Tue Apr 24, 2018 10:37 am

Albert Silver wrote:
Jhoravi wrote:
kasinp wrote: I should rephrase: the performance will be close, but the GPU will achieve it without breaking sweat (it will never exceed 80% utilization), in my case it doesn't even go above silent mode. OTOH, the i9 will behave like a decent space heater to achieve the similar level of play. In that sense I consider the GPU to be a hands-down better option.
PK
While running in GPU does LCZero use the GPU memory too or just the system RAM?
I cannot say whether it uses the GPU memory or not, though presume it does, but it definitely uses the system RAM as well, even when running on the GPU.
GPU version 0.7 using 1080 ti also keeps 2-3 threads on my 14-core Xeon busy. During 10-15 min. analysis these typically allocate 3-4GB or RAM.

PK

Dann Corbit
Posts: 10101
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: LCZero is using my cores, not my GPU.

Post by Dann Corbit » Tue Apr 24, 2018 5:14 pm

I downloaded the GPU version, so I would assume it would use my GPU.
But right now I see LCZero using between 13 and 90% of my CPU.

It was not like that when I first started it. My CPU was quiet for some time.
I wonder if it downloads the CPU version by itself and then runs that.
What I see does not make sense to me.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

frankp
Posts: 216
Joined: Sun Mar 12, 2006 2:11 pm

Re: LCZero is using my cores, not my GPU.

Post by frankp » Tue Apr 24, 2018 5:29 pm

Even the gpu version used the cpu for MCTS playout. (Default is one thread I think).
And as you have seen there are separate executables for gpu and cpu. GPU used opencl and cpu openblas IIRC

Post Reply