out_fp = stdout;
}
+
lock_file (out_fp);
}
else
#ifdef HAVE_HWMON
uint hwmon_check = 0;
+ int slowdown_warnings = 0;
+
// these variables are mainly used for fan control (AMD only)
int *fan_speed_chgd = (int *) mycalloc (data.devices_cnt, sizeof (int));
if (data.devices_status != STATUS_RUNNING) continue;
-
#ifdef HAVE_HWMON
+
+ if (1)
+ {
+ hc_thread_mutex_lock (mux_adl);
+
+ for (uint device_id = 0; device_id < data.devices_cnt; device_id++)
+ {
+ hc_device_param_t *device_param = &data.devices_param[device_id];
+
+ if (device_param->skipped) continue;
+
+ if ((data.devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue;
+
+ const int temperature = hm_get_temperature_with_device_id (device_id);
+
+ const int threshold = data.hm_device[device_id].gpu_temp_threshold_slowdown;
+
+ if (temperature >= threshold)
+ {
+ if (slowdown_warnings < 3)
+ {
+ if (data.quiet == 0) clear_prompt ();
+
+ log_info ("WARNING: Drivers temperature threshold (%dc) hit on GPU #%d, expect performance to drop...", threshold, device_id + 1);
+
+ if (slowdown_warnings == 2)
+ {
+ log_info ("");
+ }
+
+ if (data.quiet == 0) fprintf (stdout, "%s", PROMPT);
+ if (data.quiet == 0) fflush (stdout);
+
+ slowdown_warnings++;
+ }
+ }
+ else
+ {
+ slowdown_warnings = 0;
+ }
+ }
+
+ hc_thread_mutex_unlock (mux_adl);
+ }
+
if (hwmon_check == 1)
{
hc_thread_mutex_lock (mux_adl);
*/
#ifdef _WIN
-void SetConsoleWindowSize (const int x, const int y)
+void SetConsoleWindowSize (const int x)
{
HANDLE h = GetStdHandle (STD_OUTPUT_HANDLE);
SMALL_RECT *sr = &bufferInfo.srWindow;
- sr->Left = 0;
- sr->Top = 0;
- sr->Right = MAX (sr->Right, x - 1);
- sr->Bottom = MAX (sr->Bottom, y - 1);
+ sr->Right = MAX (sr->Right, x - 1);
COORD co;
co.X = sr->Right + 1;
co.Y = sr->Bottom + 1;
- co.Y = MAX (co.Y, 1337);
-
if (!SetConsoleScreenBufferSize (h, co)) return;
if (!SetConsoleWindowInfo (h, TRUE, sr)) return;
int main (int argc, char **argv)
{
#ifdef _WIN
- SetConsoleWindowSize (132, 44);
+ SetConsoleWindowSize (132);
#endif
/**
potfile_disable = 1;
weak_hash_threshold = 0;
gpu_temp_disable = 1;
+
+ #ifdef HAVE_HWMON
+ #ifdef HAVE_ADL
powertune_enable = 1;
+ #endif
+ #endif
data.status_timer = status_timer;
data.restore_timer = restore_timer;
{
if (device_param->skipped == 0)
{
- log_info ("Device #%u: %s, %lu/%lu MB allocatable, %dMhz, %uMCU",
+ log_info ("Device #%u: %s, %lu/%lu MB allocatable, %uMCU",
device_id + 1,
device_name,
(unsigned int) (device_maxmem_alloc / 1024 / 1024),
(unsigned int) (device_global_mem / 1024 / 1024),
- (unsigned int) (device_maxclock_frequency),
(unsigned int) device_processors);
}
else
#ifdef HAVE_HWMON
#if defined(HAVE_NVML) || defined(HAVE_NVAPI)
- hm_attrs_t hm_adapters_nv[DEVICES_MAX] = { { { 0 }, 0, 0 } };
+ hm_attrs_t hm_adapters_nv[DEVICES_MAX] = { { { 0 }, 0, 0, 0, 0 } };
#endif
#ifdef HAVE_ADL
- hm_attrs_t hm_adapters_amd[DEVICES_MAX] = { { { 0 }, 0, 0 } };
+ hm_attrs_t hm_adapters_amd[DEVICES_MAX] = { { { 0 }, 0, 0, 0, 0 } };
#endif
if (gpu_temp_disable == 0)
}
}
- /*
- * Temporary fix:
- * with AMD r9 295x cards it seems that we need to set the powertune value just AFTER the ocl init stuff
- * otherwise after hc_clCreateContext () etc, powertune value was set back to "normal" and cards unfortunately
- * were not working @ full speed (setting hm_ADL_Overdrive_PowerControl_Set () here seems to fix the problem)
- * Driver / ADL bug?
- */
+ /**
+ * Temporary fix:
+ * with AMD r9 295x cards it seems that we need to set the powertune value just AFTER the ocl init stuff
+ * otherwise after hc_clCreateContext () etc, powertune value was set back to "normal" and cards unfortunately
+ * were not working @ full speed (setting hm_ADL_Overdrive_PowerControl_Set () here seems to fix the problem)
+ * Driver / ADL bug?
+ */
#ifdef HAVE_ADL
if (powertune_enable == 1)
run_kernel_bzero (device_param, device_param->d_markov_css_buf, size_markov_css);
}
+ /**
+ * Store thermal target temperature so we can send a notice to user
+ */
+
+ #if defined(HAVE_HWMON)
+ if (gpu_temp_disable == 0)
+ {
+ const int gpu_temp_threshold_slowdown = hm_get_threshold_slowdown_with_device_id (device_id);
+
+ data.hm_device[device_id].gpu_temp_threshold_slowdown = (gpu_temp_threshold_slowdown == -1) ? 100000 : gpu_temp_threshold_slowdown;
+ }
+ #endif
+
/**
* Store initial fanspeed if gpu_temp_retain is enabled
*/