Author

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

legendary
Activity: 2702
Merit: 1468
Code:
bool hex2bin(unsigned char *p, const char *hexstr, size_t len)
...
return (len == 0 && *hexstr == 0) ? true : false;
}

Should the return value not be || rather than &&?

I think the code is correct.  It also checks input parameters.

If size of buffer (p) is too small for a given hex str,the caller would know that something is wrong.
If the hexStr is truncated to size less than buffer (p) length, the caller would know.

For example: if hexStr points to 32 hex numbers, but the size of buffer pointed by p is 64, the function would return false.
If you had || instead of &&, the function would return true and the caller would assume that there are 64 valid (0-255) bytes.

If you had a prototype:

bool hex2bin(unsigned char *buf, int bufSize, const char *hexstr, int * outlen)

it would allow callers to check the size of the converted binary buffer.



Thing is, the BFL uses hex2bin the other way round: the string is longer than p. The BFL returns a string of nonces, hex2bin is used to extract these nonces. There's no null terminator on each nonce, so hex2bin is returning an error, even though everything is fine.

Not sure which version of driver-bitforce.c you are looking at but 2.4.1 does not check return code from hex2bin().  Sure, terminating after first 4 hex numbers would be better for BFL and Icarus, but jobj_binary()/work_decode() also uses this and checks the return code.  
sr. member
Activity: 392
Merit: 250
Firstly, make sure you always run with --api-listen (at least)
Then on a rig that has disconnected and reconnected many times, post here the output of 'devdetails' and 'notify'
On windows, the easiest is probably a command prompt in the cgminer directory and type:
 java API devdetails
 java API notify
[/quote]
I have java 7 installed but the commands are not recognized. I put api listen on though.
legendary
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
can you write exactly what i need to type and i will do it for you it seem mine freeze up after a few hours but it doesn't freeze my comp just cg
Well it relates to cuz0882 since he says he is getting disconnects and 'notify' might say why
Anyway, make sure you also include --api-listen when running cgminer then:
(above reworded Smiley)
Start -> run -> cmd (or Start Menu -> accessories -> command prompt) ... or wherever it is now Tongue
then cd to wherever cgminer is
then the two commands (assuming you have java installed):
 java API devdetails
 java API notify
(before cgminer freezes)

Edit: of course if you are just overclocking you card too far, you simply just need to clock it down a bit more ...
hero member
Activity: 502
Merit: 500
can you write exactly what i need to type and i will do it for you it seem mine freeze up after a few hours but it doesn't freeze my comp just cg
legendary
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
Since I updated cgminer the program seems to freeze up a lot. My pool will report that the miner disconnects and reconnects every couple minutes. If I then restart cgminer, it stops responding and even task manager can't close it. It has happened on most of my rigs. Is anyone else having this problem?
Firstly, make sure you always run with --api-listen (at least)
Then on a rig that has disconnected and reconnected many times, post here the output of 'devdetails' and 'notify'
On windows, the easiest is probably a command prompt in the cgminer directory and type:
 java API devdetails
 java API notify
legendary
Activity: 2702
Merit: 1468
Code:
bool hex2bin(unsigned char *p, const char *hexstr, size_t len)
...
return (len == 0 && *hexstr == 0) ? true : false;
}

Should the return value not be || rather than &&?

I think the code is correct.  It also checks input parameters.

If size of buffer (p) is too small for a given hex str,the caller would know that something is wrong.
If the hexStr is truncated to size less than buffer (p) length, the caller would know.

For example: if hexStr points to 32 hex numbers, but the size of buffer pointed by p is 64, the function would return false.
If you had || instead of &&, the function would return true and the caller would assume that there are 64 valid (0-255) bytes.

If you had a prototype:

bool hex2bin(unsigned char *buf, int bufSize, const char *hexstr, int * outlen)

it would allow callers to check the size of the converted binary buffer.

sr. member
Activity: 392
Merit: 250
Since I updated cgminer the program seems to freeze up a lot. My pool will report that the miner disconnects and reconnects every couple minutes. If I then restart cgminer, it stops responding and even task manager can't close it. It has happened on most of my rigs. Is anyone else having this problem?
donator
Activity: 448
Merit: 250
I've been trying to run cgminer with remoting into my Raspberry Pi via ssh.
I tried no use nohup to avoid for cgminer to receive a SIGHUP when I leave ssh, but whenever the input is redirected no /dev/null (what nohup does), cgminer maxes out the CPU usage. Bad thing on the RPi.

How can I get around this?


Add to cgminer:
... --api-listen --api-allow W:127.0.0.1,192.168.0/24 ...
(of course you'll have to correct 192.168.0 to match your network)

Then to exit cgminer:
 echo -n quit | nc 127.0.0.1 4028 ; echo
OR, if you don't have nc (or ncat) then you can use:
 java API quit
if you have API.class in the current directory

i.e. see if a clean exit resolves it

Also, killing screen after 1 second is often before cgminer completes exiting
(since it has to wait on a bunch of threads and then exit with the summary)
... just get the screen to exit when cgminer exits

Edit: OK that reply is a mix of comments to the previous posts ... but the point is yes use screen ... and also a clean exit

screen works well.

the api-listen I'll try soon too, seems quite convenient for remote control.
legendary
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
I've been trying to run cgminer with remoting into my Raspberry Pi via ssh.
I tried no use nohup to avoid for cgminer to receive a SIGHUP when I leave ssh, but whenever the input is redirected no /dev/null (what nohup does), cgminer maxes out the CPU usage. Bad thing on the RPi.

How can I get around this?


Add to cgminer:
... --api-listen --api-allow W:127.0.0.1,192.168.0/24 ...
(of course you'll have to correct 192.168.0 to match your network)

Then to exit cgminer:
 echo -n quit | nc 127.0.0.1 4028 ; echo
OR, if you don't have nc (or ncat) then you can use:
 java API quit
if you have API.class in the current directory

i.e. see if a clean exit resolves it

Also, killing screen after 1 second is often before cgminer completes exiting
(since it has to wait on a bunch of threads and then exit with the summary)
... just get the screen to exit when cgminer exits

Edit: OK that reply is a mix of comments to the previous posts ... but the point is yes use screen ... and also a clean exit
legendary
Activity: 1795
Merit: 1208
This is not OK.
There's an updated to that script I've not added yet:

For the kill commands, change them to the following:

Code:
Killall -s SIGINT cgminer
sleep 1
Killall screen
donator
Activity: 448
Merit: 250
Use screen instead?

Look at the scripts in my dd-wrt implementation in my sig. may help you.

Ah, the S99cgminer script I presume.  I'll try the screen command. 

Thanks!
legendary
Activity: 1795
Merit: 1208
This is not OK.
Use screen instead?

Look at the scripts in my dd-wrt implementation in my sig. may help you.
donator
Activity: 448
Merit: 250
I've been trying to run cgminer with remoting into my Raspberry Pi via ssh.
I tried no use nohup to avoid for cgminer to receive a SIGHUP when I leave ssh, but whenever the input is redirected no /dev/null (what nohup does), cgminer maxes out the CPU usage. Bad thing on the RPi.

How can I get around this?

legendary
Activity: 2702
Merit: 1468
I have my computer set to restart every day at a certain time, and CGMiner starts when windows starts. Ya lose 3 minutes of hashing a day, but no 7 day bug you're talking about. The temp/fanspeed/dynamic OC is what makes CGMiner great!

Wrong!  If cgminer crashes right after your reboot, you can lose a bit more than 3 minutes.
hero member
Activity: 518
Merit: 500
They will only clock back up if the temperature drops enough again.

How long will this take ? I left them about 15 minutes after the heat stopped and the cold begun and they did not clock back automatically ( I had to do it manually ).

Thanks !
legendary
Activity: 952
Merit: 1000
Question: If I upgrade one of my 58XX cards to a 79XX card, and consequently upgrade my SDK from 2.5 to 2.6, I can still use the phatk .bin from 2.5 on the 5870, correct?

2.6 will be installed, but I'd be using a phatk.bin from 2.5 on my 5870, and a diakgcn.bin from 2.6 on the 79XX for the best speed, correct?

Now how do I keep those .bins in use in future versions of CGMiner? (I do keep backups of my known good working bins in a separate folder)
legendary
Activity: 1795
Merit: 1208
This is not OK.
legendary
Activity: 2702
Merit: 1468
It doesn't happen on linux like this - only windows.
If it happened the same way on both linux and windows then it could be a possible cgminer code fix, but since it is windows specific (and not reproducible on linux) it is extremely likely to be in the ATI windows library
Also the fact that the GPU doesn't stop working (if you use --no-restart) but simply loses it's ADL information, again means it is in the ATI library that is the problem.

Why do you expect AMD code to work the same way on Linux and Windows?
If you unloaded the ADL dll before re-initializing opencl, and then reloaded it, you would not have "this ADL library bug".

Just because it happens to work on Linux does not mean it must work on Windows.
It is like saying: my cgminer works in my environment so it is not a bug.
donator
Activity: 448
Merit: 250

Does anybody have an idea what the issue might be?


to get it working in openwrt, i had to manually specify the location of the lib.

LIBCURL_CFLAGS=-L/path/to/lib LIBCURL_LIBS=-lcurl


Good catch, but after defining these variables myself ./configure works
Code:
LIBCURL_CFLAGS='-I/usr/include/curl'
LIBCURL_LIBS='-L/usr/lib -lcurl'
and having a closer look at the error, it appears to me that it doesn't like the syntax of PKG_CHECK_MODULES.
Commenting out these two lines unfortunately leads to an undefined variable ACEOF which causes more issues.
Did you have these issues too?


Scratch that, I had to run aclocal before ./autogen.sh


legendary
Activity: 1795
Merit: 1208
This is not OK.

Does anybody have an idea what the issue might be?


to get it working in openwrt, i had to manually specify the location of the lib.

LIBCURL_CFLAGS=-L/path/to/lib LIBCURL_LIBS=-lcurl
Jump to: