Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux #13

Open
Noname400 opened this issue Aug 19, 2021 · 8 comments
Open

Linux #13

Noname400 opened this issue Aug 19, 2021 · 8 comments
Labels
question Further information is requested

Comments

@Noname400
Copy link

Linux work?

@bernardladenthin
Copy link
Owner

Never tried. But Java and OpenCL should be compatible. A test would be great.

@bernardladenthin bernardladenthin added the question Further information is requested label Aug 19, 2021
@Noname400
Copy link
Author

no problem, i check

@Noname400
Copy link
Author

Not work. Big problem run

@bernardladenthin
Copy link
Owner

Do you got an exception? Can you run the unit test and build the project using maven ( https://github.com/bernardladenthin/BitcoinAddressFinder/blob/main/build.bat )?

@Noname400
Copy link
Author

Yes. No problem

@kazax-inc
Copy link

kazax-inc commented Dec 20, 2022

it run on linux (debian).

a few steps to make it work:

  • have java in version 11+
  • create a bash script instead of .bat
  • rebuild the .jar under linux (unit test passed)

the released jar from the repo run without error but does not generate any key (on linux but work on windows), after these few steps everything works

on the other hand the number of key/s generated is much lower than under windows

my windows pc: 16 GB of ram, old I7 and a GTX980Ti
my linux pc: 16 GB of ram, recent I7 and an RTX3060
LMDB are stored on SSD with same performance for both, the linux pc is realy more powerfull than the windows pc but:
on windows: ~800K key/s stable during long time
under linux: ~800K at start and decrease and stabilize rapidly to ~37K key/s

this is my .sh in case somethink was wrong:

#!/usr/bin/env bash
java --illegal-access=permit --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED -server -Xms512M -Xmx16G -Dlogback.configurationFile=logbackConfiguration.xml -jar bitcoinaddressfinder-1.1.0-SNAPSHOT-jar-with-dependencies.jar config_Find_1OpenCLDevice.js >> log_Find_1OpenCLDevice.txt  2>&1

@bernardladenthin
Copy link
Owner

Thanks a lot for the information and tests under linux. I've no setup for a Linux machine currently but I'll do this in future. For the performance decrease I need to check if the consumer (key lookup in database) or the producer (open cl key generation) getting slower. I'll try to create a test for performance benachmark which can be executed with junit to find the reason.

@kisamoto
Copy link

I created a rough Makefile for linux systems. Note, this assumes the following:

  • Run from the repo top directory
  • A slightly modified directory structure (see below) for the customized config files

Directory structure (additional directories to what is in the repo):

.
├── addresses
│   └── btcAddresses.csv
├── config
│   ├── config_AddressFilesToLMDB.json
│   ├── config_Find_1OpenCLDeviceAnd2CPUProducer.json
│   ├── config_Find_1OpenCLDevice.json
│   ├── config_Find_8CPUProducer.json
│   ├── config_OpenCLInfo.json
│   └── logbackConfiguration.xml
├── lmdb
│   ├── data.mdb
│   └── lock.mdb
├── log
│   └── gpu.log
├── Makefile

[...]
19 directories, 33 files

Makefile, customize the paths and config as necessary:

JAR_PATH := target/bitcoinaddressfinder-1.3.0-SNAPSHOT-jar-with-dependencies.jar
JAVA_CMD := java \
	--add-opens java.base/java.lang=ALL-UNNAMED \
	--add-opens java.base/java.io=ALL-UNNAMED \
	--add-opens java.base/java.nio=ALL-UNNAMED \
	--add-opens java.base/jdk.internal.ref=ALL-UNNAMED \
	--add-opens java.base/jdk.internal.misc=ALL-UNNAMED \
	--add-opens java.base/sun.nio.ch=ALL-UNNAMED \
	--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED \
	-Xms512M \
	-Xmx16G \
	-Dlogback.configurationFile=config/logbackConfiguration.xml \
	-jar $(JAR_PATH)

.PHONY: clean
clean:
	@mvn clean

.PHONY: test
test:
	@mvn test

.PHONY: build
build:
	@mvn compile assembly:single

.PHONY: package
package: clean build
	@mvn assembly:single

.PHONY: opencl-info
opencl-info:
	@$(JAVA_CMD) config/config_OpenCLInfo.json

.PHONY: start-gpu
start-gpu:
	@$(JAVA_CMD) config/config_Find_1OpenCLDevice.json >> log/gpu.log  2>&1

.PHONY: start-cpu
start-cpu:
	@$(JAVA_CMD) config/config_Find_8CPUProducer.json

.PHONY: load-addresses
load-addresses:
	@$(JAVA_CMD) config/config_AddressFilesToLMDB.json

.PHONY: start
start:
	@$(JAVA_CMD) config/config_Find_1OpenCLDeviceAnd2CPUProducer.json

Then you can run:

make clean
make build
make load-addresses
make start-gpu

Currently this gives me ~2700k keys/second using OpenCL on Linux.

Happy hacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants