Pages:
Author

Topic: python OpenCL bitcoin miner - page 19. (Read 1239060 times)

member
Activity: 104
Merit: 10
April 11, 2011, 01:43:25 PM
I think I've found a bug in poclbm. If I'm right, it goes like this:

The OpenCL part is supposed to calculate the 8 first bytes of the hash. The 4 first bytes are calculated fine, but the next ones are not, so they end up being essentially random numbers. In specific situations, it could lead to the miner ignoring a valid block.

In the python code:
BitcoinMiner.py:161
Code:
				if h[7] != 0:
self.failure('Verification failed, check hardware!')
else:
This part checks that the first 4 bytes are indeed zeros. I added another check.

Like this:
Code:
				if h[7] != 0:
self.failure('Verification failed, check hardware!')
elif h[6] > 0x80000000:
self.failure('Verification 2 failed, check hardware or the algorithm! :-P')
else:

Then I made another change.

BitcoinMiner.py:273
Code:
			self.miner.search(	queue, (globalThreads, ), (self.worksize, ),
state[0], state[1], state[2], state[3], state[4], state[5], state[6], state[7],
state2[1], state2[2], state2[3], state2[5], state2[6], state2[7],
pack('I', uint32(0xFFFF0000)), pack('I', 0),  #<-- here's the target
pack('I', base),
f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7],
output_buf)
I saw the target given to OpenCL is hardcoded. I changed 0xFFFF0000 to 0x80000000. That should cause the OpenCL part to return nonces that result in hashes having the first 8 bytes lower than 0x0000000080000000, right?

Turns out it doesn't. When I ran poclbm, I got the "Verification 2 failed" message in a few minutes.

For some reason, there is commented-out code in BitcoinMiner.cl that modifies G, which should be the bytes 4-7 of the resulting hash in the end.

BitcoinMiner.cl:299
Code:
	//W13 = W13 + (rotr(W14, 7) ^ rotr(W14, 18) ^ (W14 >> 3U)) + W6 + (rotr(W11, 17) ^ rotr(W11, 19) ^ (W11 >> 10U)); 
//C = C + (rotr(H, 6) ^ rotr(H, 11) ^ rotr(H, 25)) + (B ^ (H & (A ^ B))) + K[61] + W13; G = G + C;

//G+=0x1f83d9abU;

Uncommenting them didn't fix the problem, though.

Why is this a problem, then? If the bytes 4-7 of the real hash are below the current target, but the OpenCL program calculates that they're over the hard-coded value of 0xFFFF0000, it would lead to a valid block being ignored, and no BTC for you.

Proposed fix: As the bytes 0-3 are calculated correctly and the target given to OpenCL is hardcoded anyway, I'd drop the target being sent to OpenCL altogether and have it just report nonces that lead to hashes for which the first 4 bytes are zero.
newbie
Activity: 55
Merit: 0
April 11, 2011, 11:06:50 AM

how do i run it on mac?



This is what I had to do.

Download and install Xcode

Install MacPorts from: http://www.macports.org/install.php

Install the dependences for poclbm. This step may take a long time while it downloads and compiles stuff:

sudo port install py26-pyopencl

Download the sources for m0mchil-poclbm, from https://github.com/m0mchil/poclbm

then open a terminal and extract it, and give it a try.

mkdir Bitcoin
cd Bitcoin
tar zxvf ~/Downloads/m0mchil-poclbm-b981138.tar
cd m0mchil-poclbm-b981138/
python2.6 poclbm.py -d 0 -o yourfavoriteminer -p 8332 -u [email protected] --pass=something

Be aware, that for what ever reason, OS X is FAR slower for mining than Linux or Windows. I run this on a Mac Pro with a pair of ATI Radeon HD 5770s. In OS X I get about 65Mhash/s on one and 95Mhash/s on the other. I installed  Ubuntu 10.10 and boot into it through Bootcamp. There I get 170Mhash/s on each card, over 2x the performance.


thanks.

using poclbm gives me about 3400 khash/s (4500 with -f 15 -w 64) while using diablominer i get 5500khash/s
this is on a 2010 mbp with a GeForce 320m
full member
Activity: 154
Merit: 100
April 11, 2011, 05:35:00 AM
Do you think those kinds of results are only possible on a dedicated box running Linux?

No.

As for the rest of your post, I don't know.
newbie
Activity: 35
Merit: 0
April 11, 2011, 05:22:49 AM
Hey guys,

I got my 5870 today.

Using the GUI miner by Kiv.

OSWin7 x64
Cat 11.3
SDK v2.4
Mem 900 Mhz

I'm pulling in 330 Mhash/s on average at the moment. Tends to bounce around from 328-336.

It's been going for about an hour and the temperature reading from the catalyst control center is 74c, activity 98%, fan speed 70%.

I'm using the following flags : -v -w128

Looking from the hardware comparison table I should be able to pull out some more, possibly up to 350. Do you think those kinds of results are only possible on a dedicated box running Linux? I'm not sure whether to downgrade the SDK to 2.1/2.2 to test it though. Also heard people were having problems with the GUI miner on 2.1, thoughts?



legendary
Activity: 3920
Merit: 2349
Eadem mutata resurgo
April 11, 2011, 01:45:33 AM
I removed one of my video cards for a bit and noticed the poclbm was not using 100% of a cpu core any more.  The second I added back in my 2nd card cpu usage jumped up to 1 full core pure instance of poclbm.  Apparently the high gpu usage is tied to dual card setups.

Although, the problem is not seen on Windows XP.  I have a miner running XP, that has dual 5870s, and poclbm doesn't eat cpu there.  It may only be a Windows 7 issue.

Maybe this can help track it down. 

On Linux Ubuntu 10.10, I think it maybe a bit more complicated than this ... I've noticed that when you run a graphical tool to monitor CPU/Mem usage (whilst miners are running) then the CPU usage skyrockets. If you use the command line tool

$top

the CPU usage stays low around 3-5%, and it is mostly on Xorg that is using the CPU. In  fact, I think if you run any process that has graphics GUI or other then Xorg goes nuts, it must be competing with poclbm for the GPU, even when you give it a -f 30 ....

A slightly related anomaly I noticed one time, after loggin in on boot-up I set all miners off and they were getting ~2MHash more than they normally do for about 10-15 seconds, but then something happened and they dropped back to normal speeds ... so i suspect Xorg hadn't woke up and stuck its nose in yet ... so to test the theory i rebooted and ran fgl_glxgears immediately on logging in. Similar behaviour, for 10-15 seconds I was getting 3000+ fps and then it stopped and throttled back to < 1000 fps ... so something (Xorg most likely)  is definitely jumping in and throttling poclbm and fglrx from running at optimum ... unfortunately it also eats CPU as it does it. Managing GPGPU processing with Xorg is a kludgy idea, can't believe this is the best AMD can come up with.
member
Activity: 60
Merit: 10
April 07, 2011, 11:16:03 PM
I removed one of my video cards for a bit and noticed the poclbm was not using 100% of a cpu core any more.  The second I added back in my 2nd card cpu usage jumped up to 1 full core pure instance of poclbm.  Apparently the high gpu usage is tied to dual card setups.

Although, the problem is not seen on Windows XP.  I have a miner running XP, that has dual 5870s, and poclbm doesn't eat cpu there.  It may only be a Windows 7 issue.

Maybe this can help track it down. 
full member
Activity: 182
Merit: 107
April 07, 2011, 05:46:31 PM
At the end or anywhere in the command?

Anywhere, so long as you don't separate another switch and its argument.  The end is a good place to put it if you want to be sure.  Smiley
newbie
Activity: 101
Merit: 0
April 07, 2011, 05:44:20 PM
At the end or anywhere in the command?
full member
Activity: 182
Merit: 107
April 07, 2011, 05:27:05 PM
I tried the search function, but I didn't get any results, so gonna ask my question.

Can I cap the processing power this can use? I'd like to be able to limit it to 50% or so power so I can still get decent gaming performance.

You shouldn't have to if you use -f.  Try adding -f 120 to the command line and play a game.  The game framerate will be just slightly degraded; I don't usually notice a difference.  If you have dual monitors and put the miner on the one you don't use for gaming, you'll notice that the hashrate will drop dramatically while you play.  Basically it will be using the extra GPU cycles that the game is idle during.
newbie
Activity: 101
Merit: 0
April 07, 2011, 05:21:14 PM
I tried the search function, but I didn't get any results, so gonna ask my question.

Can I cap the processing power this can use? I'd like to be able to limit it to 50% or so power so I can still get decent gaming performance.
full member
Activity: 126
Merit: 100
April 06, 2011, 11:00:27 PM
ขอบคุณมาก ครับ

That is Thai for Thank you very much
newbie
Activity: 1
Merit: 0
April 06, 2011, 10:57:12 PM
ขอบคุณมาก ครับ
newbie
Activity: 16
Merit: 0
April 05, 2011, 06:26:53 PM

how do i run it on mac?



This is what I had to do.

Download and install Xcode

Install MacPorts from: http://www.macports.org/install.php

Install the dependences for poclbm. This step may take a long time while it downloads and compiles stuff:

sudo port install py26-pyopencl

Download the sources for m0mchil-poclbm, from https://github.com/m0mchil/poclbm

then open a terminal and extract it, and give it a try.

mkdir Bitcoin
cd Bitcoin
tar zxvf ~/Downloads/m0mchil-poclbm-b981138.tar
cd m0mchil-poclbm-b981138/
python2.6 poclbm.py -d 0 -o yourfavoriteminer -p 8332 -u [email protected] --pass=something

Be aware, that for what ever reason, OS X is FAR slower for mining than Linux or Windows. I run this on a Mac Pro with a pair of ATI Radeon HD 5770s. In OS X I get about 65Mhash/s on one and 95Mhash/s on the other. I installed  Ubuntu 10.10 and boot into it through Bootcamp. There I get 170Mhash/s on each card, over 2x the performance.
newbie
Activity: 6
Merit: 0
April 05, 2011, 03:22:41 PM


AMD 5xxx and up
use '-v -w 128'

Hi miners!

This should be "-v -w 128" or "-v -w128" without quote of course?
newbie
Activity: 16
Merit: 0
April 05, 2011, 12:31:28 PM
I'm getting a crash on Mac OS X 10.6.7 with m0mchil-poclbm-b981138. It doesn't crash with m0mchil-poclbm-74a5442.

I've posted the stack trace here:
https://gist.github.com/902241

I'm running it like this:

python poclbm.py -o deepbit.net -p 8332 -u --pass= -d 0 -f 120

This is with Python 2.6.6 installed from MacPorts. All dependencies were also installed from MacPorts.

Anyone else running into this and found a fix?

Oddly, now it's working fine for me with b981138.
member
Activity: 90
Merit: 10
April 05, 2011, 12:30:46 PM
Hi,

I have a HD5850, and installed the AMD STREAM SDK 2.2.
But whenever i try to launch the miner i get my cpu's being used at 100% and no activity from the GPU.

Quote
Q: Why it uses 100% CPU?

You probably selected the CPU as OpenCL device. Or you are using it on Linux with AMD Stream SDK 2.2. Use 2.1 instead.

So how do i select the GPU as OpenCL device?

thank you.

EDIT: never mind just changed -d 0 to -d1 and the gpu was used.

Is there an option to limit the usage of the GPU to 50%?
newbie
Activity: 55
Merit: 0
April 05, 2011, 11:28:54 AM
I'm getting a crash on Mac OS X 10.6.7 with m0mchil-poclbm-b981138. It doesn't crash with m0mchil-poclbm-74a5442.

I've posted the stack trace here:
https://gist.github.com/902241

I'm running it like this:

python poclbm.py -o deepbit.net -p 8332 -u --pass= -d 0 -f 120

This is with Python 2.6.6 installed from MacPorts. All dependencies were also installed from MacPorts.

Anyone else running into this and found a fix?

how do i run it on mac?

newbie
Activity: 16
Merit: 0
April 04, 2011, 02:55:43 PM
I'm getting a crash on Mac OS X 10.6.7 with m0mchil-poclbm-b981138. It doesn't crash with m0mchil-poclbm-74a5442.

I've posted the stack trace here:
https://gist.github.com/902241

I'm running it like this:

python poclbm.py -o deepbit.net -p 8332 -u --pass= -d 0 -f 120

This is with Python 2.6.6 installed from MacPorts. All dependencies were also installed from MacPorts.

Anyone else running into this and found a fix?
jr. member
Activity: 56
Merit: 22
April 03, 2011, 07:31:51 AM
Still have the CTRL+c error

Code:
03/04/2011 14:29:26, Unexpected error:
Traceback (most recent call last):
  File "BitcoinMiner.pyo", line 142, in mine
IOError: [Errno 4] Interrupted function call

bye

Doesn't look like a graceful shutdown to me Tongue
full member
Activity: 193
Merit: 100
April 02, 2011, 10:28:43 PM
A while ago I installed opensuse 11.4, what exactly I need to do to use poclbm? The source only has 4 files and no makefile.
Pages:
Jump to: