mirror of
https://github.com/GOSTSec/ccminer
synced 2025-01-08 22:07:56 +00:00
xmr: link the --bfactor setting (0-11)
This commit is contained in:
parent
e231343060
commit
23be7f308d
11
README.txt
11
README.txt
@ -57,7 +57,7 @@ Vertcoin Lyra2RE
|
|||||||
Ziftrcoin (ZR5)
|
Ziftrcoin (ZR5)
|
||||||
Boolberry (Wild Keccak)
|
Boolberry (Wild Keccak)
|
||||||
Monero (Cryptonight)
|
Monero (Cryptonight)
|
||||||
Aeon (Cryptonight-light)
|
Aeon (Cryptonight-lite)
|
||||||
|
|
||||||
where some of these coins have a VERY NOTABLE nVidia advantage
|
where some of these coins have a VERY NOTABLE nVidia advantage
|
||||||
over competing AMD (OpenCL Only) implementations.
|
over competing AMD (OpenCL Only) implementations.
|
||||||
@ -193,11 +193,16 @@ Scrypt specific options:
|
|||||||
cache for mining. Kepler devices may profit.
|
cache for mining. Kepler devices may profit.
|
||||||
--no-autotune disable auto-tuning of kernel launch parameters
|
--no-autotune disable auto-tuning of kernel launch parameters
|
||||||
|
|
||||||
|
CryptoNight specific options:
|
||||||
XMR and Wildkeccak specific:
|
|
||||||
-l, --launch-config gives the launch configuration for each kernel
|
-l, --launch-config gives the launch configuration for each kernel
|
||||||
in a comma separated list, one per device.
|
in a comma separated list, one per device.
|
||||||
|
--bfactor=[0-12] Run Cryptonight core kernel in smaller pieces,
|
||||||
|
From 0 (ui freeze) to 12 (smooth), win default is 11
|
||||||
|
This is a per-device setting like the launch config.
|
||||||
|
|
||||||
Wildkeccak specific:
|
Wildkeccak specific:
|
||||||
|
-l, --launch-config gives the launch configuration for each kernel
|
||||||
|
in a comma separated list, one per device.
|
||||||
-k, --scratchpad url Url used to download the scratchpad cache.
|
-k, --scratchpad url Url used to download the scratchpad cache.
|
||||||
|
|
||||||
|
|
||||||
|
2
algos.h
2
algos.h
@ -127,6 +127,8 @@ static inline int algo_to_int(char* arg)
|
|||||||
i = ALGO_AUTO;
|
i = ALGO_AUTO;
|
||||||
else if (!strcasecmp("cryptonight-light", arg))
|
else if (!strcasecmp("cryptonight-light", arg))
|
||||||
i = ALGO_CRYPTOLIGHT;
|
i = ALGO_CRYPTOLIGHT;
|
||||||
|
else if (!strcasecmp("cryptonight-lite", arg))
|
||||||
|
i = ALGO_CRYPTOLIGHT;
|
||||||
else if (!strcasecmp("flax", arg))
|
else if (!strcasecmp("flax", arg))
|
||||||
i = ALGO_C11;
|
i = ALGO_C11;
|
||||||
else if (!strcasecmp("diamond", arg))
|
else if (!strcasecmp("diamond", arg))
|
||||||
|
40
ccminer.cpp
40
ccminer.cpp
@ -146,7 +146,8 @@ int device_singlememory[MAX_GPUS] = { 0 };
|
|||||||
// implemented scrypt options
|
// implemented scrypt options
|
||||||
int parallel = 2; // All should be made on GPU
|
int parallel = 2; // All should be made on GPU
|
||||||
char *device_config[MAX_GPUS] = { 0 };
|
char *device_config[MAX_GPUS] = { 0 };
|
||||||
int device_backoff[MAX_GPUS] = { 0 };
|
int device_backoff[MAX_GPUS] = { 0 }; // scrypt
|
||||||
|
int device_bfactor[MAX_GPUS] = { 0 }; // cryptonight
|
||||||
int device_lookup_gap[MAX_GPUS] = { 0 };
|
int device_lookup_gap[MAX_GPUS] = { 0 };
|
||||||
int device_interactive[MAX_GPUS] = { 0 };
|
int device_interactive[MAX_GPUS] = { 0 };
|
||||||
int opt_nfactor = 0;
|
int opt_nfactor = 0;
|
||||||
@ -371,8 +372,9 @@ struct option options[] = {
|
|||||||
{ "interactive", 1, NULL, 1050 }, // scrypt
|
{ "interactive", 1, NULL, 1050 }, // scrypt
|
||||||
{ "lookup-gap", 1, NULL, 'L' }, // scrypt
|
{ "lookup-gap", 1, NULL, 'L' }, // scrypt
|
||||||
{ "texture-cache", 1, NULL, 1051 },// scrypt
|
{ "texture-cache", 1, NULL, 1051 },// scrypt
|
||||||
{ "launch-config", 1, NULL, 'l' }, // scrypt & bbr
|
{ "launch-config", 1, NULL, 'l' }, // scrypt bbr xmr
|
||||||
{ "scratchpad", 1, NULL, 'k' }, // bbr
|
{ "scratchpad", 1, NULL, 'k' }, // bbr
|
||||||
|
{ "bfactor", 1, NULL, 1055 }, // xmr
|
||||||
{ "max-temp", 1, NULL, 1060 },
|
{ "max-temp", 1, NULL, 1060 },
|
||||||
{ "max-diff", 1, NULL, 1061 },
|
{ "max-diff", 1, NULL, 1061 },
|
||||||
{ "max-rate", 1, NULL, 1062 },
|
{ "max-rate", 1, NULL, 1062 },
|
||||||
@ -442,7 +444,16 @@ Scrypt specific options:\n\
|
|||||||
";
|
";
|
||||||
|
|
||||||
static char const xmr_usage[] = "\n\
|
static char const xmr_usage[] = "\n\
|
||||||
CryptoNote specific options:\n\
|
CryptoNight specific options:\n\
|
||||||
|
-l, --launch-config gives the launch configuration for each kernel\n\
|
||||||
|
in a comma separated list, one per device.\n\
|
||||||
|
--bfactor=[0-12] Run Cryptonight core kernel in smaller pieces,\n\
|
||||||
|
From 0 (ui freeze) to 12 (smooth), win default is 11\n\
|
||||||
|
This is a per-device setting like the launch config.\n\
|
||||||
|
";
|
||||||
|
|
||||||
|
static char const bbr_usage[] = "\n\
|
||||||
|
Boolberry specific options:\n\
|
||||||
-l, --launch-config gives the launch configuration for each kernel\n\
|
-l, --launch-config gives the launch configuration for each kernel\n\
|
||||||
in a comma separated list, one per device.\n\
|
in a comma separated list, one per device.\n\
|
||||||
-k, --scratchpad url Url used to download the scratchpad cache.\n\
|
-k, --scratchpad url Url used to download the scratchpad cache.\n\
|
||||||
@ -2441,6 +2452,7 @@ static void *miner_thread(void *userdata)
|
|||||||
if (opt_led_mode == LED_MODE_SHARES)
|
if (opt_led_mode == LED_MODE_SHARES)
|
||||||
gpu_led_percent(dev_id, 50);
|
gpu_led_percent(dev_id, 50);
|
||||||
|
|
||||||
|
work.submit_nonce_id = 0;
|
||||||
nonceptr[0] = work.nonces[0];
|
nonceptr[0] = work.nonces[0];
|
||||||
if (!submit_work(mythr, &work))
|
if (!submit_work(mythr, &work))
|
||||||
break;
|
break;
|
||||||
@ -2468,6 +2480,7 @@ static void *miner_thread(void *userdata)
|
|||||||
if (!submit_work(mythr, &work))
|
if (!submit_work(mythr, &work))
|
||||||
break;
|
break;
|
||||||
nonceptr[0] = curnonce;
|
nonceptr[0] = curnonce;
|
||||||
|
work.nonces[1] = 0; // reset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2852,12 +2865,16 @@ static void show_usage_and_exit(int status)
|
|||||||
fprintf(stderr, "Try `" PROGRAM_NAME " --help' for more information.\n");
|
fprintf(stderr, "Try `" PROGRAM_NAME " --help' for more information.\n");
|
||||||
else
|
else
|
||||||
printf(usage);
|
printf(usage);
|
||||||
|
|
||||||
if (opt_algo == ALGO_SCRYPT || opt_algo == ALGO_SCRYPT_JANE) {
|
if (opt_algo == ALGO_SCRYPT || opt_algo == ALGO_SCRYPT_JANE) {
|
||||||
printf(scrypt_usage);
|
printf(scrypt_usage);
|
||||||
}
|
}
|
||||||
if (opt_algo == ALGO_CRYPTONIGHT || opt_algo == ALGO_CRYPTOLIGHT || opt_algo == ALGO_WILDKECCAK) {
|
else if (opt_algo == ALGO_CRYPTONIGHT || opt_algo == ALGO_CRYPTOLIGHT) {
|
||||||
printf(xmr_usage);
|
printf(xmr_usage);
|
||||||
}
|
}
|
||||||
|
else if (opt_algo == ALGO_WILDKECCAK) {
|
||||||
|
printf(bbr_usage);
|
||||||
|
}
|
||||||
proper_exit(status);
|
proper_exit(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3187,6 +3204,20 @@ void parse_arg(int key, char *arg)
|
|||||||
device_texturecache[n++] = last;
|
device_texturecache[n++] = last;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 1055: /* cryptonight --bfactor */
|
||||||
|
{
|
||||||
|
char *pch = strtok(arg, ",");
|
||||||
|
int n = 0, last = atoi(arg);
|
||||||
|
while (pch != NULL) {
|
||||||
|
last = atoi(pch);
|
||||||
|
if (last > 15) last = 15;
|
||||||
|
device_bfactor[n++] = last;
|
||||||
|
pch = strtok(NULL, ",");
|
||||||
|
}
|
||||||
|
while (n < MAX_GPUS)
|
||||||
|
device_bfactor[n++] = last;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 1070: /* --gpu-clock */
|
case 1070: /* --gpu-clock */
|
||||||
{
|
{
|
||||||
char *pch = strtok(arg,",");
|
char *pch = strtok(arg,",");
|
||||||
@ -3659,6 +3690,7 @@ int main(int argc, char *argv[])
|
|||||||
device_name[i] = NULL;
|
device_name[i] = NULL;
|
||||||
device_config[i] = NULL;
|
device_config[i] = NULL;
|
||||||
device_backoff[i] = is_windows() ? 12 : 2;
|
device_backoff[i] = is_windows() ? 12 : 2;
|
||||||
|
device_bfactor[i] = is_windows() ? 11 : 0;
|
||||||
device_lookup_gap[i] = 1;
|
device_lookup_gap[i] = 1;
|
||||||
device_batchsize[i] = 1024;
|
device_batchsize[i] = 1024;
|
||||||
device_interactive[i] = -1;
|
device_interactive[i] = -1;
|
||||||
|
@ -4,20 +4,11 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cuda.h>
|
|
||||||
#include <cuda_runtime.h>
|
|
||||||
|
|
||||||
#include "cryptolight.h"
|
#include "cryptolight.h"
|
||||||
#define LONG_SHL_IDX 18
|
#define LONG_SHL_IDX 18
|
||||||
#define LONG_LOOPS32 0x40000
|
#define LONG_LOOPS32 0x40000
|
||||||
|
|
||||||
#ifdef WIN32
|
extern int device_backoff[MAX_GPUS];
|
||||||
static __thread int cn_bfactor = 11;
|
|
||||||
static __thread int cn_bsleep = 100;
|
|
||||||
#else
|
|
||||||
static __thread int cn_bfactor = 0;
|
|
||||||
static __thread int cn_bsleep = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "cn_aes.cuh"
|
#include "cn_aes.cuh"
|
||||||
|
|
||||||
@ -259,6 +250,8 @@ void cryptolight_core_gpu_phase3(int threads, const uint32_t * __restrict__ long
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int device_bfactor[MAX_GPUS];
|
||||||
|
|
||||||
__host__
|
__host__
|
||||||
void cryptolight_core_cpu_hash(int thr_id, int blocks, int threads, uint32_t *d_long_state, uint32_t *d_ctx_state, uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2)
|
void cryptolight_core_cpu_hash(int thr_id, int blocks, int threads, uint32_t *d_long_state, uint32_t *d_ctx_state, uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2)
|
||||||
{
|
{
|
||||||
@ -267,8 +260,8 @@ void cryptolight_core_cpu_hash(int thr_id, int blocks, int threads, uint32_t *d_
|
|||||||
dim3 block4(threads << 2);
|
dim3 block4(threads << 2);
|
||||||
dim3 block8(threads << 3);
|
dim3 block8(threads << 3);
|
||||||
|
|
||||||
const int bfactor = cn_bfactor; // device_bfactor[thr_id];
|
const int bfactor = device_bfactor[thr_id];
|
||||||
const int bsleep = cn_bsleep; //device_bsleep[thr_id];
|
const int bsleep = bfactor ? 100 : 0;
|
||||||
|
|
||||||
int i, partcount = 1 << bfactor;
|
int i, partcount = 1 << bfactor;
|
||||||
int dev_id = device_map[thr_id];
|
int dev_id = device_map[thr_id];
|
||||||
|
@ -4,22 +4,10 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cuda.h>
|
|
||||||
#include <cuda_runtime.h>
|
|
||||||
|
|
||||||
#include "cryptonight.h"
|
#include "cryptonight.h"
|
||||||
#define LONG_SHL_IDX 19
|
#define LONG_SHL_IDX 19
|
||||||
#define LONG_LOOPS32 0x80000
|
#define LONG_LOOPS32 0x80000
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
// to prevent ui freeze
|
|
||||||
static __thread int cn_bfactor = 11;
|
|
||||||
static __thread int cn_bsleep = 100;
|
|
||||||
#else
|
|
||||||
static __thread int cn_bfactor = 0;
|
|
||||||
static __thread int cn_bsleep = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "cn_aes.cuh"
|
#include "cn_aes.cuh"
|
||||||
|
|
||||||
#define MUL_SUM_XOR_DST(a,c,dst) { \
|
#define MUL_SUM_XOR_DST(a,c,dst) { \
|
||||||
@ -264,6 +252,8 @@ void cryptonight_core_gpu_phase3(int threads, const uint32_t * __restrict__ long
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int device_bfactor[MAX_GPUS];
|
||||||
|
|
||||||
__host__
|
__host__
|
||||||
void cryptonight_core_cpu_hash(int thr_id, int blocks, int threads, uint32_t *d_long_state, uint32_t *d_ctx_state, uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2)
|
void cryptonight_core_cpu_hash(int thr_id, int blocks, int threads, uint32_t *d_long_state, uint32_t *d_ctx_state, uint32_t *d_ctx_a, uint32_t *d_ctx_b, uint32_t *d_ctx_key1, uint32_t *d_ctx_key2)
|
||||||
{
|
{
|
||||||
@ -272,8 +262,8 @@ void cryptonight_core_cpu_hash(int thr_id, int blocks, int threads, uint32_t *d_
|
|||||||
dim3 block4(threads << 2);
|
dim3 block4(threads << 2);
|
||||||
dim3 block8(threads << 3);
|
dim3 block8(threads << 3);
|
||||||
|
|
||||||
const int bfactor = cn_bfactor; // device_bfactor[thr_id];
|
const int bfactor = device_bfactor[thr_id];
|
||||||
const int bsleep = cn_bsleep; //device_bsleep[thr_id];
|
const int bsleep = bfactor ? 100 : 0;
|
||||||
|
|
||||||
int i, partcount = 1 << bfactor;
|
int i, partcount = 1 << bfactor;
|
||||||
int dev_id = device_map[thr_id];
|
int dev_id = device_map[thr_id];
|
||||||
|
Loading…
Reference in New Issue
Block a user