JeanLucPons / VanitySearch

Bitcoin Address Prefix Finder
GNU General Public License v3.0
426 stars 207 forks source link

ubuntu error compile #11

Closed broka77 closed 5 years ago

broka77 commented 5 years ago

hello

I can not compile on ubuntu source code gives an error gcc can lay out a binary for ubuntu? that binar that the branch below does not work for me ... and another question in what format should the prefixes in the file be? with "1" or no unit?

SatoshiNakamotoBitcoins commented 5 years ago

Nice spoken Jean-Luc!

broka77 commented 5 years ago

I still can not create a binary for ubuntu, gives an error version of gcc> 7 can not fix .. can you fix it in the code for the latest build?

JeanLucPons commented 5 years ago

Try with gcc 4.8 (as on my config):

sudo apt install g++-4.8

Then create link for nvcc:

sudo ln -s /usr/bin/gcc-4.8 /usr/local/cuda/bin/gcc
sudo ln -s /usr/bin/g++-4.8 /usr/local/cuda/bin/g++

Check links for nvcc:

pons@linpons:~/VanitySearch$ ll /usr/local/cuda/bin/gcc 
lrwxrwxrwx 1 root root 16 mars   1 10:53 /usr/local/cuda/bin/gcc -> /usr/bin/gcc-4.8*
pons@linpons:~/VanitySearch$ ll /usr/local/cuda/bin/g++
lrwxrwxrwx 1 root root 16 mars   1 10:54 /usr/local/cuda/bin/g++ -> /usr/bin/g++-4.8*

Check that link to default gcc are correct (must be gcc 7)

pons@linpons:~/VanitySearch$ ll /usr/local/bin/g++
lrwxrwxrwx 1 root root 14 mars   1 10:33 /usr/local/bin/g++ -> /usr/bin/g++-7*
pons@linpons:~/VanitySearch$ ll /usr/local/bin/gcc
lrwxrwxrwx 1 root root 14 mars   1 10:32 /usr/local/bin/gcc -> /usr/bin/gcc-7*

Then try to make

broka77 commented 5 years ago

No, error ((make gpu=1 all /usr/local/cuda-10.0/bin/nvcc -maxrregcount=0 --ptxas-options=-v --compile --compiler-options -fPIC -ccbin g++ -m64 -O2 -I/usr/local/cuda-10.0/include -gencode=arch=compute_52,code=sm_52 -o obj/GPU/GPUEngine.o -c GPU/GPUEngine.cu g++: error: unrecognized command line option ‘-std=c++14’

broka77 commented 5 years ago

gcc 8.2.0 change in the source code itself please for the latest versions for Linux / Ubuntu. Everyone will thank you)

JeanLucPons commented 5 years ago

Ok I will try with gcc 8. I will see if I can install CUDASDK10 without breaking my config. My linux hardware works only with cuda sdk8.

broka77 commented 5 years ago

did you manage to fix it? I look forward to fixing on the creation of a binary file in ubunt on the last gcc and cuda ... but for now it gives an error when creating a build

broka77 commented 5 years ago

please add to your code (ready option code -r randome mode) https://github.com/pikachunakapika/VanitySearch

hamnaz commented 5 years ago

still error ( ubuntu 16.4 cuda sdk 8.0, gtx 460 ) gcc downgrade from 5.4 to 4.8

chawla@i3-6100:~$ sudo ln -s /usr/bin/gcc-4.8 /usr/local/cuda/bin/gcc [sudo] password for chawla: chawla@i3-6100:~$ sudo ln -s /usr/bin/g++-4.8 /usr/local/cuda/bin/g++ chawla@i3-6100:~$ ll /usr/local/cuda/bin/gcc lrwxrwxrwx 1 root root 16 Mar 17 15:59 /usr/local/cuda/bin/gcc -> /usr/bin/gcc-4.8 chawla@i3-6100:~$ ll /usr/local/cuda/bin/g++ lrwxrwxrwx 1 root root 16 Mar 17 16:00 /usr/local/cuda/bin/g++ -> /usr/bin/g++-4.8


make gpu=1 all cd obj && mkdir -p GPU g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/Base58.o -c Base58.cpp Base58.cpp: In function ‘bool DecodeBase58(const char, std::vector&)’: Base58.cpp:45:19: error: ‘nullptr’ was not declared in this scope if (ch == nullptr) ^ Base58.cpp: In function ‘std::string EncodeBase58(const unsigned char, const unsigned char*)’: Base58.cpp:90:5: error: ‘uint32_t’ was not declared in this scope uint32_t carry = pbegin[i]; ^ Base58.cpp:90:14: error: expected ‘;’ before ‘carry’ uint32_t carry = pbegin[i]; ^ Base58.cpp:92:7: error: ‘carry’ was not declared in this scope carry += (uint32_t)(digits[j]) << 8; ^ Base58.cpp:96:11: error: ‘carry’ was not declared in this scope while(carry > 0) { ^ Makefile:56: recipe for target 'obj/Base58.o' failed make: *** [obj/Base58.o] Error 1

JeanLucPons commented 5 years ago

Look like the gcc used for compiling in not gcc 7. gcc 4.8 is needed for he CUDA code. gcc 7 (or higher) is needed for the CPU code.

pons@linpons:~/VanitySearch$ g++ -v
...
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04) 
pons@linpons:~/VanitySearch$ make gpu=1 all
broka77 commented 5 years ago

the error remained, it is impossible to compile on ubuntu as I just did not try ...

JeanLucPons commented 5 years ago

I made Linux binary available here for CUDA 10 SDK. http://zelda38.free.fr/VanitySearch/ These files need to be tested, this is an experimental binary distribution.

broka77 commented 5 years ago

Yes work! very very thanks! Please add random mode ready for use code there https://github.com/pikachunakapika/VanitySearch

from there I cannot compile either (

broka77 commented 5 years ago

compute cap 61 work build

JeanLucPons commented 5 years ago

Ok Please execute VanitySearch -check to see it really works. Thanks.

broka77 commented 5 years ago

Yes Work from my hardware VanitySearch61 only

JeanLucPons commented 5 years ago

Ok Thanks I will have a look at the pikachunakapika fork.

broka77 commented 5 years ago

thank you, we look forward

broka77 commented 5 years ago

it would be nice to add - both mode (compressed and uncompressed address) together

JeanLucPons commented 5 years ago

Ok I add the -b option in the next release. If possible, it seems that the kernel code in near a limit and adding more code can make it unstable.

JeanLucPons commented 5 years ago

I had a quick look at the pikachunakapika fork, there is a bug, the starting key must start at the middle of the group otherwise, if a collision if found, the program will report a wrong private key (The group increment will be wrong). I can add this in the next release. Some question: How do you specifie the keysapce ABC:DEF ? Something like 0x1B340000000000000000:0x1B350000000000000000 ? Where ABC and DEF are 2 (256bits max) hexadecimal numbers ?

broka77 commented 5 years ago

JeanLucPons, you did not think to create a BitCrack fork, only better, faster, and with your own additives? What would be the random mode, bloom filter, both option (compressed and uncompressed address bitcoin) to search for collisions of bitcoin addresses? I think many need it / would like to try

broka77 commented 5 years ago

anyway, thanks you for your work =)

JeanLucPons commented 5 years ago

I added the both mode. I may add the keyspace space option as the pikachunakapika fork VanitySearch use a 2 level lookup table, I'm not sure that in that case a bloom filter will be better. That's true that VanitySearch is optimized for less than 1 million targets, for more, some improvement can be done. And for searching full collision, Pollard rho with few improvements will be much better. VanitySearch is a first prefix finder...

pikachunakapika commented 5 years ago

Hi my VanitySearch fork was not meant to public yet. Sorry for the bug :). Great work Jean-Luc! Exactly, keyspace in hex 256bit:256bit.

JeanLucPons commented 5 years ago

Hi my VanitySearch fork was not meant to public yet. Sorry for the bug :). Great work Jean-Luc! Exactly, keyspace in hex 256bit:256bit.

Thanks ;) Ok, i see that you also use your own random generator. VanitySearch has also an embedded RNG. It is a Mersenne twister with a period of 219937 -1. (MT 19937)

You can use it it like this.

Int k;
k.Rand(256);  // Fill k with a 256 bit random number (uniformly distributed).
k.Rand(128);  // Fill k with a 128 bit random number (uniformly distributed).
pikachunakapika commented 5 years ago

Thanks. Switched to embedded version! I used the mt19937 from c++ STL before.

JeanLucPons commented 5 years ago

Hi,

New release is out. Linux binaries available here: http://zelda38.free.fr/VanitySearch/ Thanks to test it and reporting issues but also performance you get on your hardware.

For you, improvement for large prefix list: An example with a 10 million address list. Use -m option if you get the "lost prefix" warning. If you have powerfull GPUs, use -t 0 to avoid CPU bottleneck.

C:\C++\VanitySearch\x64\Release>VanitySearch.exe -t 0 -gpu -m 131072 -i addr_10M.txt
[Loading input file 100.0%]
[Building lookup16 100.0%]
[Building lookup32 100.0%]
Search: 10000000 addresses (Lookup size 65536,[103,203]) [Compressed]
Start Wed Mar 20 09:13:29 2019
Base Key:328DBECB874367E08F6DB73CBE5A60C5688817CE93B5CF2A3582F02FE72B86E9
Number of CPU thread: 0
GPU: GPU #0 GeForce GTX 645 (3x192 cores) Grid(24x128)
17.694 MK/s (GPU 17.694 MK/s) (2^28.17) [P 0.00%][50.00% in 1.81548e+33y][0]
broka77 commented 5 years ago

Thank you very much for the binaries builds for Linux! Another would add random mode was super

JeanLucPons commented 5 years ago

Thank you very much for the binaries builds for Linux! Another would add random mode was super

Would be great if pikachunakapika do a pull request ;)

pikachunakapika commented 5 years ago

Will pull request soon when all tested :)

hamnaz commented 5 years ago

add an other option exclude -e excludefile.txt

where exclude file contain 000000 111111 222222

etc

geenrate base key and random keys or increment all skip exclude file then rest keys goes for process

hamnaz commented 5 years ago

make gpu=1 all mkdir -p obj cd obj && mkdir -p GPU cd obj && mkdir -p hash g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/Base58.o -c Base58.cpp Base58.cpp:37:48: error: ‘uint8_t’ was not declared in this scope bool DecodeBase58(const char psz, std::vector &vch) ^ Base58.cpp:37:55: error: template argument 1 is invalid bool DecodeBase58(const char psz, std::vector &vch) ^ Base58.cpp:37:55: error: template argument 2 is invalid Base58.cpp: In function ‘bool DecodeBase58(const char, int&)’: Base58.cpp:40:5: error: ‘uint8_t’ was not declared in this scope uint8_t digits[256]; ^ Base58.cpp:40:13: error: expected ‘;’ before ‘digits’ uint8_t digits[256]; ^ Base58.cpp:53:5: error: ‘digits’ was not declared in this scope digits[0]=0; ^ Base58.cpp:64:7: error: ‘uint32_t’ was not declared in this scope uint32_t carry = (uint32_t)c; ^ Base58.cpp:64:16: error: expected ‘;’ before ‘carry’ uint32_t carry = (uint32_t)c; ^ Base58.cpp:66:9: error: ‘carry’ was not declared in this scope carry += (uint32_t)(digits[j]) 58; ^ Base58.cpp:70:13: error: ‘carry’ was not declared in this scope while(carry > 0) { ^ Base58.cpp:77:9: error: request for member ‘clear’ in ‘vch’, which is of non-class type ‘int’ vch.clear(); ^ Base58.cpp:78:9: error: request for member ‘reserve’ in ‘vch’, which is of non-class type ‘int’ vch.reserve(zeroes+digitslen); ^ Base58.cpp:81:11: error: request for member ‘push_back’ in ‘vch’, which is of non-class type ‘int’ vch.push_back(0); ^ Base58.cpp:85:11: error: request for member ‘push_back’ in ‘vch’, which is of non-class type ‘int’ vch.push_back(digits[digitslen - 1 - i]); ^ Base58.cpp: In function ‘std::string EncodeBase58(const unsigned char, const unsigned char)’: Base58.cpp:105:5: error: ‘uint32_t’ was not declared in this scope uint32_t carry = pbegin[i]; ^ Base58.cpp:105:14: error: expected ‘;’ before ‘carry’ uint32_t carry = pbegin[i]; ^ Base58.cpp:107:7: error: ‘carry’ was not declared in this scope carry += (uint32_t)(digits[j]) << 8; ^ Base58.cpp:111:11: error: ‘carry’ was not declared in this scope while(carry > 0) { ^ Makefile:67: recipe for target 'obj/Base58.o' failed make: *** [obj/Base58.o] Error 1

JeanLucPons commented 5 years ago

I patched Base58 Could you retry ?

broka77 commented 5 years ago

I still can't create the binary build, it gives an error:it@it-System-Product-Name:~/VanitySearch$ make gpu=1 all mkdir -p obj cd obj && mkdir -p GPU cd obj && mkdir -p hash g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/Base58.o -c Base58.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/IntGroup.o -c IntGroup.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/main.o -c main.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/Random.o -c Random.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/Timer.o -c Timer.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/Int.o -c Int.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/IntMod.o -c IntMod.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/Point.o -c Point.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/SECP256K1.o -c SECP256K1.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/Vanity.o -c Vanity.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/GPU/GPUGenerate.o -c GPU/GPUGenerate.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/hash/ripemd160.o -c hash/ripemd160.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/hash/sha256.o -c hash/sha256.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/hash/sha512.o -c hash/sha512.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/hash/ripemd160_sse.o -c hash/ripemd160_sse.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-10.0/include -o obj/hash/sha256_sse.o -c hash/sha256_sse.cpp /usr/local/cuda-10.0/bin/nvcc -maxrregcount=0 --ptxas-options=-v --compile --compiler-options -fPIC -ccbin g++ -m64 -O2 -I/usr/local/cuda-10.0/include -gencode=arch=compute_61,code=sm_61 -o obj/GPU/GPUEngine.o -c GPU/GPUEngine.cu g++: error: unrecognized command line option ‘-std=c++14’ make: *** [Makefile:62: obj/GPU/GPUEngine.o] Error 1

broka77 commented 5 years ago

gcc 8.2.0

JeanLucPons commented 5 years ago

Yes CUDA 10 support only up to gcc 7. So intall gcc 7 for CUDA as you did with gcc 4.8 And create links in /usr/local/cuda/bin to gcc 7.

broka77 commented 5 years ago

Can you write in detail how to do this?

JeanLucPons commented 5 years ago
sudo apt-get install gcc-7

This should install gcc-7.3

Then remove link to the 4.8:

sudo rm /usr/local/cuda/bin/gcc 
sudo rm /usr/local/cuda/bin/g++

Then link to gcc 7.3

sudo ln -s /usr/bin/gcc-7.3 /usr/local/cuda/bin/gcc
sudo ln -s /usr/bin/g++-7.3 /usr/local/cuda/bin/g++
broka77 commented 5 years ago

did everything as a manual, the same error pops up

broka77 commented 5 years ago

Ubuntu 18.04

hamnaz commented 5 years ago

ubuntu 18.0.4 cuda 8.0

new error i think, you coded for only cuda 10.0

chawla@i3-6100:~/van4/VanitySearch$ sudo ln -s /usr/bin/gcc-7.3 /usr/local/cuda/bin/gcc chawla@i3-6100:~/van4/VanitySearch$ sudo ln -s /usr/bin/g++-7.3 /usr/local/cuda/bin/g++ chawla@i3-6100:~/van4/VanitySearch$ make gpu=1 all g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/Base58.o -c Base58.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/IntGroup.o -c IntGroup.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/main.o -c main.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/Random.o -c Random.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/Timer.o -c Timer.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/Int.o -c Int.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/IntMod.o -c IntMod.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/Point.o -c Point.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/SECP256K1.o -c SECP256K1.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/Vanity.o -c Vanity.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/GPU/GPUGenerate.o -c GPU/GPUGenerate.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/hash/ripemd160.o -c hash/ripemd160.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/hash/sha256.o -c hash/sha256.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/hash/sha512.o -c hash/sha512.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/hash/ripemd160_sse.o -c hash/ripemd160_sse.cpp g++ -DWITHGPU -m64 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/hash/sha256_sse.o -c hash/sha256_sse.cpp /usr/local/cuda-8.0/bin/nvcc -maxrregcount=0 --ptxas-options=-v --compile --compiler-options -fPIC -ccbin g++ -m64 -O2 -I/usr/local/cuda-8.0/include -gencode=arch=compute_20,code=sm_21 -o obj/GPU/GPUEngine.o -c GPU/GPUEngine.cu nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). **In file included from /usr/local/cuda-8.0/include/cuda_runtime.h:78, from : /usr/local/cuda-8.0/include/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 5 are not supported!

error -- unsupported GNU version! gcc versions later than 5 are not supported!**

^~~~~ Makefile:62: recipe for target 'obj/GPU/GPUEngine.o' failed make: *** [obj/GPU/GPUEngine.o] Error 1

JeanLucPons commented 5 years ago

CUDA8 does not support GCC later than 5, you have to install gcc-4.8 (for instance) for nvcc, and compile VanitySearch with a gcc later than 7.

CUDA10 does not support GCC later than 7, compilation can work with gcc 7 for both VanitySearch and the CUDA code, if you have gcc 8, you have to install gcc 7 for the CUDA code.

CUDA 10 use some feature of stc++ 14, so it is no longer possible to compile the CUDA code with gcc-4.8 if using CUDA 10.

Yes I know this is complex, and on Windows it is impossible to play like this with compiler....

Ubuntu 18.04

I have also Ubuntu 18.04 but with gcc 7.3.0 and all work fine without DIY. I also step up cuda 10 on a Debian9 with gcc 6 and all worked fine (except a bug related to code optimisation which is fixed).

broka77 commented 5 years ago

I do not know what else to do, what would VanitySearch earn on Ubuntu 18.04 cuda 10 I tried different methods - nothing helps =((

JeanLucPons commented 5 years ago

In my manual i forget:

sudo apt-get install g++-7

I updated the makefile. Now you have to set up the gcc you want to use in the makefile, no need to link. Set up also the SDK

CUDA       = /home/pons/cuda-10.0
CXXCUDA    = /usr/bin/g++-7

Then you run the make like this (ccap is the compute capability):

make gpu=1 ccap=61 all

I try this on my Ubuntu with g++ 8.2.0 (as default) and g++ 7.3.0. Works fine.

JeanLucPons commented 5 years ago

And for old hardware: (Still need a g++>=7 (as default) for VanitySearch itself)

 sudo apt-get install gcc-4.8
 sudo apt-get install g++-4.8
 CUDA       = /usr/local/cuda-8.0
 CXXCUDA    = /usr/bin/g++-4.8
 make gpu=1 ccap=20 all
broka77 commented 5 years ago

Thanks! Work done! ))) finally! I am happy ) add more randomness option It would be great

JeanLucPons commented 5 years ago

Great. Could you try to execute VanitySearch -check and post the result. I will help me. Thanks.

JeanLucPons commented 5 years ago

For radomness I'm waiting for the pull request of pikachunakapika ;)

broka77 commented 5 years ago

for unknown reasons, he removed the fork and closed