mirror of
https://github.com/GOSTSec/sgminer
synced 2025-08-30 15:51:56 +00:00
CGPU API for device names
This commit is contained in:
parent
303dbf4664
commit
f05a319e01
3
adl.c
3
adl.c
@ -340,6 +340,9 @@ void init_adl(int nDevs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
applog(LOG_INFO, "GPU %d %s hardware monitoring enabled", gpu, lpInfo[i].strAdapterName);
|
applog(LOG_INFO, "GPU %d %s hardware monitoring enabled", gpu, lpInfo[i].strAdapterName);
|
||||||
|
if (gpus[gpu].name)
|
||||||
|
free(gpus[gpu].name);
|
||||||
|
gpus[gpu].name = lpInfo[i].strAdapterName;
|
||||||
gpus[gpu].has_adl = true;
|
gpus[gpu].has_adl = true;
|
||||||
/* Flag adl as active if any card is successfully activated */
|
/* Flag adl as active if any card is successfully activated */
|
||||||
adl_active = true;
|
adl_active = true;
|
||||||
|
@ -4455,7 +4455,11 @@ int main (int argc, char *argv[])
|
|||||||
if (devices_enabled == -1) {
|
if (devices_enabled == -1) {
|
||||||
applog(LOG_ERR, "Devices detected:");
|
applog(LOG_ERR, "Devices detected:");
|
||||||
for (i = 0; i < total_devices; ++i) {
|
for (i = 0; i < total_devices; ++i) {
|
||||||
applog(LOG_ERR, " %2d. %s%d (driver: %s)", i, devices[i]->api->name, devices[i]->device_id, devices[i]->api->dname);
|
struct cgpu_info *cgpu = devices[i];
|
||||||
|
if (cgpu->name)
|
||||||
|
applog(LOG_ERR, " %2d. %s %d: %s (driver: %s)", i, cgpu->api->name, cgpu->device_id, cgpu->name, cgpu->api->dname);
|
||||||
|
else
|
||||||
|
applog(LOG_ERR, " %2d. %s %d (driver: %s)", i, cgpu->api->name, cgpu->device_id, cgpu->api->dname);
|
||||||
}
|
}
|
||||||
quit(0, "%d devices listed", total_devices);
|
quit(0, "%d devices listed", total_devices);
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,7 @@ static void BFwrite(int fd, const void *buf, ssize_t bufLen)
|
|||||||
|
|
||||||
static bool bitforce_detect_one(const char *devpath)
|
static bool bitforce_detect_one(const char *devpath)
|
||||||
{
|
{
|
||||||
|
char *s;
|
||||||
char pdevbuf[0x100];
|
char pdevbuf[0x100];
|
||||||
|
|
||||||
if (total_devices == MAX_DEVICES)
|
if (total_devices == MAX_DEVICES)
|
||||||
@ -120,6 +121,12 @@ static bool bitforce_detect_one(const char *devpath)
|
|||||||
bitforce->device_path = strdup(devpath);
|
bitforce->device_path = strdup(devpath);
|
||||||
bitforce->deven = DEV_ENABLED;
|
bitforce->deven = DEV_ENABLED;
|
||||||
bitforce->threads = 1;
|
bitforce->threads = 1;
|
||||||
|
if (likely((!memcmp(pdevbuf, ">>>ID: ", 7)) && (s = strstr(pdevbuf + 3, ">>>"))))
|
||||||
|
{
|
||||||
|
s[0] = '\0';
|
||||||
|
bitforce->name = strdup(pdevbuf + 7);
|
||||||
|
}
|
||||||
|
|
||||||
return add_cgpu(bitforce);
|
return add_cgpu(bitforce);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1188,6 +1188,8 @@ static bool opencl_thread_prepare(struct thr_info *thr)
|
|||||||
cgpu->status = LIFE_NOSTART;
|
cgpu->status = LIFE_NOSTART;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (name && !cgpu->name)
|
||||||
|
cgpu->name = strdup(name);
|
||||||
applog(LOG_INFO, "initCl() finished. Found %s", name);
|
applog(LOG_INFO, "initCl() finished. Found %s", name);
|
||||||
gettimeofday(&now, NULL);
|
gettimeofday(&now, NULL);
|
||||||
get_datestamp(cgpu->init, &now);
|
get_datestamp(cgpu->init, &now);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user