improve the device mapping and a possible segfault
when using -n, work_restart array was not allocated
This commit is contained in:
parent
5fb84189b2
commit
be73cd1ae0
@ -1,5 +1,5 @@
|
||||
|
||||
ccMiner release 1.7.0 (Nov 2015) "Mining Diff & basic MultiAlgo"
|
||||
ccMiner release 1.7.1 (Dec 2015) "Mining Diff & basic MultiAlgo"
|
||||
---------------------------------------------------------------
|
||||
|
||||
***************************************************************
|
||||
@ -231,6 +231,9 @@ features.
|
||||
|
||||
>>> RELEASE HISTORY <<<
|
||||
|
||||
Dec. 03th 2015 v1.7.1
|
||||
Small bug fixes about device ids mapping (and vendor names)
|
||||
|
||||
Nov. 06th 2015 v1.7
|
||||
Improve old devices compatibility (x11, lyra2v2, quark, qubit...)
|
||||
Add windows support for SM 2.1 and drop SM 3.5 (x86)
|
||||
|
@ -1415,7 +1415,7 @@ void restart_threads(void)
|
||||
if (opt_debug && !opt_quiet)
|
||||
applog(LOG_DEBUG,"%s", __FUNCTION__);
|
||||
|
||||
for (int i = 0; i < opt_n_threads; i++)
|
||||
for (int i = 0; i < opt_n_threads && work_restart; i++)
|
||||
work_restart[i].restart = 1;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
AC_INIT([ccminer], [1.7])
|
||||
AC_INIT([ccminer], [1.7.1])
|
||||
|
||||
AC_PREREQ([2.59c])
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
@ -162,7 +162,7 @@
|
||||
#define PACKAGE_NAME "ccminer"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "ccminer 1.7"
|
||||
#define PACKAGE_STRING "ccminer 1.7.1"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "ccminer"
|
||||
@ -171,7 +171,7 @@
|
||||
#define PACKAGE_URL "http://github.com/tpruvot/ccminer"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.7"
|
||||
#define PACKAGE_VERSION "1.7.1"
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
@ -185,7 +185,7 @@
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "1.7"
|
||||
#define VERSION "1.7.1"
|
||||
|
||||
/* Define curl_free() as free() if our version of curl lacks curl_free. */
|
||||
/* #undef curl_free */
|
||||
|
25
cuda.cpp
25
cuda.cpp
@ -68,25 +68,26 @@ void cuda_devicenames()
|
||||
for (int i=0; i < GPU_N; i++)
|
||||
{
|
||||
char vendorname[32] = { 0 };
|
||||
int dev_id = device_map[i];
|
||||
cudaDeviceProp props;
|
||||
cudaGetDeviceProperties(&props, device_map[i]);
|
||||
cudaGetDeviceProperties(&props, dev_id);
|
||||
|
||||
device_sm[i] = (props.major * 100 + props.minor * 10);
|
||||
device_sm[dev_id] = (props.major * 100 + props.minor * 10);
|
||||
|
||||
if (device_name[i]) {
|
||||
free(device_name[i]);
|
||||
device_name[i] = NULL;
|
||||
if (device_name[dev_id]) {
|
||||
free(device_name[dev_id]);
|
||||
device_name[dev_id] = NULL;
|
||||
}
|
||||
#ifdef USE_WRAPNVML
|
||||
if (gpu_vendor((uint8_t)props.pciBusID, vendorname) > 0 && strlen(vendorname)) {
|
||||
device_name[i] = (char*) calloc(1, strlen(vendorname) + strlen(props.name) + 2);
|
||||
device_name[dev_id] = (char*) calloc(1, strlen(vendorname) + strlen(props.name) + 2);
|
||||
if (!strncmp(props.name, "GeForce ", 8))
|
||||
sprintf(device_name[i], "%s %s", vendorname, &props.name[8]);
|
||||
sprintf(device_name[dev_id], "%s %s", vendorname, &props.name[8]);
|
||||
else
|
||||
sprintf(device_name[i], "%s %s", vendorname, props.name);
|
||||
sprintf(device_name[dev_id], "%s %s", vendorname, props.name);
|
||||
} else
|
||||
#endif
|
||||
device_name[i] = strdup(props.name);
|
||||
device_name[dev_id] = strdup(props.name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,11 +96,11 @@ void cuda_print_devices()
|
||||
int ngpus = cuda_num_devices();
|
||||
cuda_devicenames();
|
||||
for (int n=0; n < ngpus; n++) {
|
||||
int m = device_map[n % MAX_GPUS];
|
||||
int dev_id = device_map[n % MAX_GPUS];
|
||||
cudaDeviceProp props;
|
||||
cudaGetDeviceProperties(&props, m);
|
||||
cudaGetDeviceProperties(&props, dev_id);
|
||||
if (!opt_n_threads || n < opt_n_threads) {
|
||||
fprintf(stderr, "GPU #%d: SM %d.%d %s\n", m, props.major, props.minor, device_name[n]);
|
||||
fprintf(stderr, "GPU #%d: SM %d.%d %s\n", dev_id, props.major, props.minor, device_name[dev_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -638,8 +638,7 @@ int scanhash_scrypt_jane(int thr_id, struct work *work, uint32_t max_nonce, unsi
|
||||
gettimeofday(tv_end, NULL);
|
||||
return 1;
|
||||
} else {
|
||||
applog(LOG_WARNING, "GPU #%d: %s result does not validate on CPU! (i=%d, s=%d)",
|
||||
device_map[thr_id], device_name[thr_id], i, cur);
|
||||
gpulog(LOG_WARNING, thr_id, "result does not validate on CPU! (i=%d, s=%d)", i, cur);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -932,8 +932,7 @@ int scanhash_scrypt(int thr_id, struct work *work, uint32_t max_nonce, unsigned
|
||||
}
|
||||
|
||||
if (!good) {
|
||||
applog(LOG_WARNING, "GPU #%d: %s result does not validate on CPU! (i=%d, s=%d)",
|
||||
device_map[thr_id], device_name[thr_id], i, cur);
|
||||
gpulog(LOG_WARNING, thr_id, "result does not validate on CPU! (i=%d, s=%d)", i, cur);
|
||||
} else {
|
||||
*hashes_done = n - pdata[19];
|
||||
work_set_target_ratio(work, refhash);
|
||||
|
Loading…
Reference in New Issue
Block a user