mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-31 08:54:19 +00:00
GPUs cannot be hotplugged
This commit is contained in:
parent
7f0451336b
commit
7507790880
@ -668,7 +668,7 @@ char *set_rawintensity(const char *_arg)
|
|||||||
void print_ndevs(int *ndevs)
|
void print_ndevs(int *ndevs)
|
||||||
{
|
{
|
||||||
opt_log_output = true;
|
opt_log_output = true;
|
||||||
opencl_drv.drv_detect(false);
|
opencl_drv.drv_detect();
|
||||||
clear_adl(*ndevs);
|
clear_adl(*ndevs);
|
||||||
applog(LOG_INFO, "%i GPU devices max detected", *ndevs);
|
applog(LOG_INFO, "%i GPU devices max detected", *ndevs);
|
||||||
}
|
}
|
||||||
@ -1129,7 +1129,7 @@ out:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void opencl_detect(bool hotplug)
|
static void opencl_detect(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
2
miner.h
2
miner.h
@ -382,7 +382,7 @@ struct device_drv {
|
|||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
// DRV-global functions
|
// DRV-global functions
|
||||||
void (*drv_detect)(bool);
|
void (*drv_detect)(void);
|
||||||
|
|
||||||
// Device-specific functions
|
// Device-specific functions
|
||||||
void (*reinit_device)(struct cgpu_info *);
|
void (*reinit_device)(struct cgpu_info *);
|
||||||
|
@ -7934,7 +7934,7 @@ static void noop_thread_enable(struct thr_info __maybe_unused *thr)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void noop_detect(bool __maybe_unused hotplug)
|
static void noop_detect(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#define noop_flush_work noop_reinit_device
|
#define noop_flush_work noop_reinit_device
|
||||||
@ -8192,7 +8192,6 @@ static void *restart_mining_threads_thread(void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define DRIVER_FILL_DEVICE_DRV(X) fill_device_drv(&X##_drv);
|
#define DRIVER_FILL_DEVICE_DRV(X) fill_device_drv(&X##_drv);
|
||||||
#define DRIVER_DRV_DETECT_ALL(X) X##_drv.drv_detect(false);
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -8370,7 +8369,7 @@ int main(int argc, char *argv[])
|
|||||||
DRIVER_PARSE_COMMANDS(DRIVER_FILL_DEVICE_DRV)
|
DRIVER_PARSE_COMMANDS(DRIVER_FILL_DEVICE_DRV)
|
||||||
|
|
||||||
// this will set total_devices
|
// this will set total_devices
|
||||||
opencl_drv.drv_detect(false);
|
opencl_drv.drv_detect();
|
||||||
|
|
||||||
if (opt_display_devs) {
|
if (opt_display_devs) {
|
||||||
applog(LOG_ERR, "Devices detected:");
|
applog(LOG_ERR, "Devices detected:");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user