Page 1 of 5

Lc0 - macOS binary requested

Posted: Sat Feb 09, 2019 8:50 am
by Steppenwolf
Hi there. I am very interested in the Leela project, but I am not a programmer and cannot compile Lc0 by myself.
(I saw there is a description for Mac-users-:))
Please can anybody provide us with the binary for macOS?
Please can you post it like the windows Versions under: https://github.com/LeelaChessZero/lc0/releases.
Thanks in Advance.
😀

Re: Lc0 - macOS binary requested

Posted: Sun Feb 10, 2019 12:46 pm
by smatovic
Steppenwolf wrote: ↑Sat Feb 09, 2019 8:50 am Hi there. I am very interested in the Leela project, but I am not a programmer and cannot compile Lc0 by myself.
(I saw there is a description for Mac-users-:))
Please can anybody provide us with the binary for macOS?
Please can you post it like the windows Versions under: https://github.com/LeelaChessZero/lc0/releases.
Thanks in Advance.
😀
Hi there, maybe you should place your request on these LC0 related sites:

https://discordapp.com/invite/pKujYxD
https://groups.google.com/forum/#!forum/lczero
https://github.com/LeelaChessZero/lc0/issues

And if you are running macOS 10.14 Mojave,
you could give your OS vendor a hint
to continue support for OpenCL or CUDA,
to make a gpu programmers life easier.

https://en.wikipedia.org/wiki/MacOS_Moj ... and_OpenCL
https://devtalk.nvidia.com/default/topi ... cos-10-14/

--
Srdja

Re: Lc0 - macOS binary requested

Posted: Mon Apr 22, 2019 9:19 pm
by Spill_The_Tea
Hi Stepphen Wolf,

Compiling Lc0 was initially quite difficult in previous versions, and required a decent amount of modifications, but that is no longer true; However, this does assume you have downloaded the required dependencies. Assuming you have nothing, you'll first need to install xcode (from the app store). Then in terminal, you'll need these, and if not, they'll be helpful compiling other engines :

# Download Homebrew (allows for easy installation of different packages on mac)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... er/install)"

# Downloads via Homebrew
brew install python3
brew install meson
brew install ninja
brew install llvm --with-toolchain
brew install cmake
brew install protobuf

# Download Python Packages
pip install numpy
pip install wheel
pip install six
pip install setuptools
pip install tensorflow

# Download Lc0 Source Code & Compile
git clone https://github.com/LeelaChessZero/lc0.git
cd lc0/
./build.sh

Re: Lc0 - macOS binary requested

Posted: Thu May 16, 2019 8:51 am
by Steppenwolf
Hi Still_the_tea

thank you for your reply. But I was not successful.
Please can you Compile a macOS binary and post it.
How should I proceed with CUDA?

Re: Lc0 - macOS binary requested

Posted: Thu May 16, 2019 9:12 am
by Steppenwolf
by Typing these commands :

pip install numpy
pip install wheel
pip install six
pip install setuptools
pip install tensorflow

it always came: "command not found"

during compiling also came several error Messages...

I can you provide with the meson-log-text-file via PM if you wish-:)

Re: Lc0 - macOS binary requested

Posted: Sat May 18, 2019 6:27 am
by MikeB
Steppenwolf wrote: ↑Thu May 16, 2019 9:12 am by Typing these commands :

pip install numpy
pip install wheel
pip install six
pip install setuptools
pip install tensorflow

it always came: "command not found"

during compiling also came several error Messages...

I can you provide with the meson-log-text-file via PM if you wish-:)
Compiling yourself is the only way to ensure you have the correct dependancies installed on your computer. Without such dependancies, any binary that anyone posts will never work on your mac. It's that simple. Furthermore, to compile for OpenCL or Cuda is a little trickier and requires even more dependancies. Without Cudo or OpenCL, you will have to use open blas which is CPU based. At that point, it will be painfully slow. and hundreds of Elo weaker than those with high end GPU's. Now, if for some reason you sincerely believe your mac has magically acquired all of the aforementioned dependancies with out any successful effort on your part, here's a mac binary you can try..

https://www.dropbox.com/s/x2x1anufm1qvv ... 9.zip?dl=1

Re: Lc0 - macOS binary requested

Posted: Sat May 18, 2019 6:51 am
by MikeB
lc0 in action under xBoard on a 2010 Mac Pro .

Here's a code snippet. that will will tell you if have OpenCL hardware.

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <OpenCL/opencl.h>

int main(int argc, char* const argv[]) {
	cl_uint num_devices, i;
	clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices);
	
	cl_device_id* devices = calloc(sizeof(cl_device_id), num_devices);
	clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, num_devices, devices, NULL);
	
	char buf[128];
	for (i = 0; i < num_devices; i++) {
		clGetDeviceInfo(devices[i], CL_DEVICE_NAME, 128, buf, NULL);
		fprintf(stdout, "Device %s supports ", buf);
		
		clGetDeviceInfo(devices[i], CL_DEVICE_VERSION, 128, buf, NULL);
		fprintf(stdout, "%s\n", buf);
	}
	
	free(devices);
}
call it hello.c
compile with this:
clang -framework OpenCL hello.c -o hello

you will get warnings that OpenCL for the mac is going away - not great news for macOS users

Code: Select all

Mac-Pro:documents $ clang -framework OpenCL hello.c -o hello
hello.c:7:2: warning: 'clGetDeviceIDs' is deprecated: first deprecated in macOS 10.14 - (Define
      CL_SILENCE_DEPRECATION to hide this warning) [-Wdeprecated-declarations]
        clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices);
        ^
/System/Library/Frameworks/OpenCL.framework/Headers/cl.h:584:1: note: 'clGetDeviceIDs' has been explicitly
      marked deprecated here
clGetDeviceIDs(cl_platform_id   /* platform */,
^
hello.c:10:2: warning: 'clGetDeviceIDs' is deprecated: first deprecated in macOS 10.14 - (Define
      CL_SILENCE_DEPRECATION to hide this warning) [-Wdeprecated-declarations]
        clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, num_devices, devices, NULL);
        ^
/System/Library/Frameworks/OpenCL.framework/Headers/cl.h:584:1: note: 'clGetDeviceIDs' has been explicitly
      marked deprecated here
clGetDeviceIDs(cl_platform_id   /* platform */,
^
hello.c:14:3: warning: 'clGetDeviceInfo' is deprecated: first deprecated in macOS 10.14 - (Define
      CL_SILENCE_DEPRECATION to hide this warning) [-Wdeprecated-declarations]
                clGetDeviceInfo(devices[i], CL_DEVICE_NAME, 128, buf, NULL);
                ^
/System/Library/Frameworks/OpenCL.framework/Headers/cl.h:591:1: note: 'clGetDeviceInfo' has been explicitly
      marked deprecated here
clGetDeviceInfo(cl_device_id    /* device */,
^
hello.c:17:3: warning: 'clGetDeviceInfo' is deprecated: first deprecated in macOS 10.14 - (Define
      CL_SILENCE_DEPRECATION to hide this warning) [-Wdeprecated-declarations]
                clGetDeviceInfo(devices[i], CL_DEVICE_VERSION, 128, buf, NULL);
                ^
/System/Library/Frameworks/OpenCL.framework/Headers/cl.h:591:1: note: 'clGetDeviceInfo' has been explicitly
      marked deprecated here
clGetDeviceInfo(cl_device_id    /* device */,
^
4 warnings generated.
run it

Code: Select all

Mac-Pro:documents $ ./hello
Device Intel(R) Xeon(R) CPU           X5690  @ 3.47GHz supports OpenCL 1.2 
Device AMD Radeon HD 7950 Compute Engine supports OpenCL 1.2 
Mac-Pro:documents michaelbyrne$ 
Screenshot of lc0 playing against Honey - which is being capped here at about 80knps

Re: Lc0 - macOS binary requested

Posted: Mon May 20, 2019 10:02 am
by Steppenwolf
Dear MikeB,

thanks for your detailed Message with your help.
Unfortunately, I am not that expert to be able to Compile the binary (thanks for your uploaded binary, but I did not work :wink: ).
I also Understand that there are several libraries needed to run lc0 on macOS.

But why not making a complete bundle for some dummies like me where all the requested stuff is inside to be run on a mac?

Thanks again, Steppenwolf

Re: Lc0 - macOS binary requested

Posted: Tue May 21, 2019 5:52 am
by MikeB
Steppenwolf wrote: ↑Mon May 20, 2019 10:02 am Dear MikeB,

thanks for your detailed Message with your help.
Unfortunately, I am not that expert to be able to Compile the binary (thanks for your uploaded binary, but I did not work :wink: ).
I also Understand that there are several libraries needed to run lc0 on macOS.

But why not making a complete bundle for some dummies like me where all the requested stuff is inside to be run on a mac?

Thanks again, Steppenwolf
Steppenwolf,
I am 100% certain I can walk you through this over a few days if you are gamed for it. We might as well do it here , so anybody else having issues with macOS. I am partial to MacPorts over Homebew , but they both will work. In theory, you install it without MacPorts or HomeBrew, but those are tools to make installing any open source program much easier. So are you ready ?

Re: Lc0 - macOS binary requested

Posted: Tue May 21, 2019 7:38 am
by Steppenwolf
Dear MikeB,

Great thanks! :D
I am ready for it.

Please think, that I am not that programmer expert. I have Mojave 10.14.5 and a macbook pro (mid 2014) with no CUDA Driver.
Is there already one for Mojave?
If you need further Information...

Let us now start step by step with a detailed Instruction....