5

I am a lichess user who would like to be able to use my 8C/16T processor to the best of my ability, and yet when I start up a chess engine only one of my cores is working on stockfish the rest are either doing very very little of just nothing at all. Why is this happening and how can I fix it?

I am using Linux (Ubuntu 18.04 LTS)

This is what I was told on lichess forums:

Both javascript.options.shared_memory and dom.postMessage.sharedArrayBuffer.withCOOP_COEP have to be set to true.

As a very new linux user... how do I actually implement this?

user21158
  • 51
  • 3

2 Answers2

4

Those appear to be options to set in your Web browser, which is effectively the platform that LiChess runs on. You don't mention which browser you're using…

Chrome uses multiple cores and thereby searches many more nodes per second, without any special attention.

On my Mac, Firefox uses only one core, even after entering the settings you mention (using about:config). However, the Linux version responds well to these settings.

Obviously, a native chess engine would be more efficient still. This wouldn't integrate with LiChess, however.

Chromatix
  • 1,679
  • 9
  • 12
3

I will have to take them at their word that just setting those settings will fix your problem, but here is how you do that.

  1. In the URL bar, type "about:config" (without the quotes) and hit enter.
  2. Click "Accept the Risk and Continue" (this is just because your local computer does not have an SSL certificate from an accepted authority)
  3. You will get a warning "Changing these preferences can impact Firefox performance or security", but click "Show all" which will bring up the "Advanced Preferences" page.
  4. You can either scroll down until you find those settings, or you can use the search function, but find them, and change them to "True" using the button to the very right that looks something like opposite arrows.
  5. Restart the browser just in case, and try again.

Good luck.

P.S. Although I doubt it, what you see may be a bit different since I just did that on a Windows version of Firefox, so adapt as necessary. This has less to do with being a Linux user than the browser itself.

P.P.S. It appears that this only works on certain operating systems. @Chromatix determined that it does not work on a Mac, but does on Ubuntu. I determined that it does not work on Windows 10, and the slider for the number of cores is missing. I then installed Chrome, and it did work on Windows 10. We both determined that it appears to limit you to four cores, regardless of how many your PC has.

PhishMaster
  • 32,397
  • 4
  • 102
  • 174
  • These instructions do allow toggling those settings on the Mac version of Firefox. They did not, however, enable the multithreaded version of Stockfish. – Chromatix Jan 11 '20 at 12:38
  • I do not use Lichess, so I am not even sure where he is (or you). Are you just on the analysis board, and how do you see what cores are being used? With that, I can try to test it. That is why I prefaced my answer with: "I will have to take them at their word that just setting those settings will fix your problem". I answered the question of how to change the settings. – PhishMaster Jan 11 '20 at 12:43
  • I just tried it on Linux, and it *does* work fully there. The notation WASM changes to WASMX and the nodes/sec rate goes up a lot. And yes, this is on an analysis board - I opened one of the Studies games and selected a mid-game move for an example position to analyse. – Chromatix Jan 11 '20 at 12:50
  • I have already done that and though it almost 2x the number of nodes being calculated per second, it seemingly did little or maybe even surprisingly nothing to my cores. I am using a linux app called system monitor to check which cores are being used. – user21158 Jan 11 '20 at 12:51
  • It appears to be limited to 4 threads. It's definitely using 4 cores on my machine, which is also 8C/16T. – Chromatix Jan 11 '20 at 12:52
  • Funny, I just tried it on Windows, and it does not work there. :) I do not get the Cores slider. With Chrome, I did, and it worked immediately. And yes, it does seem to be limited to four cores. – PhishMaster Jan 11 '20 at 12:54