Author Topic: CGMiner with HD7970 v slow?  (Read 28184 times)

Offline AnimalHungry

  • Newbie
  • *
  • Posts: 11
CGMiner with HD7970 v slow?
« on: April 18, 2013, 11:06:30 PM »
This is my first post, so Hi everyone. Also my first attempt at litecoin mining so go easy on me. 

I've been mining litecoins using GUIminer with my HD7970 card and get a hashrate of just under 600Kh/s when my card is pretty much maxed out. At this rate it finds an accepted share every 30 seconds or so. I hear that CGMiner is supposed to be faster so I set it up and get it mining. I set it to intensity 13 to start out and it gets a very respectable 520Kh/s without even trying. However, it takes forever to find an accepted share (it's been running now for 10 mins and has only found 2 accepted shares). Here are my settings and the DOS window with CGMiner running: http://postimg.org/image/chaqzyiop/. If anyone can point me in the right direction as to what I'm doing wrong then that'd be great.

Cheers
Simon

Offline gfoot

  • Jr. Member
  • **
  • Posts: 165
Re: CGMiner with HD7970 v slow?
« Reply #1 on: April 19, 2013, 12:14:45 AM »
Your GPU is not finding any shares (no accepts nor rejects) - plus you have HW errors showing up on the GPU line, which indicate that either the GPU reported some shares which the CPU rejected itself, or the GPU reported so many shares that it overflowed a buffer.  Neither should happen if the GPU is running smoothly.

I'm surprised, as your settings are not crazy, but you need to debug this more.

Run cgminer with "-D -T", plus your usual other settings, and see what it says is the maximum memory it can allocate.  If it seems low compared to your card's memory, make sure you set GPU_MAX_ALLOC_PERCENT properly (check the readme for details).  Also check the figure it gets for thread concurrency, as it auto-calculates that if you don't specify.  With -I13 you need thread-concurrency at least 8192 to avoid HW errors; at 4096 you'd get 100% HW errors.

Generally you should get reasonable results with no settings at all on the command line - so try that.  All of the following are bad signs, some worse than others, and many related to each other:

1) HW errors (either of the places it appears in the UI - it should be zero, though a few is not a big deal)
2) A+R = 0, U = 0, WU = 0 (your GPU found no shares, or your CPU filtered them all out)
3) WU low (for litecoin it should be numerically about 92% of your hash rate, in the long term; significantly lower means your GPU is not finding shares as quickly as it should, given your hashrate, and implies calculation errors; or just bad luck, it's a delicate statistic)
4) high GF or RF (these indicate communication problems with the server - not problems with your mining settings)

A healthy rig will have a strong hash rate, many more A than R, WU approximately 92% of the hashrate (ignoring units), and very low values for GF and RF.
BTC: 14ciemcbiGQ328NUTUz7j4wZ2tKy998C4a
LTC: LMUo6xEJZtPsNDpZe2QLEzmK1eW4tYZNLF

Offline AnimalHungry

  • Newbie
  • *
  • Posts: 11
Re: CGMiner with HD7970 v slow?
« Reply #2 on: April 19, 2013, 01:06:51 AM »
Thanks for the pointers. I ran CGMiner without anything else in the bat file other than my pool info and it just did the same thing as before - no accepted shares and a bunch of HW errors. I then put in the switches -D and -T and it spat out a ton of info, but to be honest I couldn't find where it mentioned memory allocation or thread concurrency, so I took some screenshots and have uploaded them here: 





I read the Readme file in the CGMiner folder and it doesn't mention anything about how to set a value for GPU_MAX_ALLOC_PERCENT. I tried adding "-GPU_MAX_ALLOC_PERCENT" with values from 10 to 100 but CGMiner wouldn't even run - it flashed up a DOS window and then disappeared so not sure what I did wrong there. Also tried "GPU_MAX_ALLOC_PERCENT" without the "-" but it just did the same thing.

Hope these screenshots help, as I'm sure there's a pretty simple fix to this.

Cheers
Simon

Offline AnimalHungry

  • Newbie
  • *
  • Posts: 11
Re: CGMiner with HD7970 v slow?
« Reply #3 on: April 19, 2013, 01:20:03 AM »
I think I found the memory allocation: Max mem alloc size is 536870912. If that's in bytes then it's only about 0.5GB and my 7970 card has 3GB of memory, so presumably I want to somehow tell CGMiner to use more of the card's memory?

Also, I now see thread concurrency is only 2048, and you said I needed at least 8192 on I13 to avoid HW errors. I'll play around with the thread concurrency setting and report back.

Cheers
Simon

Offline AnimalHungry

  • Newbie
  • *
  • Posts: 11
Re: CGMiner with HD7970 v slow?
« Reply #4 on: April 19, 2013, 01:52:16 AM »
Right, so I changed thread concurrency and the highest setting it'll tolerate is 8192, so I left it running and the stats now look much better with no HW errors, which is great:
photo hosting

However, CGMiner is still finding accepted shares waaaay slower than GUIMiner does on the same I13 intensity. The odd thing though is that CGMiner gets a slightly higher hashrate (about 540Kh/s and only 520Kh/s for GUIMiner), and also runs cooler, but it doesn't find accepted shares anything like as fast as GUIMiner does.  Also I don't even know that CGMiner is running on I13 whereas GUIMiner on I13 creates artifacting/noise/lag on all my windows.

The WU is a much higher number than the hashrate so I would have thought that was healthy, but is there anything else I could try to adjust to increase the rate at which it's finding accepted shares?

Cheers
Simon
« Last Edit: April 19, 2013, 01:54:50 AM by AnimalHungry »

Offline gfoot

  • Jr. Member
  • **
  • Posts: 165
Re: CGMiner with HD7970 v slow?
« Reply #5 on: April 19, 2013, 02:49:43 AM »
You should read SCRYPT-README as well as README - it explains GPU_MAX_ALLOC_PERCENT and has a lot of information on tuning, with a whole example section about the author's 7970.

Regarding GPU_MAX_ALLOC_PERCENT though, basically the driver is preventing cgminer from allocating more than 512MB, unless you say otherwise.  More memory allows higher thread concurrency and/or more CPU threads (-g), which gives you more options to try.

Your WU figure was high, but that just means you were lucky - you didn't leave it running for long enough for WU to stabilise (18 accepted shares is far too few for that).

I don't know why guiminer would give more accepted shares, other than luck again - if you were mining the same pool with the same difficulty settings, at least.  I thought guiminer was just a wrapper around cgminer, but I don't know much about that.

What make and model of 7970 do you use?  If you have one of the good ones then you could get much higher hash rates - follow the guidelines in SCRYPT-README, and/or copy settings other people have posted here.
BTC: 14ciemcbiGQ328NUTUz7j4wZ2tKy998C4a
LTC: LMUo6xEJZtPsNDpZe2QLEzmK1eW4tYZNLF

Offline Straticus

  • Jr. Member
  • **
  • Posts: 71
Re: CGMiner with HD7970 v slow?
« Reply #6 on: April 19, 2013, 03:01:30 AM »
I have always mined with cgminer, but when I have tried GUI it was the exact same for me. My shares went up way faster then on cgminer. I'm not sure if I'd trust GUI to be completely honest, but if you'd had great luck with it in the past then stick with it.
You down with LTC: LforyADSUrKWDSJtTWK1o7DZHFVgZpyxyg

Offline AnimalHungry

  • Newbie
  • *
  • Posts: 11
Re: CGMiner with HD7970 v slow?
« Reply #7 on: April 20, 2013, 05:23:29 AM »
Thanks for the help guys. So I went and read the Scrypt Readme and worked thru the CGMiner tweaking process, which went something like this:

Added setx GPU_MAX_ALLOC_PERCENT 100 to the first line of my bat file to allow it to use max GPU memory.

Set intensity at 13 then deleted shaders and thread concurrency to see what the bin file gives me for thread concurrency, which was 8192.  I then increased thread concurrency from 8192 to 10240 and it crashed so the max thread concurrency it can take is 8192.

Then I moved to --gpu-memclock and increased it until the GPU crashed. Highest stable setting was 1650.

Then came the –gpu-engine which I pushed up to 1140 before it crashed, but interestingly from 1110 up to 1140 didn’t really make much difference in hashrate (596-607 at 1110 and 598-605 at 1140), so I stuck with 1110.

Then I adjusted the intensity. I tried 18, then 20 but the hashrate dropped from 13. So I tried 14 and it went down again from the 13 rate. I tried 12 and it fell right off, so I’ve set it at 13.

So this is my bat file after that exercise:

setx GPU_MAX_ALLOC_PERCENT 100
cgminer --scrypt -o http://coinotron.com:3334 -u XXX -p 1234 --intensity 13 --worksize 256 -g 1 --shaders 2048 --thread-concurrency 8192 --auto-fan --gpu-memclock 1650  --gpu-engine 1110

This gives a hashrate of about 598. Is this good for this card?  I’m running it on an Asus Crosshair III Formula mobo, Phenom II X4 955 with 8GB of Mushkin DDR3 PC3 12800 7-7-7-20 Blackline RAM, with nothing overclocked except the video card via the CGMiner bat file.

I’ve only run it for 20 mins but the GPU temp is already at 82C so I may have to back something down a bit. What would you reduce if you wanted to reduce temps a bit but maintain a decent hashrate? Or is 82C fine for extended periods?

I haven’t tested the rate at which it finds accepted shares yet compared with GUIMiner – I’ll try and do that over the weekend.

Thanks again for all your help!

Cheers
Simon

EDIT:  I just noticed that the fan (using --auto-fan) was only on 85%. If I manually change the fan to run at 100% the temp drops down to 78C.  Is it bad to max out the fan like that for extended periods, or should I just trust the auto-fan to do its thing and not worry about the 82C temps?
« Last Edit: April 21, 2013, 04:20:55 AM by AnimalHungry »

Offline gfoot

  • Jr. Member
  • **
  • Posts: 165
Re: CGMiner with HD7970 v slow?
« Reply #8 on: April 21, 2013, 11:10:04 AM »
Sorry, just a quick reply - what figure does cgminer print for the maximum memory allocation it can perform?  Running it with "-T" makes it easier to see this.  It should be close to your card's total memory amount.  cgminer uses it to get its default thread concurrency figure, and if it's only offering you 8192 then that might indicate a memory allocation problem.

Also if you're experimenting with the command line make sure you don't have a conf file, or that the conf file only has settings in it that you're not trying to change on the command line.  The conf file overrides the command line.
BTC: 14ciemcbiGQ328NUTUz7j4wZ2tKy998C4a
LTC: LMUo6xEJZtPsNDpZe2QLEzmK1eW4tYZNLF

Offline AnimalHungry

  • Newbie
  • *
  • Posts: 11
Re: CGMiner with HD7970 v slow?
« Reply #9 on: April 21, 2013, 02:55:12 PM »
Thanks. My mem alloc is 2951741440, which I think is 2.75GB. I have 3GB of GDDR5 on this 7970 card so that's pretty close. Is it good enough?

I had example.conf, which I renamed with the extension .OLD so CGMiner ignores it but that made no difference to the memory allocation.

Offline heatgsm

  • Jr. Member
  • **
  • Posts: 25
Re: CGMiner with HD7970 v slow?
« Reply #10 on: April 21, 2013, 07:21:06 PM »
I have found on the forums some time ago info regarding the ratio:

" Gpu/Mem   Hashrate~
800/790   555kH/s
800/870   555kH/s
850/930   585kH/s
850/1065   585kH/s
900/1000   620kH/s
900/1155   625kH/s
900/1310   620kH/s
925/1000   635kH/s
925/1001   400kH/s
950/1205   655kH/s
950/1370   650kH/s
963/1375   665kH/s
963/1220   670kH/s
1000/1250   660kH/s
1000/1251   450kH/s
1000/1455   690kH/s
1024/1475   710kH/s
1044/1500   720kH/s
1044/1501   495kH/s

I've been playing a bit with cgminer (2.11.2 and 2.11.3) and scrypt during the last few hours.
So far the best performance I could achieve on my GV-R797OC-3GD on windows 7 x64 with catalyst 13.2b7 was around 720kH/s with the following settings:
720:
cgminer.exe --scrypt -o http://xxx -u x -p x --intensity 13 -g 2 --thread-concurrency 8192 --lookup-gap 2 --gpu-engine 1044 --gpu-memclock 1500

620:
cgminer.exe --scrypt -o http://xxx -u x -p x --intensity 13 -g 2 --thread-concurrency 8192 --lookup-gap 2 --gpu-engine 900 --gpu-memclock 1155   "

 I`ve quoted the above sentences because it`s other`s people work to get info to us, but I can tell you that they are for real  ;D
Feel free to drop some LTC`s I`ve you found my post helpfull...Thanks.
LMaizHLVyCagBE9vxZNYFsEskqAb7UaWZC

Offline ltc_for_me

  • Jr. Member
  • **
  • Posts: 22
Re: CGMiner with HD7970 v slow?
« Reply #11 on: April 21, 2013, 11:47:44 PM »
cgminer --scrypt -o http://coinotron.com:3334 -u XXX -p 1234 --intensity 13 --worksize 256 -g 1 --shaders 2048 --thread-concurrency 8192 --auto-fan --gpu-memclock 1650  --gpu-engine 1110
This thread post says the --shaders flag will overwrite the --thread-concurrency flag. Is this true - can anyone verify it? I can't see anything in the cgminer readme that confirms this.

Offline AnimalHungry

  • Newbie
  • *
  • Posts: 11
Re: CGMiner with HD7970 v slow?
« Reply #12 on: April 22, 2013, 12:46:32 AM »
cgminer --scrypt -o http://coinotron.com:3334 -u XXX -p 1234 --intensity 13 --worksize 256 -g 1 --shaders 2048 --thread-concurrency 8192 --auto-fan --gpu-memclock 1650  --gpu-engine 1110
This thread post says the --shaders flag will overwrite the --thread-concurrency flag. Is this true - can anyone verify it? I can't see anything in the cgminer readme that confirms this.

It's true and my --shaders is a redundancy. It says this in the Scrypt Readme file.

Cheers
Simon

Offline AnimalHungry

  • Newbie
  • *
  • Posts: 11
Re: CGMiner with HD7970 v slow?
« Reply #13 on: April 22, 2013, 12:55:41 AM »
I have found on the forums some time ago info regarding the ratio:

" Gpu/Mem   Hashrate~
800/790   555kH/s
800/870   555kH/s
850/930   585kH/s
850/1065   585kH/s
900/1000   620kH/s
900/1155   625kH/s
900/1310   620kH/s
925/1000   635kH/s
925/1001   400kH/s
950/1205   655kH/s
950/1370   650kH/s
963/1375   665kH/s
963/1220   670kH/s
1000/1250   660kH/s
1000/1251   450kH/s
1000/1455   690kH/s
1024/1475   710kH/s
1044/1500   720kH/s
1044/1501   495kH/s

I've been playing a bit with cgminer (2.11.2 and 2.11.3) and scrypt during the last few hours.
So far the best performance I could achieve on my GV-R797OC-3GD on windows 7 x64 with catalyst 13.2b7 was around 720kH/s with the following settings:
720:
cgminer.exe --scrypt -o http://xxx -u x -p x --intensity 13 -g 2 --thread-concurrency 8192 --lookup-gap 2 --gpu-engine 1044 --gpu-memclock 1500

620:
cgminer.exe --scrypt -o http://xxx -u x -p x --intensity 13 -g 2 --thread-concurrency 8192 --lookup-gap 2 --gpu-engine 900 --gpu-memclock 1155   "

 I`ve quoted the above sentences because it`s other`s people work to get info to us, but I can tell you that they are for real  ;D

Holy crap balls! This is great!! I used your 1044/1500 settings with setx GPU_MAX_ALLOC_PERCENT 100 in the first line of my bat file to allow it to use max GPU memory and I'm getting about 700Kh/s.  The only thing I don't like about it is the temperature, which after only 5 mins is up at 84C with the fan maxed out. A bit warm for my liking.

900/1155 gives me about 560Kh/s but with more reasonable 78C GPU temp which I'm totally fine with.

I'll mess around with it some more using the ratios you found, and then I'll need to compare the actual rate shares are accepted with those accepted using GUIMiner, which seems to trot along nicely at 525Kh/s but finds accepted shares faster than CGMiner did when CGMiner was running at 540Kh/s.  I'll run a test for a few hours and see which one comes out ahead.

Thanks again for sharing those ratios - a great help!

Cheers
Simon
« Last Edit: April 22, 2013, 01:05:30 AM by AnimalHungry »

Offline gfoot

  • Jr. Member
  • **
  • Posts: 165
Re: CGMiner with HD7970 v slow?
« Reply #14 on: April 22, 2013, 08:43:09 AM »
cgminer --scrypt -o http://coinotron.com:3334 -u XXX -p 1234 --intensity 13 --worksize 256 -g 1 --shaders 2048 --thread-concurrency 8192 --auto-fan --gpu-memclock 1650  --gpu-engine 1110
This thread post says the --shaders flag will overwrite the --thread-concurrency flag. Is this true - can anyone verify it? I can't see anything in the cgminer readme that confirms this.

It's not true that it overwrites the thread concurrency - it just affects the default choice of thread concurrency.  It's still redundant if you explicitly provide a thread concurrency value.  The source code is fairly clear on this - the lines in bold test whether you provided a thread concurrency, and if you did, just use the value you provided.  This is also the only place in the code that I can see the shaders value being used.

Quote from: cgminer/ocl.c
        if (opt_scrypt) {
                if (!cgpu->opt_lg) {
                        applog(LOG_DEBUG, "GPU %d: selecting lookup gap of 2", gpu);
                        cgpu->lookup_gap = 2;
                } else
                        cgpu->lookup_gap = cgpu->opt_lg;

                if (!cgpu->opt_tc) {
                        unsigned int sixtyfours;

                        sixtyfours =  cgpu->max_alloc / 131072 / 64 - 1;
                        cgpu->thread_concurrency = sixtyfours * 64;
                        if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders) {
                                cgpu->thread_concurrency -= cgpu->thread_concurrency % cgpu->shaders;
                                if (cgpu->thread_concurrency > cgpu->shaders * 5)
                                        cgpu->thread_concurrency = cgpu->shaders * 5;
                        }
                        applog(LOG_DEBUG, "GPU %d: selecting thread concurrency of %u",gpu,  cgpu->thread_concurrency);
                } else
                        cgpu->thread_concurrency = cgpu->opt_tc;
        }
BTC: 14ciemcbiGQ328NUTUz7j4wZ2tKy998C4a
LTC: LMUo6xEJZtPsNDpZe2QLEzmK1eW4tYZNLF