Bitcoin Forum
April 20, 2024, 01:03:05 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [29] 30 31 32 33 34 35 36 37 38 39 40 41 »
  Print  
Author Topic: [XPM] Working on a GPU miner for Primecoin, new thread :)  (Read 166544 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic.
arnuschky
Hero Member
*****
Offline Offline

Activity: 517
Merit: 501


View Profile
September 07, 2013, 12:42:21 PM
 #561

I then ran into another weird problem when compiling the kernels

For the record, here's the error:

Code:
Write buffer vPrimes, 6302644 bytes. Status: 0
Compiling kernel... this could take up to 2 minutes.
ptxas error   : Entry function 'CalculateMultipliers' uses too much shared data (0x5078 bytes + 0x10 bytes system, 0x4000 max)

What GPU? It seems it only has 16 kilobytes of local memory, whereas I've programmed the miner with the assumption of 32 kilobytes, which is what ~all AMD GPUs have.


It's a NVIDIA Corporation GT215 [GeForce GT 240]. It's a few years old, so might not be the best choice. Just happens the only one I can easily test on.

It seems tha Nvidia cards with a "compute capability version" < 2.0 have only 16KB of local memory, all above 512KB. See http://en.wikipedia.org/wiki/CUDA#Supported_GPUs for a list which GPU has which compute capability version.
1713574985
Hero Member
*
Offline Offline

Posts: 1713574985

View Profile Personal Message (Offline)

Ignore
1713574985
Reply with quote  #2

1713574985
Report to moderator
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
bcp19
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500



View Profile
September 07, 2013, 03:04:37 PM
 #562

Any word on getting this to work on NVIDIA cards? From what I understand it's because the nvidia cards don't support opencl 1.2 (yet?). Any potential workarounds on windows or linux?

NVIDIA is poor at doing anything GPGPU.

Wha..?!  No way!  NVIDIA has a huge advantage over AMD in many aspects.  Just look at how well their software works compared w/AMD's.  You still need an X server running to do computation with AMD GPUs and that totally blows.

NVIDIA made a poor (IMO) strategic decision by abandoning OCL but you still have to give them the credit for creating it!  I think they were afraid to abandon their early adopter CUDA customers and decided they didn't have the throughput to support both.

I think eventually they'll reverse their position on OCL.  But to a lot of folks doing GPGPU they don't care about OCL and they're using CUDA and loving it.  So it's not fair to say "NVIDIA is poor at doing anything GPGPU" IMO.

OpenCL Trademarks belong to Apple Corp. I dont think Nvidia made OpenCL.

They might be good at GPGPU, but only on the GPU's that specialize in it. ie. Their tesla series. The consumer GPU's they make aren't as good.. but they are also the vast majority.

Idk.

All I know is that the GPGPU software I've seen out there runs tons faster on ATI cards than it does on NVIDIA cards.
CUDA would work very well for this type of computing.  Over on Mersenne.org, they have had CUDA based programs to run the Lucas-Lehmer tests for quite some time now while the OPENCL crowd have barely gotten one functioning and at nowhere near the speed of CUDA.

In trial factoring work, a GTX590 using CUDA puts out 681.6GHz Days of work per day compared to a 7990 using OPENCL putting out 748.7.   On sha-256 the 590 is ~190 to the 7990's 1200+.   Porting the OPENCL to CUDA will not be an easy task, but I'd bet the result would surprise you.

I do not suffer fools gladly... "Captain!  We're surrounded!"
I embrace my inner Kool-Aid.
ReCat
Sr. Member
****
Offline Offline

Activity: 406
Merit: 250



View Profile WWW
September 07, 2013, 04:07:02 PM
 #563

Any word on getting this to work on NVIDIA cards? From what I understand it's because the nvidia cards don't support opencl 1.2 (yet?). Any potential workarounds on windows or linux?

NVIDIA is poor at doing anything GPGPU.

Wha..?!  No way!  NVIDIA has a huge advantage over AMD in many aspects.  Just look at how well their software works compared w/AMD's.  You still need an X server running to do computation with AMD GPUs and that totally blows.

NVIDIA made a poor (IMO) strategic decision by abandoning OCL but you still have to give them the credit for creating it!  I think they were afraid to abandon their early adopter CUDA customers and decided they didn't have the throughput to support both.

I think eventually they'll reverse their position on OCL.  But to a lot of folks doing GPGPU they don't care about OCL and they're using CUDA and loving it.  So it's not fair to say "NVIDIA is poor at doing anything GPGPU" IMO.

OpenCL Trademarks belong to Apple Corp. I dont think Nvidia made OpenCL.

They might be good at GPGPU, but only on the GPU's that specialize in it. ie. Their tesla series. The consumer GPU's they make aren't as good.. but they are also the vast majority.

Idk.

All I know is that the GPGPU software I've seen out there runs tons faster on ATI cards than it does on NVIDIA cards.
CUDA would work very well for this type of computing.  Over on Mersenne.org, they have had CUDA based programs to run the Lucas-Lehmer tests for quite some time now while the OPENCL crowd have barely gotten one functioning and at nowhere near the speed of CUDA.

In trial factoring work, a GTX590 using CUDA puts out 681.6GHz Days of work per day compared to a 7990 using OPENCL putting out 748.7.   On sha-256 the 590 is ~190 to the 7990's 1200+.   Porting the OPENCL to CUDA will not be an easy task, but I'd bet the result would surprise you.

It's not very much of a surprise. I realize how different architectures can specialize in different types of tasks and have a significant advantages with them. I was just going by the little information I have seen about it, which I guess did not fully explain the situation.

BTC: 1recatirpHBjR9sxgabB3RDtM6TgntYUW
Hold onto what you love with all your might, Because you can never know when - Oh. What you love is now gone.
ivanlabrie
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
September 07, 2013, 06:01:23 PM
 #564

Tested the beta2 in my Windows 7 SP1 64 bit (pro) pc and it still behaves the same way, crashes after a minute of running, and changing settings only helps prolonging the agony, so to speak. Sad
Vorksholk
Legendary
*
Offline Offline

Activity: 1713
Merit: 1029



View Profile WWW
September 08, 2013, 12:24:44 AM
 #565

Many people around have had trouble getting reaper to work correctly (especially the primecoin-based fork) and are getting errors. As well, others want to log their reaper output so they can analyze it, or want to filter out messages that spam the console ("GPU stuff"). To that effect, I made a quick-and-dirty little program which runs in java and works on the Windows version of reaper to allow you to filter reaper output, and capture logs of the reaper output. Additionally, it also allows you to quickly combine your reaper.conf and primecoin.conf files into your output log.

http://www.theopeneffect.com/reaperreader.jar

Published under creative commons.

VeriBlock: Securing The World's Blockchains Using Bitcoin
https://veriblock.org
bitwarrior
Legendary
*
Offline Offline

Activity: 1764
Merit: 1000



View Profile
September 08, 2013, 02:09:54 AM
 #566

Hope to see an update on the appcrash issue Wink
bitwarrior
Legendary
*
Offline Offline

Activity: 1764
Merit: 1000



View Profile
September 08, 2013, 02:10:38 AM
 #567

Many people around have had trouble getting reaper to work correctly (especially the primecoin-based fork) and are getting errors. As well, others want to log their reaper output so they can analyze it, or want to filter out messages that spam the console ("GPU stuff"). To that effect, I made a quick-and-dirty little program which runs in java and works on the Windows version of reaper to allow you to filter reaper output, and capture logs of the reaper output. Additionally, it also allows you to quickly combine your reaper.conf and primecoin.conf files into your output log.

http://www.theopeneffect.com/reaperreader.jar

Published under creative commons.

Thanks for sharing this program Vorsholk
arnuschky
Hero Member
*****
Offline Offline

Activity: 517
Merit: 501


View Profile
September 08, 2013, 08:28:42 AM
Last edit: September 08, 2013, 11:50:24 AM by arnuschky
 #568

Here's the patch to make it work with OpenCL 1.1 (and therefore Nvidia cards).

Replace function OpenCL::WriteBufferPattern in file AppOpenCL.cpp with the following code:

Code:
void OpenCL::WriteBufferPattern(uint device_num, string buffername, size_t data_length, void* pattern, size_t pattern_length)
{
_clState& GPUstate = GPUstates[device_num];
if (GPUstate.buffers[buffername] == NULL)
cout << "Buffer " << buffername << " not found on GPU #" << device_num << endl;
#ifdef CL_VERSION_1_2
cl_int status = clEnqueueFillBuffer(GPUstate.commandQueue, GPUstate.buffers[buffername], pattern, pattern_length, 0, data_length, 0, NULL, NULL);
#else
  uint8_t buffer[data_length];
  for(uint16_t i=0; i<(data_length / pattern_length);i++)
    memcpy((&buffer[i*pattern_length]), pattern, pattern_length);
cl_int status = clEnqueueWriteBuffer(GPUstate.commandQueue, GPUstate.buffers[buffername], CL_TRUE, 0, data_length, buffer, 0, NULL, NULL);
#endif
if (globalconfs.coin.config.GetValue<bool>("opencldebug"))
cout << "Write buffer pattern " << buffername << ", " << pattern_length << " bytes. Status: " << status << endl;
}

This runs for me, but I am getting
Code:
0 fermats/s, 0 gandalfs/s.
0 TOTAL
most likely because my card it too old and I had to set worksize 64 in primecoin.conf.

If you have a newer Nvidia card (with a "compute capability version" >= 2.0 according to http://en.wikipedia.org/wiki/CUDA#Supported_GPUs ), try to set worksize 512 and see what this gives you.
arnuschky
Hero Member
*****
Offline Offline

Activity: 517
Merit: 501


View Profile
September 08, 2013, 08:29:56 AM
 #569

BTW, Maybe it's time to put the code on GitHub... mtrlt?
crendore
Sr. Member
****
Offline Offline

Activity: 363
Merit: 250


View Profile
September 08, 2013, 09:12:28 AM
Last edit: September 08, 2013, 09:25:05 AM by crendore
 #570

If you have a newer Nvidia card (with a "compute capability version" < 2.0 according to http://en.wikipedia.org/wiki/CUDA#Supported_GPUs ), try to set worksize 512 and see what this gives you.

Do you mean less than or more than?  The way you wrote it it reads "less than 2.0", but that doesn't really make any sense in the context.

Edit: also the code you pasted seems to cut off on the right hand side on a couple of the lines.

mtrlt (OP)
Member
**
Offline Offline

Activity: 104
Merit: 10


View Profile
September 08, 2013, 11:32:17 AM
 #571

BTW, Maybe it's time to put the code on GitHub... mtrlt?
Yeah, the week is almost up.
arnuschky
Hero Member
*****
Offline Offline

Activity: 517
Merit: 501


View Profile
September 08, 2013, 11:50:50 AM
 #572

If you have a newer Nvidia card (with a "compute capability version" < 2.0 according to http://en.wikipedia.org/wiki/CUDA#Supported_GPUs ), try to set worksize 512 and see what this gives you.

Do you mean less than or more than?  The way you wrote it it reads "less than 2.0", but that doesn't really make any sense in the context.

Edit: also the code you pasted seems to cut off on the right hand side on a couple of the lines.

Err, you are right of course. I meant >= 2.0. I corrected the original post, also regarding the cut-off lines.
ivanlabrie
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
September 08, 2013, 12:49:45 PM
 #573

Interesting that it can work on Nvidia...seems like something for Titan/780/580 owners to do.

Nice Smiley
wyldfire
Newbie
*
Offline Offline

Activity: 23
Merit: 0


View Profile
September 08, 2013, 09:46:56 PM
 #574

I didn't have jansson installed when I built reaperprime, so I downloaded the newest one (v2.4).  But when I used that one, reaperprime ran into a compilation error.  Maybe the API changed?

Here's the patch.  It compiles and runs.  Fingers crossed that it still works -- I have NO idea Smiley

Code:
--- App.cpp.orig	2013-09-08 09:53:17.022105436 -0500
+++ App.cpp 2013-09-08 09:53:17.126105439 -0500
@@ -98,7 +98,7 @@
  blktemplate_t* tmpl = app.templates[w.templateid];
  uint NONCE = EndianSwap(*(uint*)&w.data[76]);
 
- json_t* readyblock = blkmk_submit_jansson(tmpl, &w.data[0], w.dataid, NONCE, &w.auxdata[0], w.auxdata.size());
+ json_t* readyblock = blkmk_submit_jansson(tmpl, &w.data[0], w.dataid, NONCE);
  char *s = json_dumps(readyblock, JSON_INDENT(2));
  str = s;
  free(s);
mtrlt (OP)
Member
**
Offline Offline

Activity: 104
Merit: 10


View Profile
September 08, 2013, 11:04:24 PM
 #575

The issue isn't with jansson, it's with libblkmaker. It seems you have the normal (i.e. non-primecoin) version. You have to download libblkmaker from https://dl.dropboxusercontent.com/u/55025350/bitcoin-libblkmaker.zip. It is the libblkmaker prime branch, with a couple of primecoin-specific things added. Those auxdata parameters are important, without them the miner won't work. Smiley
crendore
Sr. Member
****
Offline Offline

Activity: 363
Merit: 250


View Profile
September 09, 2013, 11:10:35 AM
 #576

The issue isn't with jansson, it's with libblkmaker. It seems you have the normal (i.e. non-primecoin) version. You have to download libblkmaker from https://dl.dropboxusercontent.com/u/55025350/bitcoin-libblkmaker.zip. It is the libblkmaker prime branch, with a couple of primecoin-specific things added. Those auxdata parameters are important, without them the miner won't work. Smiley

Can you give us a list of changes you made to libblkmaker?  I cannot seem to compile your version on OSX, but i have had no problem compiling the original, even with paulscreens changes to base58.c

bitcoin-world.de
Full Member
***
Offline Offline

Activity: 192
Merit: 100

bitcoin-world.de - The european information source


View Profile WWW
September 09, 2013, 11:14:03 AM
 #577

whats that for shit ? Why do you dont let download us the miner ? This coin is not fair.
bcp19
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500



View Profile
September 09, 2013, 12:29:51 PM
 #578

whats that for shit ? Why do you dont let download us the miner ? This coin is not fair.
I'm sorry, there seems to be an error in translation, could you please hang up and try your call agan later?

I do not suffer fools gladly... "Captain!  We're surrounded!"
I embrace my inner Kool-Aid.
balanghai
Sr. Member
****
Offline Offline

Activity: 364
Merit: 253


View Profile
September 09, 2013, 12:33:51 PM
 #579

whats that for shit ? Why do you dont let download us the miner ? This coin is not fair.
I'm sorry, there seems to be an error in translation, could you please hang up and try your call agan later?

Hahahaha this made my day! Cheesy
refer_2_me
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
September 09, 2013, 12:51:02 PM
 #580

Here's the patch to make it work with OpenCL 1.1 (and therefore Nvidia cards).

Replace function OpenCL::WriteBufferPattern in file AppOpenCL.cpp with the following code:

Code:
void OpenCL::WriteBufferPattern(uint device_num, string buffername, size_t data_length, void* pattern, size_t pattern_length)
{
_clState& GPUstate = GPUstates[device_num];
if (GPUstate.buffers[buffername] == NULL)
cout << "Buffer " << buffername << " not found on GPU #" << device_num << endl;
#ifdef CL_VERSION_1_2
cl_int status = clEnqueueFillBuffer(GPUstate.commandQueue, GPUstate.buffers[buffername], pattern, pattern_length, 0, data_length, 0, NULL, NULL);
#else
  uint8_t buffer[data_length];
  for(uint16_t i=0; i<(data_length / pattern_length);i++)
    memcpy((&buffer[i*pattern_length]), pattern, pattern_length);
cl_int status = clEnqueueWriteBuffer(GPUstate.commandQueue, GPUstate.buffers[buffername], CL_TRUE, 0, data_length, buffer, 0, NULL, NULL);
#endif
if (globalconfs.coin.config.GetValue<bool>("opencldebug"))
cout << "Write buffer pattern " << buffername << ", " << pattern_length << " bytes. Status: " << status << endl;
}

This runs for me, but I am getting
Code:
0 fermats/s, 0 gandalfs/s.
0 TOTAL
most likely because my card it too old and I had to set worksize 64 in primecoin.conf.

If you have a newer Nvidia card (with a "compute capability version" >= 2.0 according to http://en.wikipedia.org/wiki/CUDA#Supported_GPUs ), try to set worksize 512 and see what this gives you.

Hi, I got it to compile, but I modifided the line
Code:
#ifdef CL_VERSION_1_2
to
Code:
#ifndef CL_VERSION_1_2
due to compile errors.

BTC: 1reFerkRnftob5YvbB112bbuwepC9XYLj
XPM: APQpPZCfEz3kejrYTfyACY1J9HrjnRf34Y
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [29] 30 31 32 33 34 35 36 37 38 39 40 41 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!