Pages:
Author

Topic: Ufasoft Miner - Windows/Linux, x86/x64, SSE2/OpenCL, Open Source - page 37. (Read 630787 times)

legendary
Activity: 1316
Merit: 1005
Other than having to install the required libraries and JWasm, I had no problems building v0.10 on a 32-bit Ubuntu 10.10 system. Running it on my 64-bit systems was a non-issue with ia32 libraries installed, but building on a 64-bit system took some tweaking.

Comparing the 32-bit Ufasoft bitcoin-miner to the jgarzik minerd using sse2_64, I'm seeing about 10% improvement. On the 32-bit system which did best using the cryptopp algorithm, switching to Ufasoft's miner produced about 30% greater Mh/s. Granted, this is still CPU mining, but the delta is interesting.

Obviously, you'd need the Linux source for the miner.

For a 32-bit Ubuntu 10.04 or later system (gcc 4.4 is default in 10.xx, 4.5 in 11.04), the required 32-bit C++ build libraries are:

Code:
sudo apt-get install libcurl4-gnutls-dev libpcre++0 libpcre++-dev gcc-4.5-base g++-4.5

If preferred in the above command, you can use either the OpenSSL (libcurl4-openssl-dev) or Mozilla NSS (libcurl4-nss-dev) version of libcurl instead of GnuTLS.

For JWasm, I simply extracted the binary to the build directory, made it executable and added the current working directory to the path:

Code:
chmod +x jwasm
PATH=$PATH:./; export PATH

If it isn't the default and you get a compiler version error, to avoid having to change the entire environment from gcc 4.4 to 4.5, rocksalt's method of specifying the compilers in the command with the CC= and CXX= definitions works best:

Code:
sudo CC=gcc-4.5 CXX=g++-4.5 ./configure && sudo make && sudo make install


With 64-bit systems, instead of creating a chroot environment to build 32-bit binaries, you can just add the necessary dev files and make a few tweaks. First, make sure the 32-bit sources are installed:

Code:
sudo apt-get install ia32-libs libc6-dev-i386 g++-multilib

This isn't pretty, but it works - in configure, search for JASMFLAGS and add "JASMFLAGS=-elf" immediately after the section shown to make it appear as so:

Code:
if test x$build_cpu = xx86_64 ; then
JASMFLAGS="-DX64=1 -10 -elf64"
else
JASMFLAGS=-elf
fi

JASMFLAGS=-elf

Make sure the compiler is going to generate a 32-bit binary and run configure:

Code:
CFLAGS=-m32 CXXFLAGS=-m32; export CFLAGS CXXFLAGS
./configure

The real sticking point is the curl header file curlbuild.h - it has a fixed defined value that will prevent a 32-bit compile. We can fix that for now by editing it.

WARNING! This isn't going to hose your system, but it might cause issues with further compiling efforts if you don't undo it after building the 32-bit miner.

Code:
sudo sed -i 's/SIZEOF_LONG 8/SIZEOF_LONG 4/g' /usr/include/curl/curlbuild.h
sudo sed -i 's/SIZEOF_CURL_OFF_T 8/SIZEOF_CURL_OFF_T 4/g' /usr/include/curl/curlbuild.h

In order to reverse this action, simply do the following:

Code:
sudo sed -i 's/SIZEOF_LONG 4/SIZEOF_LONG 8/g' /usr/include/curl/curlbuild.h
sudo sed -i 's/SIZEOF_CURL_OFF_T 4/SIZEOF_CURL_OFF_T 8/g' /usr/include/curl/curlbuild.h

If curlbuild.h isn't there, you either don't have libcurl installed or it's somewhere else. Just search for the file and replace the relevant lines.

Now you can compile successfully.

Code:
make && sudo make install


Out of curiosity, I'd like to find out whether there'd be a statistically significant increase with a native 64-bit implementation. Too bad I haven't touched assembly in years...
newbie
Activity: 22
Merit: 0
@ufasoft, are u planing update to support nvidia gpu's?
Eri
sr. member
Activity: 264
Merit: 250
Don't know if you are actively improving this or not, but would be awesome if you could make it so it auto reconnects, shouldn't be too hard i don't think. Depending, as of yet I'm not sure if it disconnects when the screen saver comes on or the PC goes idle, but if it is ... would be great for a fix Shocked

Love the App, please keep developing it! this is the Only CPU miner that works for me.
member
Activity: 80
Merit: 10
Tried for quite a while to run this on Ubuntu 11.04 64-bit.

I eventually got it to compile by editing the asm files and removing the IF statements mentioned on pages 10 and 11 of this thread. However, it seg faults after compiling. I think this is due to needing 32-bit libraries, I found the guide earlier in this thread by mathx, but I couldn't quite get it working. Ah well, since CPU mining is pretty much pointless I'm gonna give up and stick to gpu mining Smiley

EDIT/UPDATE:

Gave up on 64-bit.. if you're gonna run it with 32-bit libraries then I don't think you'll get a speed increase anyway!

I finally got it running on my 10.04 32 bit system. Basically I downloaded a 32-bit 11.04 liveCD, booted it up. Installed the required libraries and downloaded the source code, this compiled fine. Then I just copied the binary over to my other system - all works fine.

I think this is probably the most simple way of doing it if you are desperate to stick to Ubuntu 10.04 and/or avoid installing gcc-4.5 Smiley

Anyway, I'm now getting ~13-14 MH/s from my Q9550.. not exactly huge, but I'm not paying the power bill Smiley
newbie
Activity: 51
Merit: 0
I'm running bitcoin-miner on Ubuntu without problems, on 3 machines.
I just followed the steps above.
You can PM me for step by step help if you like rather than cluttering up here with back-and-forth.
Sometimes the error msgs make sense to a programmer and I happen to be one...

great Smiley i'll set up a fresh install tonight and run through the steps above and pm you the error msg's... they'd make sense to you more than me as im a windows weenie lol
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
I'm running bitcoin-miner on Ubuntu without problems, on 3 machines.
I just followed the steps above.
You can PM me for step by step help if you like rather than cluttering up here with back-and-forth.
Sometimes the error msgs make sense to a programmer and I happen to be one...
newbie
Activity: 51
Merit: 0
ok, i've tried opensuse 11, now ubuntu natty, i've played with amazon aws and i'm struggling

im a windows noob cos no matter what i try, i just can't get the little bloody penguin to play ball.

if its not compiling, its making, if its not making its due to some sub package not being installed.

sigh.. i lost count of how many virtual instances of linux i've run up to install bitcoin and then a miner of one description or another.
i can get bitcoin to work but not miner, i can sometimes get the miner compiled and installed but it dosn't run.

is there someone kind person out there who has a step 1 through 10 list of what to do on a specific vanilla distro?

each time i run up ubuntu for example, i fully update everything using adpt
newbie
Activity: 51
Merit: 0
tested on a dual quad intel and im getting about 18Mhash/s Smiley

rock on !

I get 16 Mhash/sec on a single quad core.  So what are you doing wrong?

i probably didn't set affinity correctly... although now im playing a bit with ubuntu and doing similar tests
newbie
Activity: 16
Merit: 0
The following patch will improve SSE2 performance slightly by eliminating one instruction. I recently submitted the same patch for cpuminer.

Code:
diff --git a/sha256sse.asm b/sha256sse.asm
index 33d5a85..981cd96 100644
--- a/sha256sse.asm
+++ b/sha256sse.asm
@@ -210,12 +210,11 @@ ENDIF
        movdqa  xmm3, xmm4                      ; d = c
        movdqa  xmm2, xmm4                      ; c
        pand    xmm2, xmm5                      ; b & c
-       pand    xmm4, xmm7                      ; a & c
-       pand    xmm1, xmm7                      ; a & b
-       pxor    xmm1, xmm4
+       pxor    xmm1, xmm4                      ; b ^ c
+       pand    xmm1, xmm7                      ; a & (b ^ c)
+       pxor    xmm1, xmm2                      ; (a & (b ^ c)) ^ (b & c)
        movdqa  xmm4, xmm5                      ; c = b
        movdqa  xmm5, xmm7                      ; b = a
-       pxor    xmm1, xmm2                      ; (a & c) ^ (a & d) ^ (c & d)
        paddd   xmm6, xmm1                      ; t1 + ((a & c) ^ (a & d) ^ (c & d))
               
        movdqa  xmm2, xmm7

I imagine something similar could be done for the x86 asm, though I haven't tried it yet.
hero member
Activity: 1134
Merit: 502
Vave.com - Crypto Casino
Install pcre-dev/libpcre-dev/whatever it's called! Tongue

how to do that?

sudo apt-get install libpcre3 libpcre3-dev  Roll Eyes
member
Activity: 80
Merit: 10
think you need to use the switch "-g no" to avoid using gpu.
sr. member
Activity: 378
Merit: 250
i just tested this on 1 core and i get 95-100 mhash but dont scale on all 4 core lol
O_O  What code are you using to get 95-100 mhash/sec on a single core?!  I want!  I want!
sr. member
Activity: 378
Merit: 250
tested on a dual quad intel and im getting about 18Mhash/s Smiley

rock on !

I get 16 Mhash/sec on a single quad core.  So what are you doing wrong?
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
For Linux see post a few up by rocksalt.
Only thing is I didn't need prefix GCC details. I just ran,

./configure
make
sudo make install

which worked fine once the right packages and jwasm were installed.

The "make" step does the compiling for you.
The "make install" moves files to correct locations and permissions ready for use.
newbie
Activity: 13
Merit: 0
How do I compile in Linux command line?
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Something like that would work.

It outputs to both stderr and stdout.

Hash rate gets sent to stderr. But the "Accepted" event gets sent to stdout. And then the actual proof code gets sent to stderr. So I'm thinking a small script that grabs both outputs and watches the time and every minute it logs the hash rate and any events also get logged. But most of the has rate values get pulled out. And which seems to be the only "code" also gets pulled out.

Anyway, I haven't done anything yet but maybe tomorrow I'll write something like this.

Nonetheless, I'm very impressed that it doubled my hash rates.
member
Activity: 80
Merit: 10
Not actually been able to run this miner but would the following work?

run_miner_command -arg1 -arg2 .. etc | grep "string for generated block/share" > out.log
hero member
Activity: 784
Merit: 1009
firstbits:1MinerQ
Fabulous. Thank You!
Ran this on 3 of my low end systems (T5450, Atom D510, T7450) and they all more than doubled due to using SSE2 (compared to minerd, which doesn't seem to use that).

T5450 2.6 MH/s
D510 2.3 MH/s
T7450 3.7 MH/s

Edit:

Actually after running this for a while I realized it would be really handy if it there was an option to tell the program to use simple text output as may be piped to a log file.

I want to start it and let it run as a daemon. I can pipe the output but it has screen commands in it that end up as gibberish in the log. Is it maybe possible to add an option that has simple output, and just outputs events and speed periodically or at each event maybe?

I suppose I could run output thru a filter to clean it up.
sr. member
Activity: 371
Merit: 250
Install pcre-dev/libpcre-dev/whatever it's called! Tongue
newbie
Activity: 51
Merit: 0
walidzohair thanks so much for your post! It works a charm!

I have re-simplified your instructions for anyone else trying to build Ufasoft's CPU Bitcoin Miner under Ubuntu 10.10 x86 (32bit):

############################################################
# Ufasoft CPU bitcoin miner supporting RPC for pooled mining
# x86 (32bit) Debian / Ubuntu install guide
# Tested under Ubunutu 10.10 32bit
# Reference: http://forum.bitcoin.org/index.php?topic=3486.msg114156#msg114156
############################################################

# Install package dependencies
sudo apt-get install gcc-4.5 g++-4.5 libpcre++-dev libcurl4-dev unzip unace

# Manually install JWasm dependency
wget http://www.japheth.de/Download/JWasm/JWasm205bl.zip
unzip JWasm205bl.zip && sudo cp JWASM /usr/bin/jwasm && sudo chmod +x /usr/bin/jwasm

# Download, build and install software (should install in /usr/local/bin)
wget http://ufasoft.com/files/open/ufasoft_bitcoin-miner-0.10.tar.lzma
tar -xavf ufasoft_bitcoin-miner-0.10.tar.lzma
cd ufasoft_bitcoin-miner-0.10/
sudo CC=gcc-4.5 CXX=g++-4.5 ./configure && sudo make && sudo make install

# Cleanup
If your a clean freak, delete all files downloaded and extracted above Smiley

# Usage
bitcoin-miner --help
# Deepbit online mining pool example
bitcoin-miner -a 5 -t 4 -o http://pit.deepbit.net:8332 -u [email protected] -p 'password'


so, this morning, could't sleep decided to play about with natty.... got right through to:

 sudo CC=gcc-4.5 CXX=g++-4.5 ./configure && sudo make && sudo make install

and this  and then this happend..


checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc-4.5
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.5 accepts -g... yes
checking for gcc-4.5 option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc-4.5... gcc3
checking whether we are using the GNU C++ compiler... yes
checking whether g++-4.5 accepts -g... yes
checking dependency style of g++-4.5... gcc3
checking for g++-4.5... /usr/bin/g++-4.5
checking build system type... x86_64-unknown-linux-gnu
checking for jwasm... jwasm
checking for pcre_compile in -lpcre... no
configure: error: "Library not found"

now prior to this i did have a small issue with  libcurl3-nss libcurl4-nss-dev libnspr4 libnspr4-dev libnss3 libnss3-dev installation, but i think i got past that one.

i don't suppose anyone who's up and awake might have hit this one before ?

Pages:
Jump to: