nicehash / NiceHashMiner

NiceHash Miner
Other
477 stars 216 forks source link

CPU mining on Intel i7 series #443

Closed Allxander closed 6 years ago

Allxander commented 6 years ago

To keep development of NiceHash Miner Legacy streamlined please make sure the following are true before posting an issue:

Note this is a guide, you can delete this text once you ensure enough information is given

Allxander commented 6 years ago

Hello. I am have intel i7 6700k and start minig in nicehash legacy last ver 1814- pre3... and i have problem: CPU load only 50%, i chek it on TDP in HWiNFO64 only 40Wt... Tested games like follout 4, warframe, and others - tpd more than 52+Wt ... Real TDP of this CPU is near 95Wt... Yes i read instructions do not trust widnows managers - but real CPU not full loads. I am think it big bug ore something Maby any one can give me link for other mining program ore algoritms? CPU give me 280-300 H/s on cryptonight - it dont trust it ! My pc is stable and have 32G ram + SSD + video card +1000wt power, Win 10... I can test anythnig that u say ore recomend to do. And last - CPu temp is about 55-60 *C - no slow mode...

gpcola commented 6 years ago

I'm pretty sure this is normal if using xmrig. I see the same behaviour on my 4770k.

https://github.com/xmrig/xmrig/issues/73

12 threads and about 50% visible CPU load it's ok, no need more, because cache 100% used.

Allxander commented 6 years ago

I don not can belive that my CPU faster in all programs but cant do in some xmrig... Cache - smart cache be used by all cores -intel wiki... https://ark.intel.com/ru/products/88195/Intel-Core-i7-6700K-Processor-8M-Cache-up-to-4_20-GHz (Ru link) Why my CPU dont load all TDP ? why some %? cache is only some hardware = programs use hardware = it bug...

luongk commented 6 years ago

It's not a bug. The limiting factor is the amount of cache you have - there isn't enough cache to mine on all cores at the same time, so it only uses as many threads as you have available cache.

Allxander commented 6 years ago

NO it BUG. Ok google: CPU Cache is an area of fast memory located on the processor. Intel® Smart Cache refers to the architecture that allows all cores to dynamically share access to the last level cache. ALL CORES ! https://ark.intel.com/products/88195/Intel-Core-i7-6700K-Processor-8M-Cache-up-to-4_20-GHz proof ! select cache sector. Cant belive - my 6700K faster than amd sample product in all mathces - and slow in mining ? dont fun me.

luongk commented 6 years ago

@Allxander

From the xmrig repo: "Optimal number of threads depends on the size of the L3 cache of a processor, 1 thread requires 2 MB of cache."

Your CPU has 8MB of cache, therefore it is possible to run 4 threads efficiently (out of a maximum 8 threads that your CPU supports). The bottleneck in the system is the cache, not the number of cores/threads - this is why your CPU load is only 50%.

If you are having problems with low hashrates then have a look at https://github.com/nicehash/NiceHashMiner/wiki/Notes-and-hints-on-CPU-mining especially if you haven't enabled locked/huge pages.

Allxander commented 6 years ago

Ok if problem is cache why CPU is not full load like mining videocard = way i mean load TDP - used only 50%. Why CPU gives only 50% TDP? why not full? i dont belive that intel do bottleneck in cache. Chek algoritms ! Why games and programs can move this limit? My results is ~300 H/s not impressive me. In mining on video cars - no matter what mining method i ma use - TDP all itme is 100%, i am not use all ram ore other parts... I am think can be more effective method for use CPU cache ore cores for 90% ore more load.

luongk commented 6 years ago

You can't compare CPU mining to games or programs - those don't require as much cache. Each thread needs 2MB of cache to run optimally, you only have 8MB cache, therefore you can only run 4 threads optimally (which probably account for why TDP is 50% - you are running 4 threads out of a possible 8 total).

It isn't a bug, it's a simple factor of there isn't enough space for you to run 8 threads.

An analogy would be a motorway with eight lanes (8MB). You have really heavy cargo, and need to use big trucks that take up two lanes each (2MB). You can fit 4 trucks across the motorway (2MB x 4 = 8MB) - even though you have 8 lanes, you can only fit 4 trucks. Even if you put another 4 trucks behind the first four trucks, you wouldn't get to the destination any quicker.

Allxander commented 6 years ago

Okey u dont understand me correct. I am mean that miner use cache -good, cache is part of CPU -yes understand- good. Why cache not give all tdp ? Mechanichly cache only parts of CPU yes? If cores/threads not so matter load cache why it not load 100% my system is fast as non load? i can play some games from 2010 and some older whith no lags and mining process give me 270 H/S and still load 50% of CPU. i am read manual as i am say ^) And yes for final - i think miner do not used cache as posseble = more free is possble. Yes i am undersand what 6700k is powerfull intel device but please chek algoritms.

niknewb commented 6 years ago

@Allxander Just stop spamming already. Your tons of text are almost impossible to read. P.S @luongk have already explained to you why your CPU cores aren't fully utilized. I'm having absolutely the same situation: my overclocked i7 3770k on 4.7Ghz uses only 50W in mining simply because it can't load every core. The same goes for almost every CPU on the market EDIT: Run precise benchmark and enable "Lock pages in memory" function if you want to boost your CPU mining perfomance

luongk commented 6 years ago

Your CPU cores do the work (one thread per core), but you can only run four threads because you don't have enough cache.

The cache doesn't do the work, your CPU cores do - so even though your cache is 100% your total TDP is 50% because your other four cores aren't being used. You can force them to run, but there isn't enough cache so it is pointless.

It would be like trying to load a 8x2GB video file into RAM when you only have 8GB RAM

riccardoruspoli commented 6 years ago

Same here, I'm mining on some i7-6700K (on school computers), a while ago I used xmr-stak-cpu, now I'm using xmrig, but the % of load is still about 50%.

As explained by @luongk, it isn't a bug for the reasons he wrote, it's normal having that % of load. Plus, I'm getting 300 H/s on CryptoNight for each CPU, which I think is a good result.

mcsjohn commented 6 years ago

It is not a bug, in fact it also the optimal setting for xmr-stak-cpu (see https://github.com/nicehash/NiceHashMiner/wiki/Notes-and-hints-on-CPU-mining) For the fun of it you can try forcing the number of threads for xmrig by setting --threads=8 (or whatever value you like). You will see the same or most likely less H/s.

Allxander commented 6 years ago

Rikifire how many H/S do u have on 6700k? @luongk I am mean than cache is only part of CPU (it have many parts i think) and cache must give same load (TDP) if cores non load... can u test it? Yes give special job for cache - not for CPU cores/theads ! What i mean in -sry English not my realy lang... Thanks for links for manuals - but i already read it and think this method have problems/bugs. For ram for a sample is a bad idea - windows system (and others i think) can clear non using memory and swap it, and i think others methods can possble...

riccardoruspoli commented 6 years ago

As in my previous comment, each i7-6700k produces an average of 300 H/s.

bruvv commented 6 years ago

Best thread on here. Not understanding the difference between CPU chache and RAM. @allxander do you really think they're talking about 8mb RAM cache ? Lol

DillonN commented 6 years ago

Yes as a couple have said it is not a bug, but because running the CryptoNight algorithm requires 2MB of CPU L3 cache per thread, optimal thread count will be lower than total thread count for many CPUs

E.g. on a 5820k there are 6 cores and 12 threads, but 15MB of L3 cache. So optimal thread count is around 7-8. You can manually increase the thread count by adding e.g. --threads=8 to the Xmrig extra launch parameters in settings, which would be the total threads of a 6700k. However you will likely not get better performance than 4 threads despite the fact that the CPU is running at 100% then.

RAM has nothing to do with this - 6700k has 8MB of L3 cache, and that is maxed out on Xmrig with 4 threads. Cache does not require significant power and so you will not see a maximum power draw when running Xmrig optimally

Allxander commented 6 years ago

@DillonN oh if cache do not requeire power. U mean than cahe working non do power (TDP)? if i am use cache do no use cpu threads - what result i am got? can u test this moment? I am not programmer ore CPU specialist but think it real moment of truth. I am cant create job for cache - do not have mind for it, but think problem is not size of cache - problem in optimization. In manual for newbies on intel says what cache worker faster than DDR and other parts of PC, but cache only hardware part of CPU and slow block for main CPU. I am think u can test u algorithms (soft) for cache again and then cahe+ cores... Can u do it? @nivong if u nothing to say - do not say anything. Yes i am think all do mistakes and different only SIZE of problems after. jackpot1136 - sry i cant traslate it correct - to many words ^)

luongk commented 6 years ago

@Allxander We're trying to explain it in a way you can understand.

The cache is like memory for your CPU. The cache doesn't do the work, your CPU does the work. The cache is just the space in which your CPU does the calculations.

There is not enough room in the cache to do more than 4 calculations, which means that four of the cores of your CPU aren't used for mining (or even if they were, it wouldn't increase the speed - because there is no room to do more than 4 calculations).

Here is another analogy: You have eight friends, but you only have space for four people in your hot-tub. There is no space for any more people in the hot tub. You can share access to the hot tub which means that all of your eight friends get to spend time in the hot tub, but the overall amount of time is unchanged (8 friends at 50% of the time is exactly the same as 4 friends at 100% of the time).

Allxander commented 6 years ago

Okey i can understand this idea -but u can test what i am say? If my cache full busy why i can use my pc with games and others applications with using CPU. Why it can possble? If cache used 100% i must got freezs and slow mode. I can undersatd that this application use 2m for 1 core but cant uderstand why i have so many free perfomance left in free (in cache too). Can be mistakes on algoritms ore coding and others? Just chek on CPU like mine ore other. Yes it can take time but be better find bug now then later.

bruvv commented 6 years ago

It tested it same PC same CPU and outcome. It's normal. Now stop by posting

Allxander commented 6 years ago

nivong move out from my topic moron. 120+ years ago all people know what SUN spin around Earth.... Who know thuth will be fired.

bruvv commented 6 years ago

Joe r ferry welkum!!!11

riccardoruspoli commented 6 years ago

@Allxander, tomorrow I'll try 100% TDP on the i7-6700K, and then I'll report the results, ok?

Allxander commented 6 years ago

Rikifire plies test algoritms of usigt cache and yes try ) i cant use all 100% tdp using xmrig (ore alternative algoritm). And say what setting do u use for test and that result u got. Thx man !

luongk commented 6 years ago

@Allxander Just to clarify, what you are asking is impossible - there is no bug, you cannot mine using just the CPU or just the cache. It isn't a mistake in the coding, it is not something that can be tested or changed. Here's another analogy modified from reddit:

Let's say you and your eight friends (CPU cores) want to write a paper on a specific topic, but the internet is down for some reason and you have to rely on books from a library. The library is like the main memory (RAM) of a computer.

If you had to go to the library each time you need to check something in a book, your paper would take forever. But what you can do is borrow some of the books from the library and store them on a bookshelf at home. That way, if you need one of these books you can go and fetch it. You don't need to go to the library as often now. The bookshelf is like the L3 cache.

You only have room for 4 books on the L3 cache bookshelf. Each of your friends (CPU cores) need a book to work on, but there are only four books available - so four of your friends sit around doing nothing. You could get those four friends to work on the project (hashing) as well, but they would have to share the books - they would only get access to the books for half the time, so there is no increase in overall productivity (hashrate).

You are asking to test whether the bookshelf can write the report on their own, or whether your eight friends can write the report without using the bookshelf. Can you see why that isn't possible? If you use your computer while it is hashing on the CPU, the hash rate will drop slightly. Freezes/slowing would generally only occur if you don't have any unused cores (you have four free cores).

riccardoruspoli commented 6 years ago

I’ve tried to run xmrig with --threads=8, and I’ve reached 100% TDP. With 4 threads the hashrate is ~300H/s, with 8 threads is ~150H/s.

Allxander commented 6 years ago

luongk ok nice example ^) But cache is build resource - it can be used many times and create only step by step for other parts of PC. If cache full load > all other resurses be in slow mode.. Performance in PC: HHD/SSD> DDR> CPU cache> videocard= CPU. If u got all DDR load > freez, all CPU load > freez.... why i am dont got freez then load cache ? U can test cache use DDR test and some cpu like sisoftsandra. And i still think cache do not use full time 100%> too many free cache free for applications. If u say bottleneck is hache - it must be all taken and appl will be freezed. I am think no all cache used 100% and cant prove it. Any way thx for help. Rikifire - u dont have 100% TDP - only windows manager give 50% loading and 50wt TDP. I am use HWiNFO64 and Core Temp fot test temperature and load power. Fallout 4 and other games give 60+wt and more load CPU...

bruvv commented 6 years ago

I'm dead shoot me please I've never read so many stupid things

luongk commented 6 years ago

I'm out, I can't explain this any simpler.

@allxander If you don't agree with us despite all the information provided to you, maybe take it up with the developers of the specific CPU miners, it is not a NHML issue.

Allxander commented 6 years ago

Can u give information to developers miners of NHML? yes u can send it to my mail of registration. Thx for patience mr Luongk :) and yes u can close/delete this topic after give me adress.

luongk commented 6 years ago

https://github.com/xmrig/xmrig https://github.com/fireice-uk/xmr-stak-cpu

Fair warning - you will get exactly the same response

StuntzX commented 6 years ago

I have a i7-6700k Nicehash Says it does not support Regular version and legacy version. Is there something i am missing? any reason an i7-7700k works and not the 6700k? Mostly just mining when not using computer have 980ti and 6700k have 1050ti and 7700k at work which i dont have to pay elec. that works fine. its just the 6700k i would like to add that extra boost any help is appreciated. Thanks

KatWritesCode commented 6 years ago

I'm mining on an i7 7820x. It has 8 cores and 11MB cache. Why am I running at 45%-50% load instead of 60%-65%? Shouldn't I be able to use 5 cores and 10 megs of cache for 62.5% of my CPU availability? Also, why so much lag when using only half of a CPU intended for multitasking?

EDIT: Whoops. 5 threads, not 5 cores. Math works, I don't always. Leaving this up in case anyone else makes the same mistake.