Browse Source

Merge remote-tracking branch 'conman/master'

nfactor-troky
Kano 13 years ago
parent
commit
280588c1af
  1. 31
      adl.c
  2. 1
      adl.h
  3. 6
      main.c
  4. 2
      util.c

31
adl.c

@ -21,6 +21,7 @@
#include "adl_functions.h" #include "adl_functions.h"
bool adl_active; bool adl_active;
bool opt_reorder = false;
int opt_hysteresis = 3; int opt_hysteresis = 3;
const int opt_targettemp = 75; const int opt_targettemp = 75;
@ -268,21 +269,25 @@ void init_adl(int nDevs)
* ordering the GPUs according to ascending order fixes it. Linux * ordering the GPUs according to ascending order fixes it. Linux
* has usually sequential but decreasing order instead! */ * has usually sequential but decreasing order instead! */
for (i = 0; i < devices; i++) { for (i = 0; i < devices; i++) {
int j, virtual_gpu = 0; int j, virtual_gpu;
for (j = 0; j < devices; j++) { if (opt_reorder) {
if (i == j) virtual_gpu = 0;
continue; for (j = 0; j < devices; j++) {
if (i == j)
continue;
#ifdef WIN32 #ifdef WIN32
if (adapters[j].iBusNumber < adapters[i].iBusNumber) if (adapters[j].iBusNumber < adapters[i].iBusNumber)
#else #else
if (adapters[j].iBusNumber > adapters[i].iBusNumber) if (adapters[j].iBusNumber > adapters[i].iBusNumber)
#endif #endif
virtual_gpu++; virtual_gpu++;
} }
if (virtual_gpu != i) if (virtual_gpu != i)
applog(LOG_INFO, "Mapping device %d to GPU %d according to Bus Number order", applog(LOG_INFO, "Mapping device %d to GPU %d according to Bus Number order",
i, virtual_gpu); i, virtual_gpu);
} else
virtual_gpu = i;
vadapters[virtual_gpu].virtual_gpu = i; vadapters[virtual_gpu].virtual_gpu = i;
vadapters[virtual_gpu].id = adapters[i].id; vadapters[virtual_gpu].id = adapters[i].id;
} }
@ -293,6 +298,10 @@ void init_adl(int nDevs)
} }
applog(LOG_ERR, "WARNING: Number of OpenCL and ADL devices does not match!"); applog(LOG_ERR, "WARNING: Number of OpenCL and ADL devices does not match!");
applog(LOG_ERR, "Hardware monitoring may NOT match up with devices!"); applog(LOG_ERR, "Hardware monitoring may NOT match up with devices!");
for (i = 0; i < devices; i++) {
vadapters[i].virtual_gpu = i;
vadapters[i].id = adapters[i].id;
}
} }
for (gpu = 0; gpu < devices; gpu++) { for (gpu = 0; gpu < devices; gpu++) {

1
adl.h

@ -2,6 +2,7 @@
#define __ADL_H__ #define __ADL_H__
#ifdef HAVE_ADL #ifdef HAVE_ADL
bool adl_active; bool adl_active;
bool opt_reorder;
int opt_hysteresis; int opt_hysteresis;
const int opt_targettemp; const int opt_targettemp;
const int opt_overheattemp; const int opt_overheattemp;

6
main.c

@ -1564,6 +1564,11 @@ static struct opt_table opt_config_table[] = {
OPT_WITHOUT_ARG("--disable-gpu|-G", OPT_WITHOUT_ARG("--disable-gpu|-G",
opt_set_bool, &opt_nogpu, opt_set_bool, &opt_nogpu,
"Disable GPU mining even if suitable devices exist"), "Disable GPU mining even if suitable devices exist"),
#ifdef HAVE_ADL
OPT_WITHOUT_ARG("--dev-reorder",
opt_set_bool, &opt_reorder,
"Attempt to reorder GPU devices according to PCI Bus ID"),
#endif
#endif #endif
OPT_WITH_ARG("--donation", OPT_WITH_ARG("--donation",
set_float_0_to_99, &opt_show_floatval, &opt_donation, set_float_0_to_99, &opt_show_floatval, &opt_donation,
@ -1846,6 +1851,7 @@ static char *print_ndevs_and_exit(int *ndevs)
{ {
opt_log_output = true; opt_log_output = true;
opencl_api.api_detect(); opencl_api.api_detect();
clear_adl(*ndevs);
applog(LOG_INFO, "%i GPU devices detected", *ndevs); applog(LOG_INFO, "%i GPU devices detected", *ndevs);
exit(*ndevs); exit(*ndevs);
} }

2
util.c

@ -373,7 +373,7 @@ json_t *json_rpc_call(CURL *curl, const char *url,
headers = curl_slist_append(headers, headers = curl_slist_append(headers,
"Content-type: application/json"); "Content-type: application/json");
headers = curl_slist_append(headers, headers = curl_slist_append(headers,
"X-Mining-Extensions: longpoll midstate rollntime"); "X-Mining-Extensions: longpoll rollntime");
headers = curl_slist_append(headers, len_hdr); headers = curl_slist_append(headers, len_hdr);
headers = curl_slist_append(headers, user_agent_hdr); headers = curl_slist_append(headers, user_agent_hdr);
headers = curl_slist_append(headers, "Expect:"); /* disable Expect hdr*/ headers = curl_slist_append(headers, "Expect:"); /* disable Expect hdr*/

Loading…
Cancel
Save