Coder Social home page Coder Social logo

kaspa-miner's Introduction

Kaspa-miner

Build status Latest version License dependency status

Discord Telegram

Installation

From Sources

Installing via cargo install is not supported for the latest version.

The regular version is still available at

cargo install kaspa-miner

From Git Sources

If you are looking to build from the repository (for debug / extension), note that the plugins are additional packages in the workspace. To compile a specific package, you run the following command or any subset of it

git clone [email protected]:tmrlvi/kaspa-miner.git
cd kaspa-miner
cargo build --release -p kaspa-miner -p kaspacuda -p kaspaopencl

And, the miner (and plugins) will be in targets/release. You can replace the last line with

cargo build --release --all

From Binaries

The release page includes precompiled binaries for Linux, and Windows (for the GPU version).

Removing Plugins

To remove a plugin, you simply remove the corresponding dll/so for the directory of the miner.

  • libkaspacuda.so, libkaspacuda.dll: Cuda support for Kaspa-Miner
  • libkaspaopencl.so, libkaspaopencl.dll: OpenCL support for Kaspa-Miner

Usage

To start mining, you need to run kaspad and have an address to send the rewards to. Here is a guidance on how to run a full node and how to generate addresses: https://github.com/kaspanet/docs/blob/main/Getting%20Started/Full%20Node%20Installation.md

Help:

kaspa-miner 
A Kaspa high performance CPU miner

USAGE:
    kaspa-miner [OPTIONS] --mining-address <MINING_ADDRESS>

OPTIONS:
    -a, --mining-address <MINING_ADDRESS>                  The Kaspa address for the miner reward
        --cuda-device <CUDA_DEVICE>                        Which CUDA GPUs to use [default: all]
        --cuda-disable                                     Disable cuda workers
        --cuda-lock-core-clocks <CUDA_LOCK_CORE_CLOCKS>    Lock core clocks eg: ,1200, [default: 0]
        --cuda-lock-mem-clocks <CUDA_LOCK_MEM_CLOCKS>      Lock mem clocks eg: ,810, [default: 0]
        --cuda-no-blocking-sync                            Actively wait for result. Higher CPU usage, but less red blocks. Can have lower workload.
        --cuda-power-limits <CUDA_POWER_LIMITS>            Lock power limits eg: ,150, [default: 0]
        --cuda-workload <CUDA_WORKLOAD>                    Ratio of nonces to GPU possible parrallel run [default: 64]
        --cuda-workload-absolute                           The values given by workload are not ratio, but absolute number of nonces [default: false]
    -d, --debug                                            Enable debug logging level
        --devfund-percent <DEVFUND_PERCENT>                The percentage of blocks to send to the devfund (minimum 2%) [default: 2]
        --experimental-amd                                 Uses SMID instructions in AMD. Miner will crash if instruction is not supported
    -h, --help                                             Print help information
        --mine-when-not-synced                             Mine even when kaspad says it is not synced
        --nonce-gen <NONCE_GEN>                            The random method used to generate nonces. Options: (i) xoshiro (ii) lean [default: lean]
        --opencl-amd-disable                               Disables AMD mining (does not override opencl-enable)
        --opencl-device <OPENCL_DEVICE>                    Which OpenCL GPUs to use on a specific platform
        --opencl-enable                                    Enable opencl, and take all devices of the chosen platform
        --opencl-no-amd-binary                             Disable fetching of precompiled AMD kernel (if exists)
        --opencl-platform <OPENCL_PLATFORM>                Which OpenCL platform to use (limited to one per executable)
        --opencl-workload <OPENCL_WORKLOAD>                Ratio of nonces to GPU possible parrallel run in OpenCL [default: 512]
        --opencl-workload-absolute                         The values given by workload are not ratio, but absolute number of nonces in OpenCL [default: false]
    -p, --port <PORT>                                      Kaspad port [default: Mainnet = 16110, Testnet = 16211]
    -s, --kaspad-address <KASPAD_ADDRESS>                  The IP of the kaspad instance [default: 127.0.0.1]
    -t, --threads <NUM_THREADS>                            Amount of CPU miner threads to launch [default: 0]
        --testnet                                          Use testnet instead of mainnet [default: false]

To start mining, you just need to run the following:

./kaspa-miner --mining-address kaspa:XXXXX

This will run the miner on all the available GPU devcies.

Devfund

The devfund is a fund managed by the Kaspa community in order to fund Kaspa development
A miner that wants to mine higher percentage into the dev-fund can pass the following flags:
--devfund-precent=XX.YY to mine only XX.YY% of the blocks into the devfund.

This version automatically sets the devfund donation to the community designated address. Due to community decision, the minimum amount in the precompiled binaries is 2%

Donation Addresses

Elichai: kaspa:qzvqtx5gkvl3tc54up6r8pk5mhuft9rtr0lvn624w9mtv4eqm9rvc9zfdmmpu

HauntedCook: kaspa:qz4jdyu04hv4hpyy00pl6trzw4gllnhnwy62xattejv2vaj5r0p5quvns058f

kaspa-miner's People

Contributors

benrod3k avatar demisrael avatar easonwang00 avatar elichai avatar surinder83singh avatar tmrlvi avatar twkrol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kaspa-miner's Issues

CUDA error

Any idea what could be causing this error?
Runing with driver 470.05
ERROR kaspacuda::worker] Error loading PTX: "unknown error"

failed to run custom build command

When I try to use cargo build --release -p kaspa-miner -p kaspacuda -p kaspaopencl to compile the code, I keep recieving this error
error: failed to run custom build command for cust_raw v0.11.3
Caused by:
process didn't exit successfully: D:\kaspa-miner-main\target\release\build\cust_raw-78d8583b1f3493ef\build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'Could not find a cuda installation', C:\Users\kenny.cargo\registry\src\github.com-1ecc6299db9ec823\find_cuda_helper-0.2.0\src\lib.rs:12:13
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

My gcc version is 8.3.0 and I use vscode to compile.
Please help me fix it. Thanks!

Kaspa miner does not print anything

I'm using archlinux. I downloaded the kaspa-miner-v0.2.1-GPU-0.7-kaspacuda-overclock-linux-gnu-amd64 binaries. When running the kaspa miner, nothing is printed in the terminal. For full disclosure, the miner from BZminer had the same behavior. My GPU is an RTX 3060. The debug logging option -d does not provide any additional info.

Unstable operation of the miner on Windows 11 (64-bit)

The miner of the latest version, alas, is unstable with rx 580 video cards, on AMD chips, the problem occurs on the Windows 11 64-bit platform, the version of the video card drivers is the latest of the current ones!

macOS Build Error

When trying to build from source on macOS:

$ cargo build --release -p kaspa-miner -p kaspacuda -p kaspaopencl
error: failed to read `/kaspa-miner/plugins/README.md/Cargo.toml`

Caused by:
  Not a directory (os error 20)

[Intel Mac Pro, Dual AMD FirePro]

AMD 6500 support gfx1034

Update RGA to v2.6
Compile
rga --O3 -s opencl -c gfx1034 -b plugins/opencl/resources/bin/kaspa-opencl.bin plugins/opencl/resources/kaspa-opencl.cl -D __FORCE_AMD_V_DOT8_U32_U4__=1 -D OPENCL_PLATFORM_AMD --OpenCLoption "-cl-finite-math-only -cl-mad-enable "

Modify

diff --git a/plugins/opencl/resources/kaspa-opencl.cl b/plugins/opencl/resources/kaspa-opencl.cl
index a4c7fc1..112276c 100644
--- a/plugins/opencl/resources/kaspa-opencl.cl
+++ b/plugins/opencl/resources/kaspa-opencl.cl
@@ -263,7 +263,7 @@ void STATIC inline _amul4bit(__constant uint32_t packed_vec1[32], uint32_t packe
     }
     *ret = res;
 }
-#elif defined(__gfx906__) || defined(__gfx908__) || defined(__gfx1011__) || defined(__gfx1012__) || defined(__gfx1030__) || defined(__gfx1031__) || defined(__gfx1032__)
+#elif defined(__gfx906__) || defined(__gfx908__) || defined(__gfx1011__) || defined(__gfx1012__) || defined(__gfx1030__) || defined(__gfx1031__) || defined(__gfx1032__) || defined(__gfx1034__)
 #define amul4bit(X,Y,Z) _amul4bit((constant uint32_t*)(X), (private uint32_t*)(Y), (uint32_t *)(Z))
 void STATIC inline _amul4bit(__constant uint32_t packed_vec1[32], uint32_t packed_vec2[32], uint32_t *ret) {
     // We assume each 32 bits have four values: A0 B0 C0 D0
diff --git a/plugins/opencl/src/worker.rs b/plugins/opencl/src/worker.rs
index da2a7e9..a80f1dd 100644
--- a/plugins/opencl/src/worker.rs
+++ b/plugins/opencl/src/worker.rs
@@ -256,6 +256,12 @@ impl OpenCLGPUWorker {
                         "",
                     )
                     .unwrap_or_else(|e| panic!("{}::Program::create_and_build_from_binary failed: {}", name, e)),
+                    "gfx1034" => Program::create_and_build_from_binary(
+                        &context,
+                        &[include_bytes!("../resources/bin/gfx1034_kaspa-opencl.bin")],
+                        "",
+                    )
+                    .unwrap_or_else(|e| panic!("{}::Program::create_and_build_from_binary failed: {}", name, e)),
                     other => {
                         panic!(
                             "{}: Found device {} without prebuilt binary. Trying to run without --opencl-amd-binary.",


Linux opencl compilaton errors on AMD R7 370 (GCN1) on miner startup

When running Kaspa-Miner GPU 0.2.1-GPU-0.6b on Linux with AMD Radeon R7 370, I get errors when compiling the binary for my GPU.

Please see the attached log file for details.

I'm using amdgpu drivers, and other miners that are able to utilize this card (such as lolminer and phoenixminer) are working, so I doubt there are problems with the system setup. My system is arch linux Linux minemachine 5.16.16-arch1-1 #1 SMP PREEMPT Mon, 21 Mar 2022 22:59:40 +0000 x86_64 GNU/Linux atm.

kaspa-miner-gpu.log

I understand this is an old card, but to my (admittedly noobish eyes) this doesn't seem as a fault of card age. I, of course, might be wrong.

Thank you for any pointers you might have. I am available for any further information you might need from me.

Best regards,
MA0

Run error in Ubuntu 20

ERROR kaspacuda::worker] Error loading PTX. Make sure you have the updated driver for you devices
thread '' panicked at 'called Result::unwrap() on an Err value: UnknownError', plugins/cuda/src/lib.rs:159:18
^C

Fix readme.md

Currently is says "This will run the miner on all the available CPU cores", should be "all GPU devices" instead

Watchdog.

Hi, would be possible to implement a watchdog to reset itself if it gets stucked?

Cargo install

unable to finish the install with cargo

sudo cargo install kaspa-miner
Updating crates.io index
Downloaded kaspa-miner v0.2.0
error: failed to parse manifest at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/kaspa-miner-0.2.0/Cargo.toml

Caused by:
failed to parse the edition key

Caused by:
supported edition values are 2015 or 2018, but 2021 is unknown

Killed

Ubuntu 18
NVIDIA 470.74
GeForce RTX 2060 SUPER

v0.2.0 and v0.2.1

[2022-01-04T09:56:55Z DEBUG h2::codec::framed_read] received frame=Ping { ack: false, payload: [2, 4, 16, 16, 9, 14, 7, 7] }
[2022-01-04T09:56:55Z DEBUG h2::codec::framed_write] send frame=Ping { ack: true, payload: [2, 4, 16, 16, 9, 14, 7, 7] }
[2022-01-04T09:56:55Z DEBUG h2::codec::framed_read] received frame=Data { stream_id: StreamId(1) }
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_read] received frame=Data { stream_id: StreamId(1) }
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_write] send frame=Data { stream_id: StreamId(1) }
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_read] received frame=WindowUpdate { stream_id: StreamId(0), size_increment: 77 }
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_read] received frame=Ping { ack: false, payload: [2, 4, 16, 16, 9, 14, 7, 7] }
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_write] send frame=Ping { ack: true, payload: [2, 4, 16, 16, 9, 14, 7, 7] }
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_read] received frame=Data { stream_id: StreamId(1) }
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] Device #7 compute version is 7.5
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] GPU #7 Chosen workload: 557056
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] Device #5 compute version is 7.5
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] GPU #5 Chosen workload: 557056
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] Device #3 compute version is 7.5
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] GPU #3 Chosen workload: 557056
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_read] received frame=Data { stream_id: StreamId(1) }
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_write] send frame=Data { stream_id: StreamId(1) }
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] Device #1 compute version is 7.5
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] GPU #1 Chosen workload: 557056
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] Device #2 compute version is 7.5
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] GPU #2 Chosen workload: 557056
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_read] received frame=WindowUpdate { stream_id: StreamId(0), size_increment: 77 }
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_read] received frame=Ping { ack: false, payload: [2, 4, 16, 16, 9, 14, 7, 7] }
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_write] send frame=Ping { ack: true, payload: [2, 4, 16, 16, 9, 14, 7, 7] }
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] Device #6 compute version is 7.5
[2022-01-04T09:56:56Z DEBUG h2::codec::framed_read] received frame=Data { stream_id: StreamId(1) }
[2022-01-04T09:56:56Z INFO  kaspa_miner::gpu] GPU #6 Chosen workload: 557056
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] Device #0 compute version is 7.5
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #0 Chosen workload: 557056
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] Device #4 compute version is 7.5
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #3 is generating initial seed. This may take some time.
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #5 is generating initial seed. This may take some time.
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #7 is generating initial seed. This may take some time.
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #2 is generating initial seed. This may take some time.
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #4 Chosen workload: 557056
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #1 is generating initial seed. This may take some time.
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #6 is generating initial seed. This may take some time.
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #0 is generating initial seed. This may take some time.
[2022-01-04T09:56:57Z INFO  kaspa_miner::gpu] GPU #4 is generating initial seed. This may take some time.
Killed

2 unused deps

Cargo udeps detects 2 unused crates

It detects 2 crates which could be possibly removed, once_cell and nix.

image

Add the stratum pool mining mode help item

It's needed to be mentioned in the '-s' parameter help line that there could not only be the Kaspad IP/name as this parameter value, but also a stratum+tcp://<pool ip[:port]> line if it's required to mine to a pool

Offer to add more technical info!!!

I tested your software under Windows 10 Enterprise 64-bit. Everything functions relatively stably!... Alas, I don’t know if it’s normal, the hashrate is 90-92 megahash! Please complete your technical documentation. I mean, make at least a normal readme file as part of the archive, so that everyone can immediately understand what hashrate should be on different models of video cards, and from different competing manufacturers, these very video cards!

Found argument '--cuda-power-limits' which wasn't expected, or isn't valid in this context

F:\OneDrive\Desktop\kaspa-miner-v0.2.1-GPU-0.7-default-win64-amd64>kaspa-miner-v0.2.1-GPU-0.7-default-win64-amd64.exe -a kaspa:qpgh8kfxhapwzp2hfyzah8xa4hkzddfhf750l9f0qdw9qxc3tymjj20qe98tn -t 4 -s stratum+tcp://kaspa-pool.org:4444 --cuda-workload 64 --cuda-power-limits 100
error: Found argument '--cuda-power-limits' which wasn't expected, or isn't valid in this context

        Did you mean '--cuda-workload'?

        If you tried to supply `--cuda-power-limits` as a value rather than a flag, use `-- --cuda-power-limits`

USAGE:
    kaspa-miner-v0.2.1-GPU-0.7-default-win64-amd64.exe --mining-address <MINING_ADDRESS> --threads <NUM_THREADS> --kaspad-address <KASPAD_ADDRESS> --cuda-workload <CUDA_WORKLOAD>

For more information try --help

Enable cuda oc

Lock mem-clocks help to gain some extra hashrates. To enable lock-mem-clocks in a very low value eg: absolute 810Mhz in hiveos, the user have to invoke nvidia-smi through a scheduled event.

In bzminer and lolminer there're parameters to lock mem clocks. kaspa-miner should be able to do the same.

Attempting mining with openCl or no gpu

Hello I currently have an all amd system and I was trying to test —openCl-device command and the —no-gpu command and I get the system error the code execution cannot proceed because nvcuda.Dll was not found. Reinstalling the program may fix the problem.

I know this is because I don’t have cuda installed but is there I way to get around it trying to use cuda altogether. I would love to be able to gpu mine with amd cards and am happy to help test.

Thanks!

Kaspad not synced induces miner panic error

From time to time my kaspad is out of sync, then the linux miner (under hiveos) panicked. So it's restarting every several minutes:

[2022-01-18T14:31:13Z WARN  kaspa_miner::miner] Kaspad is not synced, skipping current template
thread 'thread 'thread 'thread 'thread '<unnamed><unnamed><unnamed>' panicked at '' panicked at '' panicked at '<unnamed><unnamed>called `Result::unwrap()` on an `Err` value: IllegalAddresscalled `Result::unwrap()` on an `Err` value: IllegalAddresscalled `Result::unwrap()` on an `Err` value: IllegalAddress', ' panicked at '' panicked at '', src/miner.rs', :called `Result::unwrap()` on an `Err` value: IllegalAddresscalled `Result::unwrap()` on an `Err` value: IllegalAddresssrc/miner.rssrc/miner.rs150', ', :::150src/miner.rssrc/miner.rs37150:::
:37note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
37
150150
::3737

Thanks to hiveos, it restarts then, but I'm probably loosing some hashrate. I observe this regardles of last 2 miner versions, as well as previous stable and current beta nvidia drivers:

Actual:
miner v0.2.1-GPU-0.3
NVIDIA-SMI 495.46 Driver Version: 495.46 CUDA Version: 11.5
hardware: 5 x rtx 3070 ti

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.