M1 Apple Silicon for Chess?

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

Moderator: Ras

acepoint_de
Posts: 86
Joined: Tue Jun 11, 2013 1:14 am

Re: M1 Apple Silicon for Chess?

Post by acepoint_de »

AlexChess wrote: Thu Feb 11, 2021 5:09 pm I have tried via command line (it says: illegal hardware instruction). Where I'm wrong?
No idea. I installed homebrew twice, one in /usr/local for intel and one in /opt/homebrew, according to the suggestions in the web. I made an alias ibrew for the intel stuff. I installed lc0 with

Code: Select all

brew install lc0
copied an renamed binary and net into my engine folder. Same for two different stockfish engines just for some small research.
Last login: Thu Feb 11 17:02:55 on ttys000
alex@Mac-mini-M1 ~ % /Users/alex/Documents/SCACCHI\ 2020/LC0\ MAC\ ARM\ 64\ 0.26.3/libexec/lc0 uci go infinite
zsh: illegal hardware instruction /Users/alex/Documents/SCACCHI\ 2020/LC0\ MAC\ ARM\ 64\ 0.26.3/libexec/lc0 uci
alex@Mac-mini-M1 ~ %
What does

Code: Select all

% file lc0-m1
lc0-m1: Mach-O 64-bit executable arm64
% file stockfish-m1
stockfish-m1: Mach-O 64-bit executable arm64
% file stockfish   
stockfish: Mach-O 64-bit executable x86_64
say in your case?
And how to use it in a chess GUI?
Like every other uci engine.

Ciao

acepoint
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: M1 Apple Silicon for Chess?

Post by Milos »

BetaPro wrote: Thu Feb 11, 2021 1:41 am
Milos wrote: Thu Feb 11, 2021 12:36 am
BetaPro wrote: Wed Feb 10, 2021 9:09 pm Lol when do people buy a laptop just to play chess. Why does my company or Google give every software engineer a MacBook instead of an ASUS?

To be fair, I think it's fine to prefer other laptops over a MacBook when it was Intel, but now, I dont see why anyone would buy a non MacBook laptop anymore, unless you must use some software just available on Windows. It's just that much better.

And if you want beefy GPUs, why not just go for a desktop..
You seems to be just a typical fanboy of a rotten apple. You see, there are ppl that hate closed "ecosystems", don't like macOS, prefer that most of the money they invest in laptop goes into hardware and not the logo and "slick" design, hate its thermal management, prefer to have real ports instead of dragging a bunch of "accessories", prefer to have flexibility to chose their own software instead of everything being set up how Apple thinks it's best for the sheep, etc. etc.
Haha calling me Apple sheep, I previously worked at AMD, even worked on the newest Cezanne APU drivers, and I'm still rooting for AMD; but for now I don't see anything laptop that can actually compete with the newest MacBooks.

If you choose to be blind to benchmarks and reviews, that's your personal issues.
You are a fanboy coz you are totally delusional about the performance of your favorite brand. Basically iSheep only look at Geekbench that is the least relevant and crappy benchmark that exists and the one where Apple pumps its performance.
Ryzen 5000 mobile top range CPUs (like 5700G or 5980HS) are better single core than M1 and in multicore are 50-80% stronger. M1 graphics/AI performance is a joke. In chess (SF-NNUE) gap is 30% single core and 120% multicore in favor of mobile AMD.
Some software just available on Windows you say? You don't even seem to be aware of how large laptop gaming community is. Good luck running any game on M1.
And all this M1 performance comes from advanced technology node, not superior architecture and other marketing BS Apple is selling to its iSheep.
When AMD moves in next gen to 5nm high-end performance gap is only gonna increase.
BetaPro
Posts: 19
Joined: Wed Nov 25, 2020 7:11 pm
Full name: Jean-Roy Lee

Re: M1 Apple Silicon for Chess?

Post by BetaPro »

Milos wrote: Fri Feb 12, 2021 1:44 am You are a fanboy coz you are totally delusional about the performance of your favorite brand. Basically iSheep only look at Geekbench that is the least relevant and crappy benchmark that exists and the one where Apple pumps its performance.
Ryzen 5000 mobile top range CPUs (like 5700G or 5980HS) are better single core than M1 and in multicore are 50-80% stronger. M1 graphics/AI performance is a joke. In chess (SF-NNUE) gap is 30% single core and 120% multicore in favor of mobile AMD.
Some software just available on Windows you say? You don't even seem to be aware of how large laptop gaming community is. Good luck running any game on M1.
And all this M1 performance comes from advanced technology node, not superior architecture and other marketing BS Apple is selling to its iSheep.
When AMD moves in next gen to 5nm high-end performance gap is only gonna increase.
Ah let the hate flow thru you.

If you just choose to ignore bunch of other standard benchmarks like SPEC, then you do you. In SPEC It's almost on par with 5950X in single thread ffs! And attacking Geekbench is probably one of Apple haters' favorite pasttime, even though most of the arguments are completely unfounded. The node advantage is also not that great of an argument, given that a better process doesn't really give that much in terms of single thread. The reason I care mostly about single thread is that adding more cores is easy, but having good core design is much harder.

Are you seriously attacking the graphics/AI capability of a chip found in an ultrabook? Once Apple chip gets scaled up, I'd be very surprised if it doesn't beat out anything else in the market, yes, even in SF-NNUE.

To be fair, yes, if you play heavy PC games, you'd be better served not getting a mac, but if I played games, I'd rather just get a desktop at that point.
Modern Times
Posts: 3703
Joined: Thu Jun 07, 2012 11:02 pm

Re: M1 Apple Silicon for Chess?

Post by Modern Times »

I'm with Milos, will never buy an Apple product, I despise that company.
User avatar
AlexChess
Posts: 1562
Joined: Sat Feb 06, 2021 8:06 am
Full name: Alex Morales

Re: M1 Apple Silicon for Chess?

Post by AlexChess »

acepoint_de wrote: Thu Feb 11, 2021 7:21 pm
AlexChess wrote: Thu Feb 11, 2021 5:09 pm I have tried via command line (it says: illegal hardware instruction). Where I'm wrong?
No idea. I installed homebrew twice, one in /usr/local for intel and one in /opt/homebrew, according to the suggestions in the web. I made an alias ibrew for the intel stuff. I installed lc0 with

Code: Select all

brew install lc0
copied an renamed binary and net into my engine folder. Same for two different stockfish engines just for some small research.
Last login: Thu Feb 11 17:02:55 on ttys000
alex@Mac-mini-M1 ~ % /Users/alex/Documents/SCACCHI\ 2020/LC0\ MAC\ ARM\ 64\ 0.26.3/libexec/lc0 uci go infinite
zsh: illegal hardware instruction /Users/alex/Documents/SCACCHI\ 2020/LC0\ MAC\ ARM\ 64\ 0.26.3/libexec/lc0 uci
alex@Mac-mini-M1 ~ %
What does

Code: Select all

% file lc0-m1
lc0-m1: Mach-O 64-bit executable arm64
% file stockfish-m1
stockfish-m1: Mach-O 64-bit executable arm64
% file stockfish   
stockfish: Mach-O 64-bit executable x86_64
say in your case?
And how to use it in a chess GUI?
Like every other uci engine.

Ciao

acepoint
I have done exactly the same. Now I try to move it on a different folder (I have launched it also from the compiled folder) . I use BanksiaGui and Stockfish M1 works fine.
Chess engines and dedicated chess computers fan since 1981 :D macOS Sequoia 16GB-512GB, Windows 11 & Ubuntu ARM64.
ProteusSF Dev Forum
Gian-Carlo Pascutto
Posts: 1260
Joined: Sat Dec 13, 2008 7:00 pm

Re: M1 Apple Silicon for Chess?

Post by Gian-Carlo Pascutto »

acepoint_de wrote: Thu Feb 11, 2021 9:49 am Did you try running lc0 at the command line using the commands uci and go infinite?
Yeah, of course. For me the tuning fails:

Code: Select all

Selected device: Apple M1
with OpenCL 1.2 capability.
Started OpenCL SGEMM tuner with batch size 16.
Will try 578 valid configurations.
Failed to find a working configuration.
Check your OpenCL drivers.
Unhandled exception: Tuner failed to find working configuration.
This is with current git though. Maybe they broke it.
Gian-Carlo Pascutto
Posts: 1260
Joined: Sat Dec 13, 2008 7:00 pm

Re: M1 Apple Silicon for Chess?

Post by Gian-Carlo Pascutto »

Gian-Carlo Pascutto wrote: Fri Feb 12, 2021 10:07 am This is with current git though. Maybe they broke it.
Ah, it's the network that is the problem. I guess it's too big.
Gian-Carlo Pascutto
Posts: 1260
Joined: Sat Dec 13, 2008 7:00 pm

Re: M1 Apple Silicon for Chess?

Post by Gian-Carlo Pascutto »

Gian-Carlo Pascutto wrote: Fri Feb 12, 2021 10:19 am
Gian-Carlo Pascutto wrote: Fri Feb 12, 2021 10:07 am This is with current git though. Maybe they broke it.
Ah, it's the network that is the problem. I guess it's too big.
Hmm, no, the homebrew version works with everything. So this is a mystery: if I compile the exact same version homebrew uses, OpenCL doesn't work. I looked at the homebrew formula and there's nothing special in there. WTF.

I then tried to brew install -s lc0 (i.e. compile from source), and the resulting exe crashed the M1 graphics driver.
Gian-Carlo Pascutto
Posts: 1260
Joined: Sat Dec 13, 2008 7:00 pm

Re: M1 Apple Silicon for Chess?

Post by Gian-Carlo Pascutto »

Gian-Carlo Pascutto wrote: Fri Feb 12, 2021 10:50 am Hmm, no, the homebrew version works with everything. So this is a mystery: if I compile the exact same version homebrew uses, OpenCL doesn't work. I looked at the homebrew formula and there's nothing special in there. WTF.

I then tried to brew install -s lc0 (i.e. compile from source), and the resulting exe crashed the M1 graphics driver.
It seems to work if I specify -Dgtest=false to the meson build. Strange. Really strange.
User avatar
AlexChess
Posts: 1562
Joined: Sat Feb 06, 2021 8:06 am
Full name: Alex Morales

Re: M1 Apple Silicon for Chess?

Post by AlexChess »

Gian-Carlo Pascutto wrote: Fri Feb 12, 2021 1:04 pm
Gian-Carlo Pascutto wrote: Fri Feb 12, 2021 10:50 am Hmm, no, the homebrew version works with everything. So this is a mystery: if I compile the exact same version homebrew uses, OpenCL doesn't work. I looked at the homebrew formula and there's nothing special in there. WTF.

I then tried to brew install -s lc0 (i.e. compile from source), and the resulting exe crashed the M1 graphics driver.
It seems to work if I specify -Dgtest=false to the meson build. Strange. Really strange.
I've managed to configure LC0 on BanksiaGui. It starts, but makes silly moves like: 1.e4-e6 2.Nf3-Ke7 ???? I think the NN is the cause.

Please, continue to try to fix it. I'm sure that Silicon M1 with neural network INSIDE will be the best for chess engines. Already with Rosetta 2 converted engines it is very very fast! I will follow your experiments :-D

AlexChess
Chess engines and dedicated chess computers fan since 1981 :D macOS Sequoia 16GB-512GB, Windows 11 & Ubuntu ARM64.
ProteusSF Dev Forum