Skip to content

Commit a439858

Browse files
committed
Merge tag '4.1.271'
2 parents 0e689ea + f570991 commit a439858

27 files changed

+412
-274
lines changed

AUTHORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ updated by many others.
3131

3232
## Testing, bug fixes, improvements
3333

34+
* Hot-switching OpenCL kernel (N-Factor): Jan Berdajs <mrbrdo> 15bULC8snaKAMeFb3xBmmhbWj1xyTmBUfm
3435
* Gabriel Devenyi <gdevenyi>
3536
* Benjamin Herrenschmidt <ozbenh>
3637
* Joe4782 <Joe4782>

NEWS.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,36 @@
22

33
## Version 4.2.0 - TBA
44

5+
*
6+
7+
8+
## Version 4.1.271 - 12th April 2014
9+
10+
* Allow setting algorithm per-pool and initial implementation of kernel
11+
hot-swapping (by _mrbrdo_). Use options `pool-algorithm` (in config
12+
file or in CLI) or `algorithm` (config-only).
13+
* NCurses UI [S][W] writes pool name and description to configuration.
14+
* Added algorithm name to `pools` API command (by _troky_).
15+
* NCurses UI asks for (optional) pool name, description and algorithm
16+
when adding pool.
17+
* API command `addpool` allows both `url,user,pass` and
18+
`url,user,pass,name,desc,algo`.
19+
20+
21+
## Version 4.1.242 - 7th April 2014
22+
23+
* There are now two mailing lists (on SourceForge), see `README.md`.
524
* Adaptive-N-factor algorithm support (by _Bufius_, _Zuikkis_ and
625
_veox_). For details on choosing the algorithm, see
726
`doc/configuration.md`.
8-
* Setting pool name with `poolname` is deprecated. Use `name` instead.
927
* Allowed kernel names are no longer hard-coded. It is now possible to
1028
use any `.cl` file.
1129
* Configuration parameter `poolname` has been renamed to `name`.
30+
`poolname` is deprecated and will be removed in a future version.
1231
* Multiple `--name` parsing should now work as expected (by _troky_).
13-
* `--coin` configuration parameter to specify a freeform pool
14-
description (by _troky_).
32+
* `--description` configuration parameter to specify a freeform pool
33+
description, and `--priority` to specify the pool's priority (by
34+
_troky_).
1535
* Added new Algorithms for cpu coins
1636
nscrypt --algorithm nscrypt
1737
scrypt-jane --algorithm scrypt-jane

README.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ CPU coin algo's no longer use kernel option to set. Use algorithm instead. i.e.
77
## Introduction
88

99
This is a multi-threaded multi-pool GPU miner with ATI GPU monitoring,
10-
(over)clocking and fanspeed support for scrypt-based coins. It is based on
11-
cgminer by Con Kolivas (ckolivas), which is in turn based on cpuminer by
12-
Jeff Garzik (jgarzik).
10+
(over)clocking and fanspeed support for scrypt-based cryptocurrency. It is
11+
based on cgminer by Con Kolivas (ckolivas), which is in turn based on
12+
cpuminer by Jeff Garzik (jgarzik).
1313

1414
**releases**: https://github.com/veox/sgminer/releases
1515

1616
**git tree**: https://github.com/veox/sgminer
1717

18-
**issues**: https://github.com/veox/sgminer/issues
18+
**bugtracker**: https://github.com/veox/sgminer/issues
1919

20-
**irc**: `#sgminer` on freenode
20+
**irc**: `#sgminer` and `#sgminer-dev` on freenode
21+
22+
**mailing lists**: https://sourceforge.net/p/sgminer/mailman/
2123

2224
License: GPLv3. See `COPYING` for details.
2325

@@ -69,6 +71,11 @@ sgminer-specific configuration options:
6971
--disable-adl Override detection and disable building with adl
7072
--disable-adl-checks
7173
--without-curses Do not compile support for curses TUI
74+
75+
#### Debian Example
76+
77+
apt-get install libcurl4-openssl-dev pkg-config libtool libncurses5-dev
78+
AMD APP SDK and AMD ADL SDK must be downloaded from the amd websites.
7279

7380
### *nix build instructions
7481

adl.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ static ADL_OVERDRIVE6_POWERCONTROL_SET ADL_Overdrive6_PowerControl_Set;
121121
#endif
122122
static int iNumberAdapters;
123123
static LPAdapterInfo lpInfo = NULL;
124-
static LPADLDisplayInfo lpAdlDisplayInfo = NULL;
125124

126125
int set_fanspeed(int gpu, int iFanSpeed);
127126
static float __gpu_temp(struct gpu_adl *ga);
@@ -326,7 +325,6 @@ void init_adl(int nDevs)
326325
struct gpu_adapters adapters[MAX_GPUDEVICES], vadapters[MAX_GPUDEVICES];
327326
bool devs_match = true;
328327
ADLBiosInfo BiosInfo;
329-
int iNumDisplays;
330328

331329
applog(LOG_INFO, "Number of ADL devices: %d", nDevs);
332330

@@ -361,7 +359,7 @@ void init_adl(int nDevs)
361359
return;
362360
}
363361

364-
applog(LOG_INFO, "Found %d ADL adapters", iNumberAdapters);
362+
applog(LOG_INFO, "Found %d logical ADL adapters", iNumberAdapters);
365363

366364
/* Iterate over iNumberAdapters and find the lpAdapterID of real devices */
367365
for (i = 0; i < iNumberAdapters; i++) {

adl.h

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#ifndef __ADL_H__
2-
#define __ADL_H__
1+
#ifndef ADL_H
2+
#define ADL_H
3+
34
#ifdef HAVE_ADL
45
extern bool adl_active;
56
extern bool opt_reorder;
@@ -19,10 +20,14 @@ bool gpu_stats(int gpu, float *temp, int *engineclock, int *memclock, float *vdd
1920
void change_gpusettings(int gpu);
2021
void gpu_autotune(int gpu, enum dev_enable *denable);
2122
void clear_adl(int nDevs);
23+
2224
#else /* HAVE_ADL */
25+
2326
#define adl_active (0)
2427
static inline void init_adl(__maybe_unused int nDevs) {}
2528
static inline void change_gpusettings(__maybe_unused int gpu) { }
2629
static inline void clear_adl(__maybe_unused int nDevs) {}
27-
#endif
28-
#endif
30+
31+
#endif /* HAVE_ADL */
32+
33+
#endif /* ADL_H */

algorithm.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ static algorithm_t algos[] = {
6464
{ NULL, NULL, 0, 0, ALGO_SCRYPT, 0, 0, 0, 0, NULL}
6565
};
6666

67-
void set_algorithm(algorithm_t** algo, const char* newname) {
67+
void set_algorithm(algorithm_t* algo, const char* newname) {
6868
algorithm_t* a;
6969
for (a = algos; a->name; a++) {
7070
if (strcmp(a->name, newname) == 0) {
71-
*algo = a;
71+
*algo = *a;
7272
break;
7373
}
7474
}
75-
(*algo)->n = (1 << (*algo)->nfactor);
75+
algo->n = (1 << algo->nfactor);
7676
}
7777

7878
void set_algorithm_nfactor(algorithm_t* algo, const uint8_t nfactor) {
@@ -81,3 +81,8 @@ void set_algorithm_nfactor(algorithm_t* algo, const uint8_t nfactor) {
8181

8282
return;
8383
}
84+
85+
bool cmp_algorithm(algorithm_t* algo1, algorithm_t* algo2) {
86+
return (strcmp(algo1->name, algo2->name) == 0) &&
87+
(algo1->nfactor == algo2->nfactor);
88+
}

algorithm.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define ALGORITHM_H
33

44
#include <inttypes.h>
5+
#include <stdbool.h>
56

67
struct work;
78

@@ -39,9 +40,12 @@ typedef struct _algorithm_t {
3940
} algorithm_t;
4041

4142
/* Set default parameters based on name. */
42-
void set_algorithm(algorithm_t** algo, const char* name);
43+
void set_algorithm(algorithm_t* algo, const char* name);
4344

4445
/* Set to specific N factor. */
4546
void set_algorithm_nfactor(algorithm_t* algo, const uint8_t nfactor);
4647

48+
/* Compare two algorithm parameters */
49+
bool cmp_algorithm(algorithm_t* algo1, algorithm_t* algo2);
50+
4751
#endif /* ALGORITHM_H */

api.c

+30-14
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static const char GPUSEP = ',';
128128
#define JOIN_CMD "CMD="
129129
#define BETWEEN_JOIN SEPSTR
130130

131-
static const char *APIVERSION = "3.1";
131+
static const char *APIVERSION = "3.2";
132132
static const char *DEAD = "Dead";
133133
static const char *SICK = "Sick";
134134
static const char *NOSTART = "NoStart";
@@ -2070,8 +2070,9 @@ static void poolstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
20702070

20712071
root = api_add_int(root, "POOL", &i, false);
20722072
root = api_add_string(root, "Name", pool->name, false);
2073-
root = api_add_string(root, "Coin", pool->coin, false);
20742073
root = api_add_escape(root, "URL", pool->rpc_url, false);
2074+
root = api_add_string(root, "Algorithm", (char *)pool->algorithm.name, false);
2075+
root = api_add_string(root, "Description", pool->description, false);
20752076
root = api_add_string(root, "Status", status, false);
20762077
root = api_add_int(root, "Priority", &(pool->prio), false);
20772078
root = api_add_int(root, "Quota", &pool->quota, false);
@@ -2362,7 +2363,8 @@ static void copyadvanceafter(char ch, char **param, char **buf)
23622363
*(dst_b++) = '\0';
23632364
}
23642365

2365-
static bool pooldetails(char *param, char **url, char **user, char **pass)
2366+
static bool pooldetails(char *param, char **url, char **user, char **pass,
2367+
char **name, char **desc, char **algo)
23662368
{
23672369
char *ptr, *buf;
23682370

@@ -2371,24 +2373,31 @@ static bool pooldetails(char *param, char **url, char **user, char **pass)
23712373
quit(1, "Failed to malloc pooldetails buf");
23722374

23732375
*url = buf;
2374-
2375-
// copy url
23762376
copyadvanceafter(',', &param, &buf);
2377-
23782377
if (!(*param)) // missing user
23792378
goto exitsama;
23802379

23812380
*user = buf;
2382-
2383-
// copy user
23842381
copyadvanceafter(',', &param, &buf);
2385-
23862382
if (!*param) // missing pass
23872383
goto exitsama;
23882384

23892385
*pass = buf;
2386+
copyadvanceafter(',', &param, &buf);
2387+
if (!*param) // missing name (allowed)
2388+
return true;
23902389

2391-
// copy pass
2390+
*name = buf;
2391+
copyadvanceafter(',', &param, &buf);
2392+
if (!*param) // missing desc
2393+
goto exitsama;
2394+
2395+
*desc = buf;
2396+
copyadvanceafter(',', &param, &buf);
2397+
if (!*param) // missing algo
2398+
goto exitsama;
2399+
2400+
*algo = buf;
23922401
copyadvanceafter(',', &param, &buf);
23932402

23942403
return true;
@@ -2401,6 +2410,7 @@ static bool pooldetails(char *param, char **url, char **user, char **pass)
24012410
static void addpool(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, bool isjson, __maybe_unused char group)
24022411
{
24032412
char *url, *user, *pass;
2413+
char *name = NULL, *desc = NULL, *algo = NULL;
24042414
struct pool *pool;
24052415
char *ptr;
24062416

@@ -2409,7 +2419,8 @@ static void addpool(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *
24092419
return;
24102420
}
24112421

2412-
if (!pooldetails(param, &url, &user, &pass)) {
2422+
if (!pooldetails(param, &url, &user, &pass,
2423+
&name, &desc, &algo)) {
24132424
ptr = escape_string(param, isjson);
24142425
message(io_data, MSG_INVPDP, 0, ptr, isjson);
24152426
if (ptr != param)
@@ -2418,9 +2429,14 @@ static void addpool(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *
24182429
return;
24192430
}
24202431

2432+
/* If API client is old, it might not have provided all fields. */
2433+
if (name == NULL) name = strdup("");
2434+
if (desc == NULL) desc = strdup("");
2435+
if (algo == NULL) algo = strdup("scrypt"); // FIXME?
2436+
24212437
pool = add_pool();
24222438
detect_stratum(pool, url);
2423-
add_pool_details(pool, true, url, user, pass);
2439+
add_pool_details(pool, true, url, user, pass, name, desc, algo);
24242440

24252441
ptr = escape_string(url, isjson);
24262442
message(io_data, MSG_ADDPOOL, 0, ptr, isjson);
@@ -3165,7 +3181,7 @@ static void minecoin(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __may
31653181
message(io_data, MSG_MINECOIN, 0, NULL, isjson);
31663182
io_open = io_add(io_data, isjson ? COMSTR JSON_MINECOIN : _MINECOIN COMSTR);
31673183

3168-
root = api_add_const(root, "Hash Method", algorithm->name, false);
3184+
root = api_add_string(root, "Hash Method", (char *)get_devices(0)->algorithm.name, false);
31693185

31703186
cg_rlock(&ch_lock);
31713187
root = api_add_timeval(root, "Current Block Time", &block_timeval, true);
@@ -4682,7 +4698,7 @@ void api(int api_thr_id)
46824698
pthread_cleanup_pop(true);
46834699

46844700
free(apisock);
4685-
4701+
46864702
if (opt_debug)
46874703
applog(LOG_DEBUG, "API: terminating due to: %s",
46884704
do_a_quit ? "QUIT" : (do_a_restart ? "RESTART" : (bye ? "BYE" : "UNKNOWN!")));

compat.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef __COMPAT_H__
2-
#define __COMPAT_H__
1+
#ifndef COMPAT_H
2+
#define COMPAT_H
33

44
#ifdef WIN32
55
#include "config.h"
@@ -88,4 +88,4 @@ typedef long suseconds_t;
8888
#define PTH(thr) ((thr)->pth)
8989
#endif /* WIN32 */
9090

91-
#endif /* __COMPAT_H__ */
91+
#endif /* COMPAT_H */

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
33
m4_define([v_maj], [4])
44
m4_define([v_min], [1])
5-
m4_define([v_mic], [153])
5+
m4_define([v_mic], [271])
66
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
77
m4_define([v_ver], [v_maj.v_min.v_mic])
88
m4_define([lt_rev], m4_eval(v_maj + v_min))

doc/configuration.md

+17
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
Allows choosing between the few mining algorithms for incompatible
1111
cryptocurrencies.
1212

13+
If specified in a pool section in the configuration file, sets the
14+
option for that pool only. Otherwise sets the default.
15+
1316
*Argument:* string
1417

1518
*Default:* `scrypt`
@@ -36,16 +39,30 @@ cryptocurrencies.
3639
without warning.
3740

3841

42+
### pool-algorithm
43+
44+
Allows choosing the algorithm for a specific pool. See `algorithm`.
45+
46+
3947
### nfactor
4048

4149
Overrides the default scrypt parameter N, specified as the factor of 2
4250
(`N = 2^nfactor`).
4351

52+
If specified in a pool section in the configuration file, sets the
53+
option for that pool only. Otherwise sets the default.
54+
4455
*Argument:* whole number (>1).
4556

4657
*Default:* depends on `algorithm`; otherwise `10`.
4758

4859

60+
### pool-nfactor
61+
62+
Overrides the default scrypt parameter N for a specific pool.
63+
See `nfactor`.
64+
65+
4966
## CLI-only options
5067

5168
*TODO*

driver-gridseed.c

+2
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,8 @@ static bool gridseed_detect_one(libusb_device *dev, struct usb_find_devices *fou
768768

769769
gc3355_init(gridseed, info);
770770

771+
gridseed->algorithm = default_algorithm;
772+
771773
if (!add_cgpu(gridseed))
772774
goto unshin;
773775

0 commit comments

Comments
 (0)