Hey there. First of all
BIG THANKS to Jean_Luc for that tool which I downloaded and compiled on Linux. I am running Ubuntu 22.04 (Jammy Jellyfish) and have the GPU NVIDIA GeForce RTX 3070 in use with all drivers up-to-date. I can access it without issues with various applications. However I cannot make use of it with the VanitySearch tool.
NVIDIA-SMI 510.85.02 Driver Version: 510.85.02 CUDA Version: 11.6
I tried to build with
but I have no folder /usr/local/cuda* on my disk so the compilation fails. I could only compile it without GPU support. Do I need to install additional CUDA stuff on my machine, do I need CUDA SDK ? I've done some research and the answer obviously is YES, I do.
I installed Nvidia Toolkit as shown
HERE and it went well. Now there are folders /usr/local/cuda* on my disk. I retried running the build command of VanitySearch with GPU support, but it fails:
make clean && make gpu=1 CCAP=2.0 all
[...]
g++ -DWITHGPU -m64 -mssse3 -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 -mssse3 -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 /usr/bin/g++-4.8 -m64 -O2 -I/usr/local/cuda-8.0/include -gencode=arch=compute_20,code=sm_20 -o obj/GPU/GPUEngine.o -c GPU/GPUEngine.cu
make: /usr/local/cuda-8.0/bin/nvcc: file or directory not found
make: *** [Makefile:65: obj/GPU/GPUEngine.o] error 127
I do not have a /usr/local/cuda-8.0 folder on my system, but there is a /usr/local/cuda
-11.7 folder which contains the
nvcc file. So i had to modify the line 34 inside Makefile of VanitySearch and put the corresponding version which is installed on my system:
CUDA = /usr/local/cuda-11.7
then I retried the build process which again failed:
make clean && make gpu=1 CCAP=2.0 all
[...]
g++ -DWITHGPU -m64 -mssse3 -Wno-write-strings -O2 -I. -I/usr/local/cuda-11.7/include -o obj/hash/sha256_sse.o -c hash/sha256_sse.cpp
/usr/local/cuda-11.7/bin/nvcc -maxrregcount=0 --ptxas-options=-v --compile --compiler-options -fPIC -ccbin /usr/bin/g++-4.8 -m64 -O2 -I/usr/local/cuda-11.7/include -gencode=arch=compute_20,code=sm_20 -o obj/GPU/GPUEngine.o -c GPU/GPUEngine.cu
nvcc fatal : Unsupported gpu architecture 'compute_20'
make: *** [Makefile:65: obj/GPU/GPUEngine.o] error 1
Seems it doesn't understand the required compute capability 2.0. Uhmm?? Let's dig further ...
$ /usr/local/cuda-11.7/bin/nvcc --list-gpu-code
sm_35
sm_37
sm_50
sm_52
sm_53
sm_60
sm_61
sm_62
sm_70
sm_72
sm_75
sm_80
sm_86
sm_87
$ /usr/local/cuda-11.7/bin/nvcc --list-gpu-arch
compute_35
compute_37
compute_50
compute_52
compute_53
compute_60
compute_61
compute_62
compute_70
compute_72
compute_75
compute_80
compute_86
compute_87
I understand that this has something to do with compute capability but honestly said I have no clue what exactly these numbers represent. (EDIT:
SOLVED! see bottom of this post!) I guess and hope the higher the value the better
So I tried editing VanitySearch'
Makefile once more and manually assign the value
87 to the particular variable (
note: this is wrong, I had to use 86, check the solution on the bottom of my post)
#ccap = $(shell echo $(CCAP) | tr -d '.')
ccap = 87
[/quote]
It failed again with error stating not founding g++-4.8 on my system. Indeed, I don't have this executable but instead I have
/usr/bin/g++-11 and
g++, latter is just a symlink to it. Now modifying again the Makefile ...
#CXXCUDA = /usr/bin/g++-4.8
CXXCUDA = /usr/bin/g++-11
make clean && make gpu=1 CCAP=2.0 all
and the build finished without errors. BTW: At this step I realized that I can ommit the CCAP=2.0 in the command line *lol*
because I already hard-fixed it in Makefile. So far
SO GOOD but ...
I cannot run VanitySearch with GPU support, see here:
export LD_LIBRARY_PATH=/usr/local/cuda-11.7/lib64
./VanitySearch -t 7 -gpu -gpuId 0,1 1TryMe
VanitySearch v1.19
Difficulty: 15318045009
Search: 1TryMe [Compressed]
Start Wed Aug 24 21:14:27 2022
Base Key: 4DFFFFFFFFFF.........
Number of CPU thread: 7
GPUEngine: invalid device ordinal
GPU:
Speicherzugriffsfehler (Speicherabzug geschrieben) # this is german and means something like "memory access violation (memory dumped)"
when I omit the -gpuId 0,1 parameter as shown in developers example I get this error
./VanitySearch -t 7 -gpu 1TryMe
VanitySearch v1.19
Difficulty: 15318045009
Search: 1TryMe [Compressed]
Start Wed Aug 24 21:14:49 2022
Base Key: F9blablabla.....
Number of CPU thread: 7
GPU: GPU #0 NVIDIA GeForce RTX 3070 Laptop GPU (40x128 cores) Grid(320x128)
GPUEngine: Kernel: no kernel image is available for execution on the device
Simply said, I dont have two GPUs, only one. Being said I need to either use -gpuId 0 or ommit the switch so default setting (0) take effect.
EDIT: ==>
SOLVED !!! YEAH !!! I just had to continue reading on
Jean_Luc's GIT repository at the section "Docker". There is a
link to Wikipedia explaining CUDA computing capabilities and the various GPUs, alternatively check also
this link. In my case (Nvidia RTX 3070Ti) it is computing capability 8
.6 but I used 8.7 in my initial try. After replacing with 8.6 and rebuilding the tool it runs perfectly (... I thought
)
./VanitySearch -gpu bc1quantum
VanitySearch v1.19
Difficulty: 1073741824
Search: bc1quantum [Compressed]
Start Wed Aug 24 21:48:26 2022
Base Key: CF63B6CE85C8ABDF6957BC51F6FDF7021B79ED3D418A74CE778BFE6AF20C1325
Number of CPU thread: 1
GPU: GPU #0 NVIDIA GeForce RTX 3070 Laptop GPU (40x128 cores) Grid(320x128)
PubAddress: bc1quantum5kfktr2jf5x4rth3pyrkrya3ur0d36wl
Priv (WIF): p2wpkh:<notshownhere>
Priv (HEX): <notshownhere>
PubAddress: bc1quantumk06cchhxyvl6m5uav3xu43q8xar4ztk8
Priv (WIF): p2wpkh:<notshownhere>
Priv (HEX): <notshownhere>
PubAddress: bc1quantumjvvfen3ps35gezay5pd6psrzw4sfte0c
Priv (WIF): p2wpkh:<notshownhere>
Priv (HEX): <notshownhere>
PubAddress: bc1quantumvuxaz3tf84hk7l4ywxq863xhjk6vyx85
Priv (WIF): p2wpkh:<notshownhere>
Priv (HEX): <notshownhere>
^C
this took <5 seconds
I'm curious what rates other can achieve with their GPU. Anyone out there willing to share his GPU model and the achieved calc rate with VanitySearch, please? I get
1,680 MKey/s with my Nvidia 3070 Ti.
[1689.55 Mkey/s][GPU 1635.58 Mkey/s][Total 2^32.65][Prob 99.8%][99% in 00:00:00][Found 9]
Now the bad news are -->
All addresses with prefix 1 or 3 that were found are unknown/invalid on the blockexplorer. Only adresses with prefix bc1q that I found are valid
but their private keys are invalid, too. When I run VanitySearch with the -check switch it outputs
warnings, see here:
GetBase10() Results OK
Add() Results OK : 1.429 GigaAdd/sec
Mult() Results OK : 63.291 MegaMult/sec
Div() Results OK : 13.333 MegaDiv/sec
R1=1000003D1
R2=1000007A2000E90A1
Field characteristic size: 256bits
ModInv()/ModExp() Results OK
ModInv() Edge cases Results OK
.Avg = 6.13
ModInv() Results OK : 934.307 KiloInv/sec
ModInv() cycles : 2671.49
ModSqrt() Results OK !
IntGroup.ModInv() Results OK : 15.772 MegaInv/sec
ModMulK1() Results OK : 84.104 MegaMult/sec
ModSquareK1() Results OK : 94.724 MegaSqr/sec
ModInv() Cost : 202.8 S
ModMulK1order() Results OK : 8.494 MegaMult/sec
Check Generator :OK
Check Double :OK
Check Add :OK
Check GenKey :OK
Warning, Invalid private key checksum !
Adress : 15t3Nt1zyMETkHbjJTTshxLnqPzQvAtdCe Failed !
15t3Nt1zyMETkHbjJTTshxLnqPzQu1bXfv
Warning, Invalid private key checksum !
Adress : 1BoatSLRHtKNngkdXEeobR76b53LETtpyT Failed !
1BoatSLRHtKNngkdXEeobR76b53LKMWP3w
Warning, Invalid private key checksum !
Adress : 1Test6BNjSJC5qwYXsjwKVLvz7DpfLehy Failed !
1Test6BNjSJC5qwYXsjwKVLvz7DpjtjnQ
Warning, Invalid private key checksum !
Adress : 16S5PAsGZ8VFM1CRGGLqm37XHrp46f6CTn Failed !
16S5PAsGZ8VFM1CRGGLqm37XHrp47fqtNF
Warning, Invalid private key checksum !
Adress : 1Tst2RwMxZn9cYY5mQhCdJic3JJrK7Fq7 Failed !
1Tst2RwMxZn9cYY5mQhCdJic3JJmbS2Bg
Warning, Invalid private key checksum !
Adress : 3CyQYcByvcWK8BkYJabBS82yDLNWt6rWSx Failed !
3CyQYcByvcWK8BkYJabBS82yDLNWuH5qBa
Warning, Invalid private key checksum !
Adress : 31to1KQe67YjoDfYnwFJThsGeQcFhVDM5Q Failed !
31to1KQe67YjoDfYnwFJThsGeQcFkVZ6Es
Warning, Invalid private key checksum !
Adress : bc1q6tqytpg06uhmtnhn9s4f35gkt8yya5a24dptmn OK!
Check Calc PubKey (full) 1ViViGLEawN27xRzGrEhhYPQrZiSCLm3G :OK
Check Calc PubKey (even) 385cR5DM96n1HvBDMzLHPYcw89fZ9G2Vm5:OK
Check Calc PubKey (odd) 18aPiLmTow7Xgu96msrDYvSSWweCwm6WL3:OK
GPU: GPU #0 NVIDIA GeForce RTX 3070 Laptop GPU (40x128 cores) Grid(320x128)
Seed: 1661373526
1.638 GigaKey/sec
ComputeKeys() found 7590 items , CPU check...
^C
That confirms that only the calculated bc1q addresses are valid. Going one step further I tried to import one of the found bc1q addresses into a fresh new Electrum wallet. But the private key seems to be invalid, too. I cannot import it in Electrum. See following example of a valid bcq1 that was found by VanitySearch:
PubAddress: bc1qxxxxxxxxkdmn6srmenzwx9vemzckwl9nrtrffr
Priv (WIF): p2wpkh:KwTYmSw4***********************************************aWXAz3m
Priv (HEX): 0x71E5C****************************************************646DDF
[1767.69 Mkey/s][GPU 1745.63 Mkey/s][Total 2^41.56][Prob 94.8%][99% in 00:17:06]
In Electrum I click [File] --> New/Restore --> "Import Bitcoin addresses or private keys" --> and the description says:
Enter a list of Bitcoin addresses (this will create a watching-only wallet), or a list of private keys. WIF keys are typed in Electrum, based on script type.
A few examples:
p2pkh:KxZcY47uGp9a... -> 1DckmggQM...
p2wpkh-p2sh:KxZcY47uGp9a... -> 3NhNeZQXF...
p2wpkh:KxZcY47uGp9a... -> bc1q3fjfk...
I tried entering the Priv (WIF) that was output by VanitySearch
p2wpkh:KwTYmSw4***********************************************aWXAz3m
but I cannot click next. Even when I omit the p2wpkh: string and just entering the key solely. It doesn't work either, Electrum does not accept it. I tried some private keys which I can ensure they are valid and Electrum accepts them so I can be sure
Electrum has no bug As I experienced VanitySearch partially outputs invalid bitcoin addresses, now it seems that this is true also for the calculated private keys. I did further tests today just to realize that
all private keys VanitySearch is outputting are invalid.
Did anyone else experience this and can confirm? Is this a known bug or did I miss anything? Any help appreciated.
EDIT: Here some examples ...
$ sudo ./VanitySearch -stop -gpu 1TryMe
VanitySearch v1.19
Difficulty: 15318045009
Search: 1TryMe [Compressed]
Start Fri Aug 26 02:07:35 2022
Base Key: EA39E4FEA1F9A57B3D1153C51436F3DC5F346FDA89AB90B2E0BEBC4B3B616D76
Number of CPU thread: 1
GPU: GPU #0 NVIDIA GeForce RTX 3070 Laptop GPU (40x128 cores) Grid(320x128)
[1956.69 Mkey/s][GPU 1949.94 Mkey/s][Total 2^32.87][Prob 40.0%][50% in 00:00:01][Found 0]
PubAddress: 1TryMeBmkZbYQRh24QZUSCjZfMuzgbqd6 <---- this BTC adress is invalid
Priv (WIF): p2pkh:KzVPRaUaiDiRniEr6YSKUHazHvo8CAvffFdRawzQQYg7pP84fycW <---- this Priv/WIF key is invalid
Priv (HEX): 0x6193A9465DDEA2E9E0BFBB43960A5288817B7AC5BE9ACA09BFC46DEDC8E9FF14 <--- is correct
VanitySearch' resulting "Priv (HEX)" is correct, but the Priv (WIF) is invalid. When I convert on my own from Priv (HEX) --to--> Address I get this result
1TryMeBmkZbYQRh24QZUSCjZfMuz
JsK32 # manually calculated
1TryMeBmkZbYQRh24QZUSCjZfMuz
gbqd6 # calculated and shown in VanitySearch
$ sudo ./VanitySearch -stop -gpu 3TryMe
VanitySearch v1.19
Ignoring prefix "3TryMe" (Unreachable, 31h1 to 3R2c only)
VanitySearch: nothing to search !
$ sudo ./VanitySearch -stop -gpu bc1qtryme
VanitySearch v1.19
Difficulty: 33554432
Search: bc1qtryme [Compressed]
Start Fri Aug 26 02:12:53 2022
Base Key: 905139A9CDCF33BC677ED4F0BA7CB07254BFF2B7C2D0E8BD34D6EFB7FD1B610
Number of CPU thread: 1
GPU: GPU #0 NVIDIA GeForce RTX 3070 Laptop GPU (40x128 cores) Grid(320x128)
PubAddress: bc1qtryme20s0rqssxdk36qkfu7lcquhy6mqf584k4 <---- this BTC adress is valid
Priv (WIF): p2wpkh:L5VopZHRZ3AhXfRt7uCZwkeJ3zYNXJY87snY33KGmjGaSWHKTDco <---- this Priv/WIF key is invalid
Priv (HEX): 0xF6FAEC6563230CC4398812B0F45834F794E2DDBB21D191AFEC84EF9150648957 <--- is correct
One more example with legacy address ...
$ sudo ./VanitySearch -stop -t 4 -gpu 1citbo
VanitySearch v1.19
Difficulty: 15318045009
Search: 1citbo [Compressed]
Start Fri Aug 26 02:33:37 2022
Base Key: 2E1FCD8E1F65964ACDC032650D63817355259952D4CBD2C8CD2A5C577B49E882
Number of CPU thread: 4
GPU: GPU #0 NVIDIA GeForce RTX 3070 Laptop GPU (40x128 cores) Grid(320x128)
[1661.79 Mkey/s][GPU 1635.34 Mkey/s][Total 2^33.63][Prob 58.0%][60% in 00:00:00][Found 0]
PubAddress: 1citboYAWtgbJCySZe8C7U7y36cxGfZUZ
Priv (WIF): p2pkh:L5NB8KdCFkL7q8ZTAKAuHHeJhsP41XoJijqtuiZrXJffMEfzwaZy
Priv (HEX): 0xF30DBBB1FFF76EBF9741202CCE4676B6258ACCAF648C040844D9796F239AD998 <--- is correct
VanitySearch calculated and shown Priv (WIF):
L5NB8KdCFkL7q8ZTAKAuHHeJhsP41XoJijqtuiZrXJffME
fzwaZyBut the correct corresponding compressed Priv (WIF) for the above Priv (HEX) should be correctly:
L5NB8KdCFkL7q8ZTAKAuHHeJhsP41XoJijqtuiZrXJffME
hSXy1uThat results in VanitySearch showing the wrong address:
1citboYAWtgbJCySZe8C7U7y36c
xGfZUZWhereas correctly should be:
1citboYAWtgbJCySZe8C7U7y36c
stvVjRWhat's wrong here? Any clues?Anyway. I hope this post can help other like-minded Linux users to get VanitySearch run on latest GNU/Linux version with CUDA support. If you have failed like I did, you can try this little tutorial shown here which in my case is related to Ubuntu 22.04 Jammy Jellyfish with Nvidia CUDA running. I wish you success and keep my fingers crossed. Thanks and good luck!!!
citb0in