Author

Topic: OFFICIAL CGMINER mining software thread for linux/win/osx/mips/arm/r-pi 4.11.0 - page 827. (Read 5806004 times)

full member
Activity: 373
Merit: 100
Thanks! The backtrace helps to know why it segfaults (fixed in git now), but not why it's failing to create a command queue. I've tried backing out the compiler unloading patch as well in case that's the reason (changes are in git).

Great, thanks.  I can't get ./autogen.sh to work (never have been able to get it to work on OS X) I think because OS X has the wrong version of autoconf (autoconf (GNU Autoconf) 2.61).

Hopefully ancow can test it, else I'll have to wait for the next source package that has ./configure already generated.
I'll test it in a while, now I need to get something to eat first.
If you want to do it yourself, the only changes were to main.c and ocl.c, AFAICT, so simply copy those to the 1.4.0 directory and compile there (that's how I'm doing it).
newbie
Activity: 59
Merit: 0
ck, I am still trying to track down the annoying window resize segfault. I compiled the git version like this:
Quote
CFLAGS="-O0 -g -Wall -march=native" ./configure --prefix=/opt/cgminer

and started like this
Quote
gdb /opt/cgminer/bin/cgminer
then I did "set args" and "run" and it does NOT segfault. If I run it like this from the command line it segfaults upon resize. Is there any other way to collect the information that would help you to fix the issue?
hero member
Activity: 737
Merit: 500
Thanks! The backtrace helps to know why it segfaults (fixed in git now), but not why it's failing to create a command queue. I've tried backing out the compiler unloading patch as well in case that's the reason (changes are in git).

Great, thanks.  I can't get ./autogen.sh to work (never have been able to get it to work on OS X) I think because OS X has the wrong version of autoconf (autoconf (GNU Autoconf) 2.61).

Hopefully ancow can test it, else I'll have to wait for the next source package that has ./configure already generated.
sr. member
Activity: 360
Merit: 250
Some weirdness:

- If multiple, identical GPUs are present in the system, the same OpenCL kernel will be compiled for each of them.
No it does not. It compiles one kernel once for all similar hardware and then loads the binary from that point on. Since you have to run cgminer from the source directory currently, that's where it also stores the binary file.

So, I think I tracked down what led me to ask these questions.

My miner systems run without local disk and obtain everything over via PXE/TFTP/NFS. The directory where mining binaries (including cgminer) is installed isn't writable to the miner node users. Therefore, the binary output file can't be opened and, if I'm reading the source and the debug output correctly, the kernel is getting compiled memory-to-memory multiple times. Building to a temp directory would be one way to solve this.

In the process of troubleshooting, I found that adding the -T option to suppress curses output fails in a strange way with the latest linux binary. This works fine without -T, it's just hard to see everything that's going on as stuff scrolls up the curses window (and out of my scrollback):

Code:
box0202@box0202:/home/syadasti/software/cgminer-1.4.0$ ./cgminer --userpass user:pass --url http://pit.deepbit.net:8332 --debug -T       
[2011-07-24 01:02:02] Testing pool http://pit.deepbit.net:8332                   
[2011-07-24 01:02:02] Successfully retrieved and deciphered work from pool 0 http://pit.deepbit.net:8332                   
[2011-07-24 01:02:02] Pool 0 http://pit.deepbit.net:8332 active                   
[2011-07-24 01:02:02] Init GPU thread 0                   
[2011-07-24 01:02:02] List of devices:                   
[2011-07-24 01:02:02] 0 Cypress                   
[2011-07-24 01:02:02] 1 Cypress                   
[2011-07-24 01:02:02] 2 Cypress                   
[2011-07-24 01:02:02] Selected 0: Cypress                   
[2011-07-24 01:02:02] Preferred vector width reported 4                   
[2011-07-24 01:02:02] Max work group size reported 256                   
[2011-07-24 01:02:02] Long-polling activated for http://pit.deepbit.net:8332/listenChannel                   
[2011-07-24 01:02:02] No binary found, generating from source                   
[2011-07-24 01:02:02] Patched source to suit 2 vectors                   
[2011-07-24 01:02:02] cl_amd_media_ops found, patched source with BITALIGN                   
[2011-07-24 01:02:02] cl_amd_media_ops found, patched source with BFI_INT                   
*** glibc detected *** ./cgminer: free(): invalid next size (fast): 0x000000000125b4e0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x72606)[0x7f6482a69606]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f6482a6e33c]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x2f2a4e)[0x7f647e11ca4e]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x2edd55)[0x7f647e117d55]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x2ede4d)[0x7f647e117e4d]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x109ef6)[0x7f647df33ef6]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x138779)[0x7f647df62779]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x10a44c)[0x7f647df3444c]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x15716a)[0x7f647df8116a]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(clBuildProgram+0x2aa)[0x7f647df1277a]
./cgminer[0x40dbd6]
./cgminer[0x40af56]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f6482a15ead]
./cgminer[0x4030a9]
======= Memory map: ========
00400000-00437000 r-xp 00000000 00:19 14778946                           /home/syadasti/software/cgminer-1.4.0/cgminer
00636000-00637000 r-xp 00036000 00:19 14778946                           /home/syadasti/software/cgminer-1.4.0/cgminer
00637000-00638000 rwxp 00037000 00:19 14778946                           /home/syadasti/software/cgminer-1.4.0/cgminer
00638000-00639000 rwxp 00000000 00:00 0
01237000-025ae000 rwxp 00000000 00:00 0                                  [heap]
7f6474000000-7f6474021000 rwxp 00000000 00:00 0
7f6474021000-7f6478000000 ---p 00000000 00:00 0
7f6478385000-7f6478592000 r-xp 00000000 00:1a 9551883                    /opt/ati-stream-sdk-v2.3-lnx64/lib/gpu/builtins-gpucommon.bc
7f6478592000-7f64785c8000 r-xp 00000000 00:1a 9551881                    /opt/ati-stream-sdk-v2.3-lnx64/lib/gpu/builtins-evergreen.bc
7f64785c8000-7f64785cd000 r-xp 00000000 00:11 8405097                    /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f64785cd000-7f64787cc000 ---p 00005000 00:11 8405097                    /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f64787cc000-7f64787cd000 r-xp 00004000 00:11 8405097                    /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f64787cd000-7f64787ce000 rwxp 00005000 00:11 8405097                    /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f64787ce000-7f64787e3000 r-xp 00000000 00:11 8405095                    /lib/x86_64-linux-gnu/libnsl-2.13.so
7f64787e3000-7f64789e2000 ---p 00015000 00:11 8405095                    /lib/x86_64-linux-gnu/libnsl-2.13.so
7f64789e2000-7f64789e3000 r-xp 00014000 00:11 8405095                    /lib/x86_64-linux-gnu/libnsl-2.13.so
7f64789e3000-7f64789e4000 rwxp 00015000 00:11 8405095                    /lib/x86_64-linux-gnu/libnsl-2.13.so
7f64789e4000-7f64789e6000 rwxp 00000000 00:00 0
7f64789e6000-7f64789f0000 r-xp 00000000 00:11 8405100                    /lib/x86_64-linux-gnu/libnss_nis-2.13.so
7f64789f0000-7f6478bef000 ---p 0000a000 00:11 8405100                    /lib/x86_64-linux-gnu/libnss_nis-2.13.so
7f6478bef000-7f6478bf0000 r-xp 00009000 00:11 8405100                    /lib/x86_64-linux-gnu/libnss_nis-2.13.so
7f6478bf0000-7f6478bf1000 rwxp 0000a000 00:11 8405100                    /lib/x86_64-linux-gnu/libnss_nis-2.13.so
7f6478bf1000-7f6478bfc000 r-xp 00000000 00:11 8405098                    /lib/x86_64-linux-gnu/libnss_files-2.13.so
7f6478bfc000-7f6478dfb000 ---p 0000b000 00:11 8405098                    /lib/x86_64-linux-gnu/libnss_files-2.13.so
7f6478dfb000-7f6478dfc000 r-xp 0000a000 00:11 8405098                    /lib/x86_64-linux-gnu/libnss_files-2.13.so
7f6478dfc000-7f6478dfd000 rwxp 0000b000 00:11 8405098                    /lib/x86_64-linux-gnu/libnss_files-2.13.so
7f6478dfd000-7f6478dfe000 ---p 00000000 00:00 0
7f6478dfe000-7f64795fe000 rwxp 00000000 00:00 0
7f64795fe000-7f64795ff000 ---p 00000000 00:00 0
7f64795ff000-7f6479dff000 rwxp 00000000 00:00 0
7f6479dff000-7f6479e00000 ---p 00000000 00:00 0
7f6479e00000-7f647a600000 rwxp 00000000 00:00 0
7f647a600000-7f647a602000 r-xp 00000000 00:14 8622573                    /usr/lib/libXinerama.so.1.0.0
7f647a602000-7f647a801000 ---p 00002000 00:14 8622573                    /usr/lib/libXinerama.so.1.0.0
7f647a801000-7f647a802000 rwxp 00001000 00:14 8622573                    /usr/lib/libXinerama.so.1.0.0
7f647a802000-7f647a835000 r-xp 00000000 00:14 14033094                   /usr/lib/libatiadlxx.so
7f647a835000-7f647a935000 ---p 00033000 00:14 14033094                   /usr/lib/libatiadlxx.so
7f647a935000-7f647a93c000 rwxp 00033000 00:14 14033094                   /usr/lib/libatiadlxx.so
7f647a94e000-7f647ad50000 rwxp 00000000 00:00 0
7f647ad50000-7f647ad51000 rwxs 22b79000 00:12 5350                       /dev/ati/card2
7f647ad51000-7f647adb1000 rwxs 22b78000 00:12 5350                       /dev/ati/card2
7f647adb1000-7f647adf1000 rwxs 00049000 00:12 5350                       /dev/ati/card2
7f647adf1000-7f647b4f1000 rwxs 00026000 00:12 5350                       /dev/ati/card2
7f647b4f1000-7f647b4f2000 rwxs 00025000 00:12 5350                       /dev/ati/card2
7f647b4f2000-7f647b512000 rwxs febe0000 00:12 5350                       /dev/ati/card2
7f647b512000-7f647b572000 rwxs 22b76000 00:12 5348                       /dev/ati/card1
7f647b572000-7f647bc72000 rwxs 00016000 00:12 5348                       /dev/ati/card1
7f647bc72000-7f647bcd2000 rwxs 22b74000 00:12 5337                       /dev/ati/card0
7f647bcd2000-7f647bd12000 rwxs 00035000 00:12 5337                       /dev/ati/card0
7f647bd12000-7f647c412000 rwxs 00006000 00:12 5337                       /dev/ati/card0
7f647c412000-7f647c492000 rwxp 00000000 00:00 0
7f647c492000-7f647cc3a000 r-xp 00000000 00:14 14033101                   /usr/lib/libaticaldd.so
7f647cc3a000-7f647cd39000 ---p 007a8000 00:14 14033101                   /usr/lib/libaticaldd.so
7f647cd39000-7f647cd89000 rwxp 007a7000 00:14 14033101                   /usr/lib/libaticaldd.so
7f647cd89000-7f647ce42000 rwxp 00000000 00:00 0
7f647ce42000-7f647ce47000 r-xp 00000000 00:14 8621866                    /usr/lib/libXdmcp.so.6.0.0
7f647ce47000-7f647d046000 ---p 00005000 00:14 8621866                    /usr/lib/libXdmcp.so.6.0.0
7f647d046000-7f647d047000 rwxp 00004000 00:14 8621866                    /usr/lib/libXdmcp.so.6.0.0
7f647d047000-7f647d049000 r-xp 00000000 00:14 8621864                    /usr/lib/libXau.so.6.0.0
7f647d049000-7f647d249000 ---p 00002000 00:14 8621864                    /usr/lib/libXau.so.6.0.0
7f647d249000-7f647d24a000 rwxp 00002000 00:14 8621864                    /usr/lib/libXau.so.6.0.0
7f647d24a000-7f647d25b000 r-xp 00000000 00:14 8622561                    /usr/lib/libXext.so.6.4.0Aborted
-ck
legendary
Activity: 4088
Merit: 1631
Ruu \o/
Latest git, on my 32bit Kubuntu 11.04 segfaults when executing "cgminer --help". GDB's backtrace returns:
Code:
#0  0x0024701a in strncpy () from /lib/i386-linux-gnu/libc.so.6
#1  0x08049e8d in show_algo (buf=0xbffff938 "\324\371\377\277t\332\022", algo=0x80714f8) at /usr/include/bits/string3.h:121
#2  0x0806c996 in opt_usage ()
#3  0x0806b509 in opt_usage_and_exit ()
#4  0x0806c5c5 in parse_one ()
#5  0x0806c1dc in opt_parse ()
#6  0x08050206 in main (argc=2, argv=0xbffffcb4) at main.c:3260
Thanks very much for the backtrace! Fixed in git.
-ck
legendary
Activity: 4088
Merit: 1631
Ruu \o/
I get a segfault, too (on OS X 10.6.8 ).
Here's the output + command line:
Code:
cgminer-1.4.0> gdb --args ./cgminer --url http://pit.deepbit.net:8332 -u XXX -p XXX --url http://swepool.net-u XXX -p XXX -T
[2011-07-23 17:35:59] Long-polling activated for http://pit.deepbit.net:8332/listenChannel                    
[2011-07-23 17:35:59] Creating Command Queue. (clCreateCommandQueue)                    
[2011-07-23 17:35:59] Failed to init GPU thread 0                    
[2011-07-23 17:35:59] Creating Command Queue. (clCreateCommandQueue)                    
[2011-07-23 17:35:59] Failed to init GPU thread 0                    
 GPU 0: [0.0 Mh/s] [Q:0  A:0  R:0  HW:0  E:0%  U:0.00/m]

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000038
text_print_status [inlined] () at main.c:738
738             printf(" %sPU %d: [%.1f Mh/s] [Q:%d  A:%d  R:%d  HW:%d  E:%.0f%%  U:%.2f/m]\n",
And the trace:
Code:
(gdb) backtrace
#0  text_print_status [inlined] () at main.c:738
#1  print_status [inlined] () at /Users/XXX/cgminer-1.4.0/main.c:804
#2  0x00000001000041ef in main (argc=1, argv=) at main.c:3516
Thanks! The backtrace helps to know why it segfaults (fixed in git now), but not why it's failing to create a command queue. I've tried backing out the compiler unloading patch as well in case that's the reason (changes are in git).
full member
Activity: 373
Merit: 100
Latest git, on my 32bit Kubuntu 11.04 segfaults when executing "cgminer --help". GDB's backtrace returns:
Code:
#0  0x0024701a in strncpy () from /lib/i386-linux-gnu/libc.so.6
#1  0x08049e8d in show_algo (buf=0xbffff938 "\324\371\377\277t\332\022", algo=0x80714f8) at /usr/include/bits/string3.h:121
#2  0x0806c996 in opt_usage ()
#3  0x0806b509 in opt_usage_and_exit ()
#4  0x0806c5c5 in parse_one ()
#5  0x0806c1dc in opt_parse ()
#6  0x08050206 in main (argc=2, argv=0xbffffcb4) at main.c:3260
newbie
Activity: 23
Merit: 0
As ckolivas already mentioned
Bah. I was sure I've read the whole thread.

Thanks.
full member
Activity: 373
Merit: 100
Hi,

has anybody gotten cgminer to run on the console (i.e., no running X)?

Tracing the cgminer process, it gets as far as opening /dev/ati/card0 and running a few ioctl calls (and incidentally _not_ opening /dev/ati/card1, despite the fact that I have two of them), but then clGetDeviceIDs() returns -1. Ouch.
As ckolivas already mentioned, you need X for the drivers to communicate with the graphics card. See http://forum.bitcoin.org/index.php?topic=28402.msg387438#msg387438 and answers.
newbie
Activity: 23
Merit: 0
Hi,

has anybody gotten cgminer to run on the console (i.e., no running X)?

Tracing the cgminer process, it gets as far as opening /dev/ati/card0 and running a few ioctl calls (and incidentally _not_ opening /dev/ati/card1, despite the fact that I have two of them), but then clGetDeviceIDs() returns -1. Ouch.
hero member
Activity: 737
Merit: 500
I was aware phatk was incompatible with quite a few things, which is why I kept the poclbm kernel in there. Some of the detection changes might select phatk now if they hadn't previously, so perhaps that's the issue. Try explicitly setting the kernel (new feature in 1.4.0) to poclbm with -k poclbm

That didn't make a difference.  Same error as before, so apparently not phatk kernel related.  Let me know what other information I can provide.

P.S.  My error is the same as what ancow is seeing, and it looks like he was able to provide a stacktrace of the segfault.
hero member
Activity: 737
Merit: 500

I was aware phatk was incompatible with quite a few things, which is why I kept the poclbm kernel in there. Some of the detection changes might select phatk now if they hadn't previously, so perhaps that's the issue. Try explicitly setting the kernel (new feature in 1.4.0) to poclbm with -k poclbm


I'll try that, later today.
full member
Activity: 373
Merit: 100
I get a segfault, too (on OS X 10.6.8 ).
Here's the output + command line:
Code:
cgminer-1.4.0> gdb --args ./cgminer --url http://pit.deepbit.net:8332 -u XXX -p XXX --url http://swepool.net-u XXX -p XXX -T
[2011-07-23 17:35:59] Long-polling activated for http://pit.deepbit.net:8332/listenChannel                    
[2011-07-23 17:35:59] Creating Command Queue. (clCreateCommandQueue)                    
[2011-07-23 17:35:59] Failed to init GPU thread 0                    
[2011-07-23 17:35:59] Creating Command Queue. (clCreateCommandQueue)                    
[2011-07-23 17:35:59] Failed to init GPU thread 0                    
 GPU 0: [0.0 Mh/s] [Q:0  A:0  R:0  HW:0  E:0%  U:0.00/m]

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000038
text_print_status [inlined] () at main.c:738
738             printf(" %sPU %d: [%.1f Mh/s] [Q:%d  A:%d  R:%d  HW:%d  E:%.0f%%  U:%.2f/m]\n",
And the trace:
Code:
(gdb) backtrace
#0  text_print_status [inlined] () at main.c:738
#1  print_status [inlined] () at /Users/XXX/cgminer-1.4.0/main.c:804
#2  0x00000001000041ef in main (argc=1, argv=) at main.c:3516
-ck
legendary
Activity: 4088
Merit: 1631
Ruu \o/
1.4.0 seg faults on OS X (Lion)

1.3.1 worked fine (with -v 1)

With 1.4.0, part of the screen draws before the segfault, so here is a screen grab in case the location that "Segmentation Fault 11" draws might be an indication of where the crash is happening (there are also some errors in the message log):

http://i.imgur.com/8EW8T.png

Note, if you are not aware, the phatk kernel in the latest poclbm and phoenix don't work with Apples Open CL implementation (and never have).  But your kernel did work until 1.4.0.  Not sure if your kernel changes in 1.4.0 triggered this problem or if it was changes in the C code that triggered the problem.  Let me know what you'd like me to do to help debug this, because cgminer is (was) one of the only miners working in OS X Lion.


I was aware phatk was incompatible with quite a few things, which is why I kept the poclbm kernel in there. Some of the detection changes might select phatk now if they hadn't previously, so perhaps that's the issue. Try explicitly setting the kernel (new feature in 1.4.0) to poclbm with -k poclbm
hero member
Activity: 737
Merit: 500
1.4.0 seg faults on OS X (Lion)

1.3.1 worked fine (with -v 1)

With 1.4.0, part of the screen draws before the segfault, so here is a screen grab in case the location that "Segmentation Fault 11" draws might be an indication of where the crash is happening (there are also some errors in the message log):

http://i.imgur.com/8EW8T.png

Note, if you are not aware, the phatk kernel in the latest poclbm and phoenix don't work with Apples Open CL implementation (and never have).  But your kernel did work until 1.4.0.  Not sure if your kernel changes in 1.4.0 triggered this problem or if it was changes in the C code that triggered the problem.  Let me know what you'd like me to do to help debug this, because cgminer is (was) one of the only miners working in OS X Lion.

-ck
legendary
Activity: 4088
Merit: 1631
Ruu \o/
Re. config format: JSON + arrays is absolutely awesome + you don't have to parse it, because you are using a library, why even think of changing?
Uh yeah, about that. I haven't got the foggiest how to talk [to] that library yet... There was so much I wanted to code for cgminer first that I knew I could do before looking at it (as you can probably see from the hundreds of hours of code I've put in already).
newbie
Activity: 17
Merit: 0
Specifically it searches for SSE4.1 and I don't know how that differs from sse4.2 and sse4a

looking at the asm code - it uses "movntdqa" which is a 4.1 instruction - that means intel (only) processors starting with core 2 and newer (core i3, i5, i7)
it also looks like its the only instruction in the code that requires sse4. that explains the marginal difference with sse2 code

perhaps someone more familiar with asm will find a way to use the higher sse sets much more effectively, but for now, the difference between sse2 and sse4(.1) implementation is not worth switching cpu's )

just for reference:

sse 4.2 is intel (only) core i3, i5, i7
sse 4a is amd only starting with barcelona arch
newbie
Activity: 59
Merit: 0
Could somebody who uses Arch Linux please update this pkgbuild for cgminer on AUR?

Try this:

Quote
pkgname=cgminer
pkgver=1.4.0
pkgrel=1
pkgdesc="Con Kolivas's fork of cpuminer. http://forum.bitcoin.org/index.php?topic=28402.0"
arch=('i686' 'x86_64')
url='https://github.com/ckolivas/cgminer'
license=('GPL')
depends=('curl')
makedepends=('yasm')
source=("http://ck.kolivas.org/apps/cgminer/cgminer-${pkgver}.tar.bz2")
md5sums=('725d9e499aa4bdbe307250180259d920')

build() {
cd cgminer-${pkgver}

./configure \
    --prefix=/usr

make CFLAGS="-O3 -march=native -mtune=native"
}

package() {
cd cgminer-${pkgver}
make DESTDIR=${pkgdir} install
install -Dm600 "example-cfg.json" "${pkgdir}/etc/cpuminer.json"
}

I've never actually seen Arch, but should work BTC =)

P.S. RPM for EL6
member
Activity: 145
Merit: 10
your a hardcore c programmer ;-P
You know, it's the same guy that is known for Linux kernel schedulers outside of this forum... No wonder.

Re. config format: JSON + arrays is absolutely awesome + you don't have to parse it, because you are using a library, why even think of changing?

I agree 100% on json, use it for all my php scripts. However you can dump the varibles into a binary database and load them, it can be easier if options are not formalized.

Yeah the CK kernel patch is legend.
legendary
Activity: 2618
Merit: 1007
Could somebody who uses Arch Linux please update this pkgbuild for cgminer on AUR?
https://aur.archlinux.org/packages.php?ID=50710
Jump to: