Bitcoin Forum
April 25, 2024, 05:20:27 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 [8] 9 10 11 12 »  All
  Print  
Author Topic: cgminer - CPU/GPU miner in C for linux/windows  (Read 81639 times)
figvam
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
July 04, 2011, 05:39:01 AM
 #141

Compilation fails on Fedora 14 32bit, can't find CPU_* macros for some reason:
Quote
gcc -DHAVE_CONFIG_H -I. -pthread -fno-strict-aliasing -I./compat/jansson    -O2 -Wall -msse2 -I/opt/ati-stream-sdk-v2.1-lnx32/include -g -MT minerd-cpu-miner.o -MD -MP -MF .deps/minerd-cpu-miner.Tpo -c -o minerd-cpu-miner.o `test -f 'cpu-miner.c' || echo './'`cpu-miner.c
In file included from cpu-miner.c:30:0:
miner.h:29:0: warning: "alloca" redefined
/usr/include/alloca.h:36:0: note: this is the location of the previous definition
cpu-miner.c: In function 'drop_policy':
cpu-miner.c:44:21: warning: unused variable 'param'
cpu-miner.c: In function 'affine_to_cpu':
cpu-miner.c:58:2: warning: implicit declaration of function 'CPU_ZERO'
cpu-miner.c:59:2: warning: implicit declaration of function 'CPU_SET'
cpu-miner.c:60:2: warning: implicit declaration of function 'sched_setaffinity'
1714065627
Hero Member
*
Offline Offline

Posts: 1714065627

View Profile Personal Message (Offline)

Ignore
1714065627
Reply with quote  #2

1714065627
Report to moderator
Unlike traditional banking where clients have only a few account numbers, with Bitcoin people can create an unlimited number of accounts (addresses). This can be used to easily track payments, and it improves anonymity.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714065627
Hero Member
*
Offline Offline

Posts: 1714065627

View Profile Personal Message (Offline)

Ignore
1714065627
Reply with quote  #2

1714065627
Report to moderator
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 04, 2011, 05:41:44 AM
 #142

Compilation fails on Fedora 14 32bit, can't find CPU_* macros for some reason:
Quote
gcc -DHAVE_CONFIG_H -I. -pthread -fno-strict-aliasing -I./compat/jansson    -O2 -Wall -msse2 -I/opt/ati-stream-sdk-v2.1-lnx32/include -g -MT minerd-cpu-miner.o -MD -MP -MF .deps/minerd-cpu-miner.Tpo -c -o minerd-cpu-miner.o `test -f 'cpu-miner.c' || echo './'`cpu-miner.c
In file included from cpu-miner.c:30:0:
miner.h:29:0: warning: "alloca" redefined
/usr/include/alloca.h:36:0: note: this is the location of the previous definition
cpu-miner.c: In function 'drop_policy':
cpu-miner.c:44:21: warning: unused variable 'param'
cpu-miner.c: In function 'affine_to_cpu':
cpu-miner.c:58:2: warning: implicit declaration of function 'CPU_ZERO'
cpu-miner.c:59:2: warning: implicit declaration of function 'CPU_SET'
cpu-miner.c:60:2: warning: implicit declaration of function 'sched_setaffinity'

That should be in /usr/include/sched.h which is in a virtually standard package for compiling anything: libc6-dev

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
figvam
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
July 04, 2011, 06:16:35 AM
 #143

Yes, sure, it's still there. But the problem isn't with the header file. This commit breaks the build:
Quote
commit 5c2eee548c8d6f2e0d90f6f1631cf7d5b49fc3d8
Author: Con Kolivas <kernel@kolivas.org>
Date:   Sat Jul 2 13:46:17 2011 +1000

    Fix redefinition of gnu source.

diff --git a/cpu-miner.c b/cpu-miner.c
index 6168713..72e0a6d 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -10,7 +10,6 @@
  */
 
 #include "config.h"
-#define _GNU_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>
And indeed, man CPU_ZERO says:
Quote
...
SYNOPSIS
       #define _GNU_SOURCE
       #include <sched.h>
...
I'm not sure how it works on your system though.
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 04, 2011, 06:20:02 AM
 #144

Gnu source is in config.h now
So it should be pulled in by everything
Make sure you have done ./autogen.sh and then ./configure

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
figvam
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
July 04, 2011, 07:29:12 AM
 #145

Yes, thanks, that was it.
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 04, 2011, 11:08:34 AM
 #146

I've decided to rename this application cgminer which means "cpu and gpu miner" or "ck and garzik miner" or "c gpu miner" or... just plain cgminer.

So I've moved the git tree to
https://github.com/ckolivas/cgminer

and have started renaming files and have cleaned up the git log, rebasing it, for it to build with the name cgminer version 1.0.9

So I'm trying to clean all this code up for a meaningful release now.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
Fletch
Full Member
***
Offline Offline

Activity: 168
Merit: 100


I'll have a steak sandwich and a... steak sandwich


View Profile
July 04, 2011, 11:17:13 AM
 #147

Forgive my ignorance, but as this miner supports both GPU and CPU, does it "intelligently" pick which processor to use or do you have to tell it to either use the GPU or the CPU (or both)?

HashPeak - GPU mining hashrate peak detector
BTC: 1FLETCHvcUKosefrcZCLUQTtvx4WvgnYMC
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 04, 2011, 11:20:05 AM
 #148

Forgive my ignorance, but as this miner supports both GPU and CPU, does it "intelligently" pick which processor to use or do you have to tell it to either use the GPU or the CPU (or both)?
If it does not detect any gpus it will cpu mine. If it detects any gpus it will only gpu mine unless you explicitly tell it to cpu mine as well. I'm working on modifying the code to build in the absence of opencl code and be a pure cpu miner still if need be.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
ulee
Newbie
*
Offline Offline

Activity: 15
Merit: 0


View Profile
July 04, 2011, 12:04:26 PM
 #149

I pulled from the new tree, and everything appears to be working now. Thanks.

Feature suggestion: Option to set a different worksize for each GPU.
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 05, 2011, 12:54:04 AM
 #150

Updated tree:

I believe we've tracked down the cause of the libcurl bug as being signal handling in the dns lookup code. So I've disabled signal handling and this has allowed me to add multiple curl handles thus making each get work and submit work completely asynchronous rather than each getwork waiting on the previous one and so on. It is theoretically possible it could spend forever waiting for a dns resolve but I doubt this can happen in reality as the lookup code would have to timeout at some stage. I've also addressed a bug where it was possible after a longpoll that a gpu could be left idle without any work. New windows builds coming soon.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
figvam
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
July 05, 2011, 04:25:32 AM
 #151

Is it possible to make it compile without AMD APP SDK? To run it as a pure CPU miner on a machine without any GPU.
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 05, 2011, 04:26:53 AM
 #152

Is it possible to make it compile without AMD APP SDK? To run it as a pure CPU miner on a machine without any GPU.
I'm working on that still.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 05, 2011, 06:16:10 AM
 #153

New windows binary:
http://ck.kolivas.org/apps/cgminer-ycros-2011-07-05.zip

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 05, 2011, 06:51:30 AM
 #154

Updated tree:

Fixed parameter parsing. Now short parameters should work, and it wont crash with invalid parameters.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 05, 2011, 07:37:15 AM
 #155

Is it possible to make it compile without AMD APP SDK? To run it as a pure CPU miner on a machine without any GPU.
Updated tree:

It should build now without opencl as a cpuminer only. The help message should say what it is compiled for after it's built.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
July 05, 2011, 08:33:56 AM
 #156

Hey, have you added in the SSE2_x64_atom update yet?

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
figvam
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
July 05, 2011, 08:42:13 AM
 #157

Still not possible to build without OpenCL:

In file included from main.c:30:
miner.h:15:19: error: CL/cl.h: No such file or directory
In file included from main.c:30:
miner.h:215: error: expected specifier-qualifier-list before ‘cl_uint’
main.c: In function ‘miner_thread’:
main.c:869: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:880: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:890: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:903: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:913: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:920: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:941: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:943: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:949: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:952: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:963: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:967: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:974: error: ‘dev_blk_ctx’ has no member named ‘nonce’
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 05, 2011, 09:11:57 AM
 #158

Still not possible to build without OpenCL:

In file included from main.c:30:
miner.h:15:19: error: CL/cl.h: No such file or directory
In file included from main.c:30:
miner.h:215: error: expected specifier-qualifier-list before ‘cl_uint’
main.c: In function ‘miner_thread’:
main.c:869: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:880: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:890: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:903: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:913: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:920: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:941: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:943: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:949: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:952: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:963: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:967: error: ‘dev_blk_ctx’ has no member named ‘nonce’
main.c:974: error: ‘dev_blk_ctx’ has no member named ‘nonce’


Did you do ./autogen.sh followed by configure first? If so, what was the output please?

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
July 05, 2011, 09:13:10 AM
 #159

Hey, have you added in the SSE2_x64_atom update yet?
No. Is it stable/working ok? Link?

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
figvam
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
July 05, 2011, 09:32:55 AM
 #160

The thing is that #include <CL/cl.h> line isn't wrapped in the #ifdef HAVE_OPENCL block, so the file is always included regardless of the OpenCL presence. There are more OpenCL-related bits in miner.h and mine.c which are always compiled.

Did you do ./autogen.sh followed by configure first? If so, what was the output please?
autogen doesn't output anything.
I had to remove the libcurl macro from configure and added the curl flags manually to the generated Makefile since RHEL5 doesn't have libcurl pkgconfig bits.
configure output:
Quote
$ CFLAGS="-O3 -Wall -msse2" ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether gcc needs -traditional... no
checking whether gcc and cc understand -c and -o together... yes
checking for ranlib... (cached) ranlib
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for mprotect... yes
checking for mmap... yes
checking for MAP_ANONYMOUS... yes
checking whether memchr works... yes
checking whether memmem is declared... yes
checking for memmem... yes
checking whether memmem works... yes
checking for wchar_t... yes
checking whether the preprocessor supports include_next... yes
checking whether system header files limit the line length... no
checking for unsigned long long int... yes
checking for long long int... yes
checking whether stdint.h conforms to C99... yes
checking for C/C++ restrict keyword... __restrict
checking whether memmem is declared without a macro... yes
checking whether mempcpy is declared without a macro... yes
checking whether memrchr is declared without a macro... yes
checking whether rawmemchr is declared without a macro... yes
checking whether stpcpy is declared without a macro... yes
checking whether stpncpy is declared without a macro... yes
checking whether strchrnul is declared without a macro... yes
checking whether strdup is declared without a macro... yes
checking whether strncat is declared without a macro... yes
checking whether strndup is declared without a macro... yes
checking whether strnlen is declared without a macro... yes
checking whether strpbrk is declared without a macro... yes
checking whether strsep is declared without a macro... yes
checking whether strcasestr is declared without a macro... yes
checking whether strtok_r is declared without a macro... yes
checking whether strerror_r is declared without a macro... yes
checking whether strsignal is declared without a macro... yes
checking whether strverscmp is declared without a macro... yes
checking whether memmem works in linear time... no
checking for memmem... (cached) yes
checking whether memmem works... (cached) yes
checking whether NULL can be used in arbitrary expressions... yes
checking for ANSI C header files... (cached) yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for OpenCL... no
checking for json_loads in -ljansson... no
checking for pthread_create in -lpthread... yes
checking for yasm... /usr/bin/yasm
checking if yasm version is greater than 1.0.1... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating compat/Makefile
config.status: creating compat/jansson/Makefile
config.status: creating x86_64/Makefile
config.status: creating lib/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

OpenCL: NOT FOUND. GPU mining support DISABLED.

Pages: « 1 2 3 4 5 6 7 [8] 9 10 11 12 »  All
  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!