It is currently 11 Nov 2019, 20:00
   
Text Size

Magarena melting my CPU memory

Moderators: melvin, beholder, ubeefx, ShawnieBoy, Lodici, CCGHQ Admins

Magarena melting my CPU memory

Postby Senior Adrian » 07 Mar 2019, 01:05

Hi there community, someone recommended Magarena to me. I have one question. Why does it eats to almost 95% of my CPU memory? My PC fans go nuts when the AI is thinking. I have a fast PC with 16 gigs of ram. Does anybody have this issues? Is there a way to not put so much pressure on the CPU?
Senior Adrian
 
Posts: 6
Joined: 07 Mar 2019, 00:58
Has thanked: 3 times
Been thanked: 0 time

Re: Magarena melting my CPU memory

Postby melvin » 07 Mar 2019, 03:51

By default, the AI uses all available CPU cores to perform its work. It is possible to manually set the maximum number of cores to use on the command line via editing Magarena.sh (only available on Linux and Mac).

The last line should be changed to the following to limit the AI to one CPU core (the change is to add "--threads 1")
Code: Select all
exec java -Xms256M -Xmx512M -noverify -Dmagarena.dir=$magarena_dir -jar $magarena_jar --threads 1
Note that using fewer CPU cores will reduce the AI's playing strength.
User avatar
melvin
AI Programmer
 
Posts: 1057
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 456 times

Re: Magarena melting my CPU memory

Postby Senior Adrian » 07 Mar 2019, 08:01

Hi Melvin, thanks for your answer. So...i see. Its because of the tree-branch AI. I just watched you speech on "GeekcampSG"
YouTube channel about the implementation process of the AI. Its amazing what did you achieve with it. Im using Windows 10 so i guess i cant change the number of cores. Can this over-processing AI brake down the CPU on long term?
Senior Adrian
 
Posts: 6
Joined: 07 Mar 2019, 00:58
Has thanked: 3 times
Been thanked: 0 time

Re: Magarena melting my CPU memory

Postby melvin » 07 Mar 2019, 10:30

I just watched you speech on "GeekcampSG" YouTube channel about the implementation process of the AI. Its amazing what did you achieve with it.
Thanks for watching the talk, I hope it wasn't too technical.

Can this over-processing AI brake down the CPU on long term?
Not as far as I know, unless you have modified your CPU somehow, say by overclocking it or your CPU fan is not working properly. Under normal operating conditions, the CPU is designed for all its cores to be operating at once.
User avatar
melvin
AI Programmer
 
Posts: 1057
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 456 times

Re: Magarena melting my CPU memory

Postby Jessica » 11 Mar 2019, 22:21

melvin wrote:By default, the AI uses all available CPU cores to perform its work. It is possible to manually set the maximum number of cores to use on the command line via editing Magarena.sh (only available on Linux and Mac).

The last line should be changed to the following to limit the AI to one CPU core (the change is to add "--threads 1")
Code: Select all
exec java -Xms256M -Xmx512M -noverify -Dmagarena.dir=$magarena_dir -jar $magarena_jar --threads 1
Note that using fewer CPU cores will reduce the AI's playing strength.
I have a PC with 24 cores and I want to limit it to 12 cores but on windows. How do I do that?
________________________________________
May the Forge be with you, young Planeswalker!
User avatar
Jessica
 
Posts: 106
Joined: 07 Feb 2019, 16:17
Has thanked: 6 times
Been thanked: 0 time

Re: Magarena melting my CPU memory

Postby melvin » 12 Mar 2019, 02:04

Not possible to set this on Windows as it doesn't use a start up script like Linux or Mac.
User avatar
melvin
AI Programmer
 
Posts: 1057
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 456 times

Re: Magarena melting my CPU memory

Postby Jessica » 12 Mar 2019, 23:13

melvin wrote:Not possible to set this on Windows as it doesn't use a start up script like Linux or Mac.
Also not possible by passing command line arguments to the jar file by using windows command prompt?
________________________________________
May the Forge be with you, young Planeswalker!
User avatar
Jessica
 
Posts: 106
Joined: 07 Feb 2019, 16:17
Has thanked: 6 times
Been thanked: 0 time

Re: Magarena melting my CPU memory

Postby melvin » 13 Mar 2019, 02:59

> Also not possible by passing command line arguments to the jar file by using windows command prompt?

That is possible though a bit tedious, the command would be
Code: Select all
java -Xms256M -Xmx512M -noverify -jar Magarena.jar --threads 12
User avatar
melvin
AI Programmer
 
Posts: 1057
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 456 times


Return to Magarena

Who is online

Users browsing this forum: No registered users and 0 guests


Who is online

In total there are 0 users online :: 0 registered, 0 hidden and 0 guests (based on users active over the past 10 minutes)
Most users ever online was 427 on 11 Nov 2019, 13:00

Users browsing this forum: No registered users and 0 guests

Login Form