From b864fa5ba74d9b1e9dafb1d6ee4bbfea6d954ce0 Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 1 Dec 2017 15:19:10 +0100 Subject: [PATCH] Removed option --gpu-temp-retain that tried to retain GPU temperature at X degrees celsius, please use driver specific tools Removed option --powertune-enable to enable power tuning, please use driver specific tools --- docs/changes.txt | 7 + extra/tab_completion/hashcat.sh | 6 +- include/ext_ADL.h | 39 - include/ext_nvapi.h | 16 - include/ext_nvml.h | 10 - include/ext_xnvctrl.h | 97 -- include/hwmon.h | 4 - include/types.h | 114 +- src/Makefile | 2 +- src/ext_xnvctrl.c | 10 - src/hwmon.c | 1869 +------------------------------ src/main.c | 9 - src/monitor.c | 113 +- src/opencl.c | 31 +- src/usage.c | 2 - src/user_options.c | 25 - 16 files changed, 88 insertions(+), 2266 deletions(-) delete mode 100644 include/ext_xnvctrl.h delete mode 100644 src/ext_xnvctrl.c diff --git a/docs/changes.txt b/docs/changes.txt index 604cfb58e..d71a1bb69 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,5 +1,12 @@ * changes v4.0.1 -> xxx: +## +## Features +## + +- Removed option --gpu-temp-retain that tried to retain GPU temperature at X degrees celsius, please use driver specific tools +- Removed option --powertune-enable to enable power tuning, please use driver specific tools + ## ## Algorithms ## diff --git a/extra/tab_completion/hashcat.sh b/extra/tab_completion/hashcat.sh index 8642851ef..e8417c238 100644 --- a/extra/tab_completion/hashcat.sh +++ b/extra/tab_completion/hashcat.sh @@ -189,8 +189,8 @@ _hashcat () local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s ?h ?H' local SHORT_OPTS="-m -a -V -v -h -b -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -i -I -s -l -O" - local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-disable --gpu-temp-abort --gpu-temp-retain --powertune-enable --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable" - local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --markov-hcstat --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-abort --gpu-temp-retain --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment-min --increment-max --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to" + local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --machine-readable --loopback --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --opencl-info --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-disable --gpu-temp-abort --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable" + local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --markov-hcstat --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platforms --opencl-device-types --opencl-vector-width --workload-profile --kernel-accel --kernel-loops --nvidia-spin-damp --gpu-temp-abort --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment-min --increment-max --scrypt-tmto --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to" COMPREPLY=() local cur="${COMP_WORDS[COMP_CWORD]}" @@ -361,7 +361,7 @@ _hashcat () -t|-p|-c|-j|-k|-g| \ --status-timer|--markov-threshold|--runtime|--session|--separator|--segment-size|--rule-left|--rule-right| \ - --nvidia-spin-damp|--gpu-temp-abort|--gpu-temp-retain|--generate-rules|--generate-rules-func-min|--generate-rules-func-max| \ + --nvidia-spin-damp|--gpu-temp-abort|--generate-rules|--generate-rules-func-min|--generate-rules-func-max| \ --increment-min|--increment-max|--remove-timer|--bitmap-min|--bitmap-max|--skip|--limit|--generate-rules-seed| \ --outfile-check-timer|--outfile-check-dir|--induction-dir|--scrypt-tmto|--encoding-from|--encoding-to|--optimized-kernel-enable|--self-test-disable) return 0 diff --git a/include/ext_ADL.h b/include/ext_ADL.h index 0f3469cd6..4d6898cd8 100644 --- a/include/ext_ADL.h +++ b/include/ext_ADL.h @@ -23,15 +23,9 @@ #define ADL_MAX_PATH 256 -#define ADL_DL_FANCTRL_SUPPORTS_PERCENT_READ 1 -#define ADL_DL_FANCTRL_SUPPORTS_PERCENT_WRITE 2 #define ADL_DL_FANCTRL_SPEED_TYPE_PERCENT 1 #define ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED 1 -#define ADL_OD6_SETSTATE_PERFORMANCE 0x00000001 -#define ADL_OD6_GETSTATEINFO_CUSTOM_PERFORMANCE 0x00000004 -#define ADL_OD6_FANSPEED_TYPE_PERCENT 0x00000001 - typedef struct AdapterInfo { int iSize; @@ -241,15 +235,6 @@ typedef struct ADLOD6StateInfo ADLOD6PerformanceLevel aLevels [2]; } ADLOD6StateInfo; -typedef struct ADLOD6PowerControlInfo -{ - int iMinValue; - int iMaxValue; - int iStepValue; - int iExtValue; - int iExtMask; -} ADLOD6PowerControlInfo; - #if defined (__MSC_VER) #define ADL_API_CALL __cdecl #elif defined (_WIN32) || defined (__WIN32__) @@ -287,26 +272,15 @@ typedef int (ADL_API_CALL *ADL_ADAPTER_VIDEOBIOSINFO_GET) (int, ADLBiosInfo *); typedef int (ADL_API_CALL *ADL_OVERDRIVE5_FANSPEEDINFO_GET) (int, int, ADLFanSpeedInfo *); typedef int (ADL_API_CALL *ADL_OVERDRIVE5_FANSPEED_GET) (int, int, ADLFanSpeedValue *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_FANSPEED_GET) (int, ADLOD6FanSpeedInfo *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE5_FANSPEED_SET) (int, int, ADLFanSpeedValue *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_FANSPEED_SET) (int, ADLOD6FanSpeedValue *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE5_FANSPEEDTODEFAULT_SET) (int, int); typedef int (ADL_API_CALL *ADL_OVERDRIVE5_ODPARAMETERS_GET) (int, ADLODParameters *); typedef int (ADL_API_CALL *ADL_OVERDRIVE5_ODPERFORMANCELEVELS_GET) (int, int, ADLODPerformanceLevels *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE5_ODPERFORMANCELEVELS_SET) (int, ADLODPerformanceLevels *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROL_SET) (int, int); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROL_GET) (int, int *, int *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROLINFO_GET) (int, ADLOD6PowerControlInfo *); typedef int (ADL_API_CALL *ADL_ADAPTER_ACTIVE_GET) (int, int *); -typedef int (ADL_API_CALL *ADL_DISPLAYENABLE_SET) (int, int *, int, int); typedef int (ADL_API_CALL *ADL_OVERDRIVE_CAPS) (int, int *, int *, int *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_CURRENTSTATUS_GET) (int, ADLOD6CurrentStatus *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_STATEINFO_GET) (int, int, ADLOD6MemClockState *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_CAPABILITIES_GET) (int, ADLOD6Capabilities *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_STATE_SET) (int, int, ADLOD6StateInfo *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_POWERCONTROL_CAPS) (int, int *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET) (int, int *, int *); typedef int (ADL_API_CALL *ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET) (int, ADLOD6ParameterRange *); -typedef int (ADL_API_CALL *ADL_OVERDRIVE6_FANSPEED_RESET) (int); #if defined (_POSIX) typedef void *ADL_LIB; @@ -332,26 +306,13 @@ typedef struct hm_adl_lib ADL_OVERDRIVE5_FANSPEEDINFO_GET ADL_Overdrive5_FanSpeedInfo_Get; ADL_OVERDRIVE5_FANSPEED_GET ADL_Overdrive5_FanSpeed_Get; ADL_OVERDRIVE6_FANSPEED_GET ADL_Overdrive6_FanSpeed_Get; - ADL_OVERDRIVE5_FANSPEED_SET ADL_Overdrive5_FanSpeed_Set; - ADL_OVERDRIVE6_FANSPEED_SET ADL_Overdrive6_FanSpeed_Set; - ADL_OVERDRIVE5_FANSPEEDTODEFAULT_SET ADL_Overdrive5_FanSpeedToDefault_Set; - ADL_OVERDRIVE5_ODPARAMETERS_GET ADL_Overdrive5_ODParameters_Get; - ADL_OVERDRIVE5_ODPERFORMANCELEVELS_GET ADL_Overdrive5_ODPerformanceLevels_Get; - ADL_OVERDRIVE5_ODPERFORMANCELEVELS_SET ADL_Overdrive5_ODPerformanceLevels_Set; - ADL_OVERDRIVE6_POWERCONTROLINFO_GET ADL_Overdrive6_PowerControlInfo_Get; - ADL_OVERDRIVE6_POWERCONTROL_GET ADL_Overdrive6_PowerControl_Get; - ADL_OVERDRIVE6_POWERCONTROL_SET ADL_Overdrive6_PowerControl_Set; ADL_ADAPTER_ACTIVE_GET ADL_Adapter_Active_Get; - ADL_DISPLAYENABLE_SET ADL_DisplayEnable_Set; ADL_OVERDRIVE_CAPS ADL_Overdrive_Caps; - ADL_OVERDRIVE6_POWERCONTROL_CAPS ADL_Overdrive6_PowerControl_Caps; ADL_OVERDRIVE6_CAPABILITIES_GET ADL_Overdrive6_Capabilities_Get; ADL_OVERDRIVE6_STATEINFO_GET ADL_Overdrive6_StateInfo_Get; ADL_OVERDRIVE6_CURRENTSTATUS_GET ADL_Overdrive6_CurrentStatus_Get; - ADL_OVERDRIVE6_STATE_SET ADL_Overdrive6_State_Set; ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET ADL_Overdrive6_TargetTemperatureData_Get; ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET ADL_Overdrive6_TargetTemperatureRangeInfo_Get; - ADL_OVERDRIVE6_FANSPEED_RESET ADL_Overdrive6_FanSpeed_Reset; } hm_adl_lib_t; diff --git a/include/ext_nvapi.h b/include/ext_nvapi.h index 39654ed52..e3df0cffa 100644 --- a/include/ext_nvapi.h +++ b/include/ext_nvapi.h @@ -30,9 +30,6 @@ typedef char NvAPI_ShortString[NVAPI_SHORT_STRING_MAX]; #define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16)) #define NVAPI_MAX_PHYSICAL_GPUS 64 -#define NVAPI_MAX_COOLER_PER_GPU 20 - -#define GPU_COOLER_LEVELS_VER 0x10000 typedef enum _NvAPI_Status { @@ -192,13 +189,6 @@ typedef struct struct_NvLevel } NvLevel; -typedef struct struct_NV_GPU_COOLER_LEVELS -{ - NvU32 Version; - NvLevel Levels[NVAPI_MAX_COOLER_PER_GPU]; - -} NV_GPU_COOLER_LEVELS; - NVAPI_INTERFACE NvAPI_QueryInterface (unsigned int offset); NVAPI_INTERFACE NvAPI_Initialize (void); NVAPI_INTERFACE NvAPI_Unload (void); @@ -206,8 +196,6 @@ NVAPI_INTERFACE NvAPI_GetErrorMessage (NvAPI_Status nr,NvAPI_ShortString szDesc) NVAPI_INTERFACE NvAPI_EnumPhysicalGPUs (NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount); NVAPI_INTERFACE NvAPI_GPU_GetPerfPoliciesInfo (NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 *perfPolicies_info); NVAPI_INTERFACE NvAPI_GPU_GetPerfPoliciesStatus (NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *perfPolicies_status); -NVAPI_INTERFACE NvAPI_GPU_SetCoolerLevels (NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex, NV_GPU_COOLER_LEVELS *pCoolerLevels); -NVAPI_INTERFACE NvAPI_GPU_RestoreCoolerSettings (NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex); NVAPI_INTERFACE NvAPI_GPU_GetBusId (NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId); NVAPI_INTERFACE NvAPI_GPU_GetBusSlotId (NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId); @@ -230,8 +218,6 @@ typedef int (*NVAPI_API_CALL NVAPI_GETERRORMESSAGE) (NvAPI_Status, NvAPI_ShortSt typedef int (*NVAPI_API_CALL NVAPI_ENUMPHYSICALGPUS) (NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *); typedef int (*NVAPI_API_CALL NVAPI_GPU_GETPERFPOLICIESINFO) (NvPhysicalGpuHandle, NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 *); typedef int (*NVAPI_API_CALL NVAPI_GPU_GETPERFPOLICIESSTATUS) (NvPhysicalGpuHandle, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *); -typedef int (*NVAPI_API_CALL NVAPI_GPU_SETCOOLERLEVELS) (NvPhysicalGpuHandle, NvU32, NV_GPU_COOLER_LEVELS *); -typedef int (*NVAPI_API_CALL NVAPI_GPU_RESTORECOOLERSETTINGS) (NvPhysicalGpuHandle, NvU32); typedef int (*NVAPI_API_CALL NVAPI_GPU_GETBUSID) (NvPhysicalGpuHandle, NvU32 *); typedef int (*NVAPI_API_CALL NVAPI_GPU_GETBUSSLOTID) (NvPhysicalGpuHandle, NvU32 *); @@ -252,8 +238,6 @@ typedef struct hm_nvapi_lib NVAPI_ENUMPHYSICALGPUS NvAPI_EnumPhysicalGPUs; NVAPI_GPU_GETPERFPOLICIESINFO NvAPI_GPU_GetPerfPoliciesInfo; NVAPI_GPU_GETPERFPOLICIESSTATUS NvAPI_GPU_GetPerfPoliciesStatus; - NVAPI_GPU_SETCOOLERLEVELS NvAPI_GPU_SetCoolerLevels; - NVAPI_GPU_RESTORECOOLERSETTINGS NvAPI_GPU_RestoreCoolerSettings; NVAPI_GPU_GETBUSID NvAPI_GPU_GetBusId; NVAPI_GPU_GETBUSSLOTID NvAPI_GPU_GetBusSlotId; diff --git a/include/ext_nvml.h b/include/ext_nvml.h index 915fe34d8..b951caacb 100644 --- a/include/ext_nvml.h +++ b/include/ext_nvml.h @@ -181,7 +181,6 @@ typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_NAME) (nvmlDevice_t, char * typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_HANDLE_BY_INDEX) (unsigned int, nvmlDevice_t *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_TEMPERATURE) (nvmlDevice_t, nvmlTemperatureSensors_t, unsigned int *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_FAN_SPEED) (nvmlDevice_t, unsigned int *); -typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_POWER_USAGE) (nvmlDevice_t, unsigned int *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_UTILIZATION_RATES) (nvmlDevice_t, nvmlUtilization_t *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_CLOCKINFO) (nvmlDevice_t, nvmlClockType_t, unsigned int *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_THRESHOLD) (nvmlDevice_t, nvmlTemperatureThresholds_t, unsigned int *); @@ -191,9 +190,6 @@ typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_CURRENTCLOCKSTHROTTLEREASON typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_SUPPORTEDCLOCKSTHROTTLEREASONS) (nvmlDevice_t, unsigned long long *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_SET_COMPUTEMODE) (nvmlDevice_t, nvmlComputeMode_t); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_SET_OPERATIONMODE) (nvmlDevice_t, nvmlGpuOperationMode_t); -typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_POWERMANAGEMENTLIMITCONSTRAINTS) (nvmlDevice_t, unsigned int *, unsigned int *); -typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_SET_POWERMANAGEMENTLIMIT) (nvmlDevice_t, unsigned int); -typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_POWERMANAGEMENTLIMIT) (nvmlDevice_t, unsigned int *); typedef nvmlReturn_t (*NVML_API_CALL NVML_DEVICE_GET_PCIINFO) (nvmlDevice_t, nvmlPciInfo_t *); #if defined (_POSIX) @@ -214,7 +210,6 @@ typedef struct hm_nvml_lib NVML_DEVICE_GET_HANDLE_BY_INDEX nvmlDeviceGetHandleByIndex; NVML_DEVICE_GET_TEMPERATURE nvmlDeviceGetTemperature; NVML_DEVICE_GET_FAN_SPEED nvmlDeviceGetFanSpeed; - NVML_DEVICE_GET_POWER_USAGE nvmlDeviceGetPowerUsage; NVML_DEVICE_GET_UTILIZATION_RATES nvmlDeviceGetUtilizationRates; NVML_DEVICE_GET_CLOCKINFO nvmlDeviceGetClockInfo; NVML_DEVICE_GET_THRESHOLD nvmlDeviceGetTemperatureThreshold; @@ -222,11 +217,6 @@ typedef struct hm_nvml_lib NVML_DEVICE_GET_CURRPCIELINKWIDTH nvmlDeviceGetCurrPcieLinkWidth; NVML_DEVICE_GET_CURRENTCLOCKSTHROTTLEREASONS nvmlDeviceGetCurrentClocksThrottleReasons; NVML_DEVICE_GET_SUPPORTEDCLOCKSTHROTTLEREASONS nvmlDeviceGetSupportedClocksThrottleReasons; - NVML_DEVICE_SET_COMPUTEMODE nvmlDeviceSetComputeMode; - NVML_DEVICE_SET_OPERATIONMODE nvmlDeviceSetGpuOperationMode; - NVML_DEVICE_GET_POWERMANAGEMENTLIMITCONSTRAINTS nvmlDeviceGetPowerManagementLimitConstraints; - NVML_DEVICE_SET_POWERMANAGEMENTLIMIT nvmlDeviceSetPowerManagementLimit; - NVML_DEVICE_GET_POWERMANAGEMENTLIMIT nvmlDeviceGetPowerManagementLimit; NVML_DEVICE_GET_PCIINFO nvmlDeviceGetPciInfo; } hm_nvml_lib_t; diff --git a/include/ext_xnvctrl.h b/include/ext_xnvctrl.h deleted file mode 100644 index b63a73bc1..000000000 --- a/include/ext_xnvctrl.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#ifndef _EXT_XNVCTRL_H -#define _EXT_XNVCTRL_H - -/** - * Stuff from X11/Xlib.h - */ - -typedef void *(*XOPENDISPLAY) (char *); -typedef int (*XCLOSEDISPLAY) (void *); - -/** - * Declarations from NVCtrl.h - */ - -#define NV_CTRL_TARGET_TYPE_GPU 1 -#define NV_CTRL_TARGET_TYPE_COOLER 5 /* e.g., fan */ - -#define NV_CTRL_GPU_COOLER_MANUAL_CONTROL 319 /* RW-G */ -#define NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE 0 -#define NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE 1 - -#define NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL 417 /* R--C */ -#define NV_CTRL_THERMAL_COOLER_LEVEL 320 /* RW-C */ - -/* - * NV_CTRL_PCI_BUS - Returns the PCI bus number the specified device is using. - */ - -#define NV_CTRL_PCI_BUS 239 /* R--GI */ - -/* - * NV_CTRL_PCI_DEVICE - Returns the PCI device number the specified device is - * using. - */ - -#define NV_CTRL_PCI_DEVICE 240 /* R--GI */ - -/* - * NV_CTRL_PCI_FUNCTION - Returns the PCI function number the specified device - * is using. - */ - -#define NV_CTRL_PCI_FUNCTION 241 /* R--GI */ - -/* - * NV_CTRL_GPU_CORE_THRESHOLD reflects the temperature at which the - * GPU is throttled to prevent overheating. - */ - -#define NV_CTRL_GPU_CORE_THRESHOLD 61 /* R--G */ - -/** - * hashcat stuff from here - */ - -typedef int HM_ADAPTER_XNVCTRL; - -#if defined(_WIN32) || defined(__WIN32__) -#define XNVCTRL_API_CALL __stdcall -#else -#define XNVCTRL_API_CALL -#endif - -typedef int (*XNVCTRL_API_CALL XNVCTRLQUERYTARGETCOUNT) (void *, int, int *); -typedef int (*XNVCTRL_API_CALL XNVCTRLQUERYTARGETATTRIBUTE) (void *, int, int, unsigned int, unsigned int, int *); -typedef void (*XNVCTRL_API_CALL XNVCTRLSETTARGETATTRIBUTE) (void *, int, int, unsigned int, unsigned int, int); - -#if defined (_POSIX) -typedef void *XNVCTRL_LIB; -#else -typedef HINSTANCE XNVCTRL_LIB; -#endif - -typedef struct hm_xnvctrl_lib -{ - void *dpy; - - XNVCTRL_LIB lib_x11; - XNVCTRL_LIB lib_xnvctrl; - - XOPENDISPLAY XOpenDisplay; - XCLOSEDISPLAY XCloseDisplay; - - XNVCTRLQUERYTARGETCOUNT XNVCTRLQueryTargetCount; - XNVCTRLQUERYTARGETATTRIBUTE XNVCTRLQueryTargetAttribute; - XNVCTRLSETTARGETATTRIBUTE XNVCTRLSetTargetAttribute; - -} hm_xnvctrl_lib_t; - -typedef hm_xnvctrl_lib_t XNVCTRL_PTR; - -#endif // _EXT_XNVCTRL_H diff --git a/include/hwmon.h b/include/hwmon.h index 18c99fd21..e3f64ec7d 100644 --- a/include/hwmon.h +++ b/include/hwmon.h @@ -21,10 +21,6 @@ int hm_get_utilization_with_device_id (hashcat_ctx_t *hashcat_ctx, const int hm_get_memoryspeed_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device_id); int hm_get_corespeed_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device_id); int hm_get_throttle_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device_id); -int hm_set_fanspeed_with_device_id_adl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed, const int fanpolicy); -int hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed, const int fanpolicy); -int hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed); -int hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed); int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx); void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx); diff --git a/include/types.h b/include/types.h index e1030f7e6..973fbdcff 100644 --- a/include/types.h +++ b/include/types.h @@ -527,7 +527,6 @@ typedef enum user_options_defaults FORCE = false, GPU_TEMP_ABORT = 90, GPU_TEMP_DISABLE = false, - GPU_TEMP_RETAIN = 75, HASH_MODE = 0, HCCAPX_MESSAGE_PAIR = 0, HEX_CHARSET = false, @@ -558,7 +557,6 @@ typedef enum user_options_defaults OUTFILE_FORMAT = 3, WORDLIST_AUTOHEX_DISABLE = false, POTFILE_DISABLE = false, - POWERTUNE_ENABLE = false, QUIET = false, REMOVE = false, REMOVE_TIMER = 60, @@ -608,77 +606,75 @@ typedef enum user_options_map IDX_FORCE = 0xff09, IDX_GPU_TEMP_ABORT = 0xff0a, IDX_GPU_TEMP_DISABLE = 0xff0b, - IDX_GPU_TEMP_RETAIN = 0xff0c, IDX_HASH_MODE = 'm', - IDX_HCCAPX_MESSAGE_PAIR = 0xff0d, + IDX_HCCAPX_MESSAGE_PAIR = 0xff0c, IDX_HELP = 'h', - IDX_HEX_CHARSET = 0xff0e, - IDX_HEX_SALT = 0xff0f, - IDX_HEX_WORDLIST = 0xff10, + IDX_HEX_CHARSET = 0xff0d, + IDX_HEX_SALT = 0xff0e, + IDX_HEX_WORDLIST = 0xff0f, IDX_INCREMENT = 'i', - IDX_INCREMENT_MAX = 0xff11, - IDX_INCREMENT_MIN = 0xff12, - IDX_INDUCTION_DIR = 0xff13, - IDX_KEEP_GUESSING = 0xff14, + IDX_INCREMENT_MAX = 0xff10, + IDX_INCREMENT_MIN = 0xff11, + IDX_INDUCTION_DIR = 0xff12, + IDX_KEEP_GUESSING = 0xff13, IDX_KERNEL_ACCEL = 'n', IDX_KERNEL_LOOPS = 'u', - IDX_KEYSPACE = 0xff15, - IDX_LEFT = 0xff16, + IDX_KEYSPACE = 0xff14, + IDX_LEFT = 0xff15, IDX_LIMIT = 'l', - IDX_LOGFILE_DISABLE = 0xff17, - IDX_LOOPBACK = 0xff18, - IDX_MACHINE_READABLE = 0xff19, - IDX_MARKOV_CLASSIC = 0xff1a, - IDX_MARKOV_DISABLE = 0xff1b, - IDX_MARKOV_HCSTAT = 0xff1c, + IDX_LOGFILE_DISABLE = 0xff16, + IDX_LOOPBACK = 0xff17, + IDX_MACHINE_READABLE = 0xff18, + IDX_MARKOV_CLASSIC = 0xff19, + IDX_MARKOV_DISABLE = 0xff1a, + IDX_MARKOV_HCSTAT = 0xff1b, IDX_MARKOV_THRESHOLD = 't', - IDX_NONCE_ERROR_CORRECTIONS = 0xff1d, - IDX_NVIDIA_SPIN_DAMP = 0xff1e, + IDX_NONCE_ERROR_CORRECTIONS = 0xff1c, + IDX_NVIDIA_SPIN_DAMP = 0xff1d, IDX_OPENCL_DEVICES = 'd', IDX_OPENCL_DEVICE_TYPES = 'D', IDX_OPENCL_INFO = 'I', - IDX_OPENCL_PLATFORMS = 0xff1f, - IDX_OPENCL_VECTOR_WIDTH = 0xff20, + IDX_OPENCL_PLATFORMS = 0xff1e, + IDX_OPENCL_VECTOR_WIDTH = 0xff1f, IDX_OPTIMIZED_KERNEL_ENABLE = 'O', - IDX_OUTFILE_AUTOHEX_DISABLE = 0xff21, - IDX_OUTFILE_CHECK_DIR = 0xff22, - IDX_OUTFILE_CHECK_TIMER = 0xff23, - IDX_OUTFILE_FORMAT = 0xff24, + IDX_OUTFILE_AUTOHEX_DISABLE = 0xff20, + IDX_OUTFILE_CHECK_DIR = 0xff21, + IDX_OUTFILE_CHECK_TIMER = 0xff22, + IDX_OUTFILE_FORMAT = 0xff23, IDX_OUTFILE = 'o', - IDX_WORDLIST_AUTOHEX_DISABLE = 0xff25, - IDX_POTFILE_DISABLE = 0xff26, - IDX_POTFILE_PATH = 0xff27, - IDX_POWERTUNE_ENABLE = 0xff28, - IDX_QUIET = 0xff29, - IDX_REMOVE = 0xff2a, - IDX_REMOVE_TIMER = 0xff2b, - IDX_RESTORE = 0xff2c, - IDX_RESTORE_DISABLE = 0xff2d, - IDX_RESTORE_FILE_PATH = 0xff2e, + IDX_WORDLIST_AUTOHEX_DISABLE = 0xff24, + IDX_POTFILE_DISABLE = 0xff25, + IDX_POTFILE_PATH = 0xff26, + IDX_QUIET = 0xff27, + IDX_REMOVE = 0xff28, + IDX_REMOVE_TIMER = 0xff29, + IDX_RESTORE = 0xff2a, + IDX_RESTORE_DISABLE = 0xff2b, + IDX_RESTORE_FILE_PATH = 0xff2c, IDX_RP_FILE = 'r', - IDX_RP_GEN_FUNC_MAX = 0xff2f, - IDX_RP_GEN_FUNC_MIN = 0xff30, + IDX_RP_GEN_FUNC_MAX = 0xff2d, + IDX_RP_GEN_FUNC_MIN = 0xff2e, IDX_RP_GEN = 'g', - IDX_RP_GEN_SEED = 0xff31, + IDX_RP_GEN_SEED = 0xff2f, IDX_RULE_BUF_L = 'j', IDX_RULE_BUF_R = 'k', - IDX_RUNTIME = 0xff32, - IDX_SCRYPT_TMTO = 0xff33, - IDX_SELF_TEST_DISABLE = 0xff34, + IDX_RUNTIME = 0xff30, + IDX_SCRYPT_TMTO = 0xff31, + IDX_SELF_TEST_DISABLE = 0xff32, IDX_SEGMENT_SIZE = 'c', IDX_SEPARATOR = 'p', - IDX_SESSION = 0xff35, - IDX_SHOW = 0xff36, + IDX_SESSION = 0xff33, + IDX_SHOW = 0xff34, IDX_SKIP = 's', - IDX_STATUS = 0xff37, - IDX_STATUS_TIMER = 0xff38, - IDX_STDOUT_FLAG = 0xff39, - IDX_SPEED_ONLY = 0xff3a, - IDX_PROGRESS_ONLY = 0xff3b, - IDX_TRUECRYPT_KEYFILES = 0xff3c, - IDX_USERNAME = 0xff3d, - IDX_VERACRYPT_KEYFILES = 0xff3e, - IDX_VERACRYPT_PIM = 0xff3f, + IDX_STATUS = 0xff35, + IDX_STATUS_TIMER = 0xff36, + IDX_STDOUT_FLAG = 0xff37, + IDX_SPEED_ONLY = 0xff38, + IDX_PROGRESS_ONLY = 0xff39, + IDX_TRUECRYPT_KEYFILES = 0xff3a, + IDX_USERNAME = 0xff3b, + IDX_VERACRYPT_KEYFILES = 0xff3c, + IDX_VERACRYPT_PIM = 0xff3d, IDX_VERSION_LOWER = 'v', IDX_VERSION = 'V', IDX_WORKLOAD_PROFILE = 'w' @@ -1158,7 +1154,6 @@ typedef struct opencl_ctx bool need_adl; bool need_nvml; bool need_nvapi; - bool need_xnvctrl; bool need_sysfs; int comptime; @@ -1170,7 +1165,6 @@ typedef struct opencl_ctx #include "ext_ADL.h" #include "ext_nvapi.h" #include "ext_nvml.h" -#include "ext_xnvctrl.h" #include "ext_sysfs.h" typedef struct hm_attrs @@ -1178,7 +1172,6 @@ typedef struct hm_attrs HM_ADAPTER_ADL adl; HM_ADAPTER_NVML nvml; HM_ADAPTER_NVAPI nvapi; - HM_ADAPTER_XNVCTRL xnvctrl; HM_ADAPTER_SYSFS sysfs; int od_version; @@ -1186,9 +1179,7 @@ typedef struct hm_attrs bool buslanes_get_supported; bool corespeed_get_supported; bool fanspeed_get_supported; - bool fanspeed_set_supported; bool fanpolicy_get_supported; - bool fanpolicy_set_supported; bool memoryspeed_get_supported; bool temperature_get_supported; bool threshold_shutdown_get_supported; @@ -1205,14 +1196,11 @@ typedef struct hwmon_ctx void *hm_adl; void *hm_nvml; void *hm_nvapi; - void *hm_xnvctrl; void *hm_sysfs; hm_attrs_t *hm_device; ADLOD6MemClockState *od_clock_mem_status; - int *od_power_control_status; - unsigned int *nvml_power_limit; } hwmon_ctx_t; @@ -1519,7 +1507,6 @@ typedef struct user_options bool outfile_autohex; bool wordlist_autohex_disable; bool potfile_disable; - bool powertune_enable; bool quiet; bool remove; bool restore; @@ -1562,7 +1549,6 @@ typedef struct user_options u32 bitmap_min; u32 debug_mode; u32 gpu_temp_abort; - u32 gpu_temp_retain; u32 hash_mode; u32 hccapx_message_pair; u32 increment_max; diff --git a/src/Makefile b/src/Makefile index 2f5ef2e2f..4da57cfba 100644 --- a/src/Makefile +++ b/src/Makefile @@ -281,7 +281,7 @@ LFLAGS_CROSS_WIN64 += -lpsapi ## Objects ## -OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_xnvctrl ext_lzma lzma_sdk/Alloc lzma_sdk/Lzma2Dec lzma_sdk/LzmaDec filehandling folder hashcat hashes hlfmt hwmon induct interface locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu rp_kernel_on_cpu rp_kernel_on_cpu_optimized selftest shared status stdout straight terminal thread timer tuningdb usage user_options wordlist +OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_lzma lzma_sdk/Alloc lzma_sdk/Lzma2Dec lzma_sdk/LzmaDec filehandling folder hashcat hashes hlfmt hwmon induct interface locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu rp_kernel_on_cpu rp_kernel_on_cpu_optimized selftest shared status stdout straight terminal thread timer tuningdb usage user_options wordlist NATIVE_STATIC_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).NATIVE.STATIC.o) NATIVE_SHARED_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).NATIVE.SHARED.o) diff --git a/src/ext_xnvctrl.c b/src/ext_xnvctrl.c deleted file mode 100644 index d3e06a904..000000000 --- a/src/ext_xnvctrl.c +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#include "common.h" -#include "types.h" -#include "event.h" -#include "memory.h" -#include "ext_xnvctrl.h" diff --git a/src/hwmon.c b/src/hwmon.c index 5f0082e98..4f94c3be5 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -188,114 +188,6 @@ static int hm_SYSFS_get_fan_speed_current (hashcat_ctx_t *hashcat_ctx, const int return 0; } -static int hm_SYSFS_set_fan_control (hashcat_ctx_t *hashcat_ctx, const int device_id, int val) -{ - char *syspath = hm_SYSFS_get_syspath_hwmon (hashcat_ctx, device_id); - - if (syspath == NULL) return -1; - - char *path; - - hc_asprintf (&path, "%s/pwm1_enable", syspath); - - hcfree (syspath); - - FILE *fd = fopen (path, "w"); - - if (fd == NULL) - { - event_log_error (hashcat_ctx, "%s: %s", path, strerror (errno)); - - hcfree (path); - - return -1; - } - - fprintf (fd, "%d", val); - - fclose (fd); - - hcfree (path); - - return 0; -} - -static int hm_SYSFS_set_fan_speed_target (hashcat_ctx_t *hashcat_ctx, const int device_id, int val) -{ - char *syspath = hm_SYSFS_get_syspath_hwmon (hashcat_ctx, device_id); - - if (syspath == NULL) return -1; - - char *path; - char *path_max; - - hc_asprintf (&path, "%s/pwm1", syspath); - hc_asprintf (&path_max, "%s/pwm1_max", syspath); - - hcfree (syspath); - - FILE *fd_max = fopen (path_max, "r"); - - if (fd_max == NULL) - { - event_log_error (hashcat_ctx, "%s: %s", path_max, strerror (errno)); - - hcfree (path); - hcfree (path_max); - - return -1; - } - - int pwm1_max = 0; - - if (fscanf (fd_max, "%d", &pwm1_max) != 1) - { - fclose (fd_max); - - event_log_error (hashcat_ctx, "%s: unexpected data.", path_max); - - hcfree (path); - hcfree (path_max); - - return -1; - } - - fclose (fd_max); - - if (pwm1_max == 0) - { - event_log_error (hashcat_ctx, "%s: pwm1_max cannot be 0.", path_max); - - hcfree (path); - hcfree (path_max); - - return -1; - } - - const float p1 = (float) pwm1_max / 100.0f; - - FILE *fd = fopen (path, "w"); - - if (fd == NULL) - { - event_log_error (hashcat_ctx, "%s: %s", path, strerror (errno)); - - hcfree (path); - hcfree (path_max); - - return -1; - } - - fprintf (fd, "%d", (int) ((float) val * p1)); - - fclose (fd); - - hcfree (path); - hcfree (path_max); - - return 0; -} - static int hm_SYSFS_get_temperature_current (hashcat_ctx_t *hashcat_ctx, const int device_id, int *val) { char *syspath = hm_SYSFS_get_syspath_hwmon (hashcat_ctx, device_id); @@ -507,38 +399,6 @@ static int hm_SYSFS_get_pp_dpm_pcie (hashcat_ctx_t *hashcat_ctx, const int devic return 0; } -static int hm_SYSFS_set_power_dpm_force_performance_level (hashcat_ctx_t *hashcat_ctx, const int device_id, const char *val) -{ - char *syspath = hm_SYSFS_get_syspath_device (hashcat_ctx, device_id); - - if (syspath == NULL) return -1; - - char *path; - - hc_asprintf (&path, "%s/power_dpm_force_performance_level", syspath); - - hcfree (syspath); - - FILE *fd = fopen (path, "w"); - - if (fd == NULL) - { - event_log_error (hashcat_ctx, "%s: %s", path, strerror (errno)); - - hcfree (path); - - return -1; - } - - fprintf (fd, "%s", val); - - fclose (fd); - - hcfree (path); - - return 0; -} - // nvml functions static int nvml_init (hashcat_ctx_t *hashcat_ctx) @@ -666,7 +526,6 @@ static int nvml_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_FUNC(nvml, nvmlDeviceGetHandleByIndex, NVML_DEVICE_GET_HANDLE_BY_INDEX, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetTemperature, NVML_DEVICE_GET_TEMPERATURE, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetFanSpeed, NVML_DEVICE_GET_FAN_SPEED, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceGetPowerUsage, NVML_DEVICE_GET_POWER_USAGE, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetUtilizationRates, NVML_DEVICE_GET_UTILIZATION_RATES, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetClockInfo, NVML_DEVICE_GET_CLOCKINFO, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetTemperatureThreshold, NVML_DEVICE_GET_THRESHOLD, NVML, 0) @@ -674,11 +533,6 @@ static int nvml_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_FUNC(nvml, nvmlDeviceGetCurrPcieLinkWidth, NVML_DEVICE_GET_CURRPCIELINKWIDTH, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetCurrentClocksThrottleReasons, NVML_DEVICE_GET_CURRENTCLOCKSTHROTTLEREASONS, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetSupportedClocksThrottleReasons, NVML_DEVICE_GET_SUPPORTEDCLOCKSTHROTTLEREASONS, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceSetComputeMode, NVML_DEVICE_SET_COMPUTEMODE, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceSetGpuOperationMode, NVML_DEVICE_SET_OPERATIONMODE, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceGetPowerManagementLimitConstraints, NVML_DEVICE_GET_POWERMANAGEMENTLIMITCONSTRAINTS, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceSetPowerManagementLimit, NVML_DEVICE_SET_POWERMANAGEMENTLIMIT, NVML, 0) - HC_LOAD_FUNC(nvml, nvmlDeviceGetPowerManagementLimit, NVML_DEVICE_GET_POWERMANAGEMENTLIMIT, NVML, 0) HC_LOAD_FUNC(nvml, nvmlDeviceGetPciInfo, NVML_DEVICE_GET_PCIINFO, NVML, 0) return 0; @@ -784,28 +638,6 @@ static int hm_NVML_nvmlDeviceGetHandleByIndex (hashcat_ctx_t *hashcat_ctx, unsig return 0; } -/* -static int hm_NVML_nvmlDeviceGetName (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, char *name, unsigned int length) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetName (device, name, length); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetName(): %s", string); - - return -1; - } - - return 0; -} -*/ - static int hm_NVML_nvmlDeviceGetTemperature (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlTemperatureSensors_t sensorType, unsigned int *temp) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -846,28 +678,6 @@ static int hm_NVML_nvmlDeviceGetFanSpeed (hashcat_ctx_t *hashcat_ctx, nvmlDevice return 0; } -/* -static int hm_NVML_nvmlDeviceGetPowerUsage (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *power) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetPowerUsage (device, power); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetPowerUsage(): %s", string); - - return -1; - } - - return 0; -} -*/ - static int hm_NVML_nvmlDeviceGetUtilizationRates (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlUtilization_t *utilization) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -928,28 +738,6 @@ static int hm_NVML_nvmlDeviceGetTemperatureThreshold (hashcat_ctx_t *hashcat_ctx return 0; } -/* -static int hm_NVML_nvmlDeviceGetCurrPcieLinkGeneration (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *currLinkGen) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetCurrPcieLinkGeneration (device, currLinkGen); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetCurrPcieLinkGeneration(): %s", string); - - return -1; - } - - return 0; -} -*/ - static int hm_NVML_nvmlDeviceGetCurrPcieLinkWidth (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *currLinkWidth) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -970,154 +758,6 @@ static int hm_NVML_nvmlDeviceGetCurrPcieLinkWidth (hashcat_ctx_t *hashcat_ctx, n return 0; } -/* -static int hm_NVML_nvmlDeviceGetCurrentClocksThrottleReasons (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned long long *clocksThrottleReasons) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetCurrentClocksThrottleReasons (device, clocksThrottleReasons); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetCurrentClocksThrottleReasons(): %s", string); - - return -1; - } - - return 0; -} -*/ - -/* -static int hm_NVML_nvmlDeviceGetSupportedClocksThrottleReasons (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned long long *supportedClocksThrottleReasons) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetSupportedClocksThrottleReasons (device, supportedClocksThrottleReasons); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetSupportedClocksThrottleReasons(): %s", string); - - return -1; - } - - return 0; -} -*/ - -/* -static int hm_NVML_nvmlDeviceSetComputeMode (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlComputeMode_t mode) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceSetComputeMode (device, mode); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceSetComputeMode(): %s", string); - - return -1; - } - - return 0; -} -*/ - -/* -static int hm_NVML_nvmlDeviceSetGpuOperationMode (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlGpuOperationMode_t mode) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceSetGpuOperationMode (device, mode); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceSetGpuOperationMode(): %s", string); - - return -1; - } - - return 0; -} -*/ - -static int hm_NVML_nvmlDeviceGetPowerManagementLimitConstraints (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *minLimit, unsigned int *maxLimit) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetPowerManagementLimitConstraints (device, minLimit, maxLimit); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetPowerManagementLimitConstraints(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NVML_nvmlDeviceSetPowerManagementLimit (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int limit) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceSetPowerManagementLimit (device, limit); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceSetPowerManagementLimit(): %s", string); - - return -1; - } - - return 0; -} - -static int hm_NVML_nvmlDeviceGetPowerManagementLimit (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, unsigned int *limit) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVML_PTR *nvml = hwmon_ctx->hm_nvml; - - const nvmlReturn_t nvml_rc = nvml->nvmlDeviceGetPowerManagementLimit (device, limit); - - if (nvml_rc != NVML_SUCCESS) - { - const char *string = hm_NVML_nvmlErrorString (nvml, nvml_rc); - - event_log_error (hashcat_ctx, "nvmlDeviceGetPowerManagementLimit(): %s", string); - - return -1; - } - - return 0; -} - static int hm_NVML_nvmlDeviceGetPciInfo (hashcat_ctx_t *hashcat_ctx, nvmlDevice_t device, nvmlPciInfo_t *pci) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -1187,7 +827,6 @@ static int nvapi_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_ADDR(nvapi, NvAPI_EnumPhysicalGPUs, NVAPI_ENUMPHYSICALGPUS, nvapi_QueryInterface, 0xE5AC921Fu, NVAPI, 0) HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesInfo, NVAPI_GPU_GETPERFPOLICIESINFO, nvapi_QueryInterface, 0x409D9841u, NVAPI, 0) HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesStatus, NVAPI_GPU_GETPERFPOLICIESSTATUS, nvapi_QueryInterface, 0x3D358A0Cu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_SetCoolerLevels, NVAPI_GPU_SETCOOLERLEVELS, nvapi_QueryInterface, 0x891FA0AEu, NVAPI, 0) HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusId, NVAPI_GPU_GETBUSID, nvapi_QueryInterface, 0x1BE0B8E5u, NVAPI, 0) HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusSlotId, NVAPI_GPU_GETBUSSLOTID, nvapi_QueryInterface, 0x2A0A350Fu, NVAPI, 0) @@ -1326,28 +965,6 @@ static int hm_NvAPI_GPU_GetPerfPoliciesStatus (hashcat_ctx_t *hashcat_ctx, NvPhy return 0; } -static int hm_NvAPI_GPU_SetCoolerLevels (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex, NV_GPU_COOLER_LEVELS *pCoolerLevels) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - NVAPI_PTR *nvapi = hwmon_ctx->hm_nvapi; - - const NvAPI_Status NvAPI_rc = nvapi->NvAPI_GPU_SetCoolerLevels (hPhysicalGpu, coolerIndex, pCoolerLevels); - - if (NvAPI_rc != NVAPI_OK) - { - NvAPI_ShortString string = { 0 }; - - hm_NvAPI_GetErrorMessage (nvapi, NvAPI_rc, string); - - event_log_error (hashcat_ctx, "NvAPI_GPU_SetCoolerLevels(): %s", string); - - return -1; - } - - return 0; -} - static int hm_NvAPI_GPU_GetBusId (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -1392,377 +1009,6 @@ static int hm_NvAPI_GPU_GetBusSlotId (hashcat_ctx_t *hashcat_ctx, NvPhysicalGpuH return 0; } -/* -#if defined (__MINGW64__) - -void __security_check_cookie (uintptr_t _StackCookie); - -void __security_check_cookie (uintptr_t _StackCookie) -{ - (void) _StackCookie; -} - -void __GSHandlerCheck (); - -void __GSHandlerCheck () -{ -} - -#endif -*/ - -// xnvctrl functions - -static int xnvctrl_init (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - memset (xnvctrl, 0, sizeof (XNVCTRL_PTR)); - - #if defined (_WIN) - - // unsupport platform? - return -1; - - #else - - xnvctrl->lib_x11 = dlopen ("libX11.so", RTLD_LAZY); - - if (xnvctrl->lib_x11 == NULL) - { - //event_log_error (hashcat_ctx, "Failed to load the X11 library: %s", dlerror()); - //event_log_error (hashcat_ctx, "Please install the libx11-dev package."); - - return -1; - } - - xnvctrl->lib_xnvctrl = dlopen ("libXNVCtrl.so", RTLD_LAZY); - - if (xnvctrl->lib_xnvctrl == NULL) - { - //event_log_error (hashcat_ctx, "Failed to load the XNVCTRL library: %s", dlerror()); - //event_log_error (hashcat_ctx, "Please install the libxnvctrl-dev package."); - - return -1; - } - - HC_LOAD_FUNC2 (xnvctrl, XOpenDisplay, XOPENDISPLAY, lib_x11, X11, 0); - HC_LOAD_FUNC2 (xnvctrl, XCloseDisplay, XCLOSEDISPLAY, lib_x11, X11, 0); - - HC_LOAD_FUNC2 (xnvctrl, XNVCTRLQueryTargetCount, XNVCTRLQUERYTARGETCOUNT, lib_xnvctrl, XNVCTRL, 0); - HC_LOAD_FUNC2 (xnvctrl, XNVCTRLQueryTargetAttribute, XNVCTRLQUERYTARGETATTRIBUTE, lib_xnvctrl, XNVCTRL, 0); - HC_LOAD_FUNC2 (xnvctrl, XNVCTRLSetTargetAttribute, XNVCTRLSETTARGETATTRIBUTE, lib_xnvctrl, XNVCTRL, 0); - - return 0; - - #endif -} - -static void xnvctrl_close (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl) - { - #if defined (_POSIX) - - if (xnvctrl->lib_x11) - { - dlclose (xnvctrl->lib_x11); - } - - if (xnvctrl->lib_xnvctrl) - { - dlclose (xnvctrl->lib_xnvctrl); - } - - #endif - - hcfree (xnvctrl); - } -} - -static int hm_XNVCTRL_XOpenDisplay (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XOpenDisplay == NULL) return -1; - - void *dpy = xnvctrl->XOpenDisplay (NULL); - - if (dpy == NULL) - { - event_log_error (hashcat_ctx, "XOpenDisplay() failed."); - - return -1; - } - - xnvctrl->dpy = dpy; - - return 0; -} - -static void hm_XNVCTRL_XCloseDisplay (hashcat_ctx_t *hashcat_ctx) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XCloseDisplay == NULL) return; - - if (xnvctrl->dpy == NULL) return; - - xnvctrl->XCloseDisplay (xnvctrl->dpy); -} - -static int hm_XNVCTRL_query_target_count (hashcat_ctx_t *hashcat_ctx, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetCount == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const int rc = xnvctrl->XNVCTRLQueryTargetCount (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetCount() failed."); - - return -1; - } - - return 0; -} - -static int hm_XNVCTRL_get_fan_control (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const bool rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_GPU_COOLER_MANUAL_CONTROL, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "XNVCTRLQueryTargetAttribute() failed."); - - // help the user to fix the problem - - event_log_warning (hashcat_ctx, "This error typically occurs when you did not set up NVidia Coolbits."); - event_log_warning (hashcat_ctx, "To fix, run this command:"); - event_log_warning (hashcat_ctx, " sudo nvidia-xconfig --cool-bits=12"); - event_log_warning (hashcat_ctx, "Do not forget to restart X afterwards."); - event_log_warning (hashcat_ctx, NULL); - - return -1; - } - - return 0; -} - -static int hm_XNVCTRL_set_fan_control (hashcat_ctx_t *hashcat_ctx, const int gpu, int val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLSetTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - int cur; - - int rc = hm_XNVCTRL_get_fan_control (hashcat_ctx, gpu, &cur); - - if (rc == -1) return -1; - - xnvctrl->XNVCTRLSetTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_GPU_COOLER_MANUAL_CONTROL, val); - - rc = hm_XNVCTRL_get_fan_control (hashcat_ctx, gpu, &cur); - - if (rc == -1) return -1; - - if (cur != val) return -1; - - return 0; -} - -/* -static int hm_XNVCTRL_get_core_threshold (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const bool rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_GPU_CORE_THRESHOLD, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "XNVCTRLQueryTargetAttribute(NV_CTRL_GPU_CORE_THRESHOLD) failed."); - - return -1; - } - - return 0; -} -*/ - -/* -static int hm_XNVCTRL_get_fan_speed_current (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const bool rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_COOLER, gpu, 0, NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "XNVCTRLQueryTargetAttribute(NV_CTRL_THERMAL_COOLER_CURRENT_LEVEL) failed."); - - return -1; - } - - return 0; -} -*/ - -static int hm_XNVCTRL_get_fan_speed_target (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const int rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_COOLER, gpu, 0, NV_CTRL_THERMAL_COOLER_LEVEL, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetAttribute(NV_CTRL_THERMAL_COOLER_LEVEL) failed."); - - return -1; - } - - return 0; -} - -static int hm_XNVCTRL_set_fan_speed_target (hashcat_ctx_t *hashcat_ctx, const int gpu, int val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLSetTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - int cur; - - int rc = hm_XNVCTRL_get_fan_speed_target (hashcat_ctx, gpu, &cur); - - if (rc == -1) return -1; - - xnvctrl->XNVCTRLSetTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_COOLER, gpu, 0, NV_CTRL_THERMAL_COOLER_LEVEL, val); - - rc = hm_XNVCTRL_get_fan_speed_target (hashcat_ctx, gpu, &cur); - - if (rc == -1) return -1; - - if (cur != val) return -1; - - return 0; -} - -static int hm_XNVCTRL_get_pci_bus (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const int rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_PCI_BUS, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetAttribute(NV_CTRL_PCI_BUS) failed."); - - return -1; - } - - return 0; -} - -static int hm_XNVCTRL_get_pci_device (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const int rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_PCI_DEVICE, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetAttribute(NV_CTRL_PCI_DEVICE) failed."); - - return -1; - } - - return 0; -} - -static int hm_XNVCTRL_get_pci_function (hashcat_ctx_t *hashcat_ctx, const int gpu, int *val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - XNVCTRL_PTR *xnvctrl = hwmon_ctx->hm_xnvctrl; - - if (xnvctrl->XNVCTRLQueryTargetAttribute == NULL) return -1; - - if (xnvctrl->dpy == NULL) return -1; - - const int rc = xnvctrl->XNVCTRLQueryTargetAttribute (xnvctrl->dpy, NV_CTRL_TARGET_TYPE_GPU, gpu, 0, NV_CTRL_PCI_FUNCTION, val); - - if (rc == false) - { - event_log_error (hashcat_ctx, "%s", "XNVCTRLQueryTargetAttribute(NV_CTRL_PCI_FUNCTION) failed."); - - return -1; - } - - return 0; -} - // ADL functions static int adl_init (hashcat_ctx_t *hashcat_ctx) @@ -1813,26 +1059,13 @@ static int adl_init (hashcat_ctx_t *hashcat_ctx) HC_LOAD_FUNC(adl, ADL_Overdrive5_FanSpeedInfo_Get, ADL_OVERDRIVE5_FANSPEEDINFO_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive5_FanSpeed_Get, ADL_OVERDRIVE5_FANSPEED_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_FanSpeed_Get, ADL_OVERDRIVE6_FANSPEED_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_FanSpeed_Set, ADL_OVERDRIVE5_FANSPEED_SET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_FanSpeed_Set, ADL_OVERDRIVE6_FANSPEED_SET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_FanSpeedToDefault_Set, ADL_OVERDRIVE5_FANSPEEDTODEFAULT_SET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_ODParameters_Get, ADL_OVERDRIVE5_ODPARAMETERS_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_ODPerformanceLevels_Get, ADL_OVERDRIVE5_ODPERFORMANCELEVELS_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive5_ODPerformanceLevels_Set, ADL_OVERDRIVE5_ODPERFORMANCELEVELS_SET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_PowerControlInfo_Get, ADL_OVERDRIVE6_POWERCONTROLINFO_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_PowerControl_Get, ADL_OVERDRIVE6_POWERCONTROL_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_PowerControl_Set, ADL_OVERDRIVE6_POWERCONTROL_SET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Adapter_Active_Get, ADL_ADAPTER_ACTIVE_GET, ADL, 0) - //HC_LOAD_FUNC(adl, ADL_DisplayEnable_Set, ADL_DISPLAYENABLE_SET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive_Caps, ADL_OVERDRIVE_CAPS, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_PowerControl_Caps, ADL_OVERDRIVE6_POWERCONTROL_CAPS, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_Capabilities_Get, ADL_OVERDRIVE6_CAPABILITIES_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_StateInfo_Get, ADL_OVERDRIVE6_STATEINFO_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_CurrentStatus_Get, ADL_OVERDRIVE6_CURRENTSTATUS_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_State_Set, ADL_OVERDRIVE6_STATE_SET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureData_Get, ADL_OVERDRIVE6_TARGETTEMPERATUREDATA_GET, ADL, 0) HC_LOAD_FUNC(adl, ADL_Overdrive6_TargetTemperatureRangeInfo_Get, ADL_OVERDRIVE6_TARGETTEMPERATURERANGEINFO_GET, ADL, 0) - HC_LOAD_FUNC(adl, ADL_Overdrive6_FanSpeed_Reset, ADL_OVERDRIVE6_FANSPEED_RESET, ADL, 0) return 0; } @@ -2014,147 +1247,6 @@ static int hm_ADL_Overdrive6_FanSpeed_Get (hashcat_ctx_t *hashcat_ctx, int iAdap return 0; } -static int hm_ADL_Overdrive5_FanSpeed_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex, ADLFanSpeedValue *lpFanSpeedValue) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive5_FanSpeed_Set (iAdapterIndex, iThermalControllerIndex, lpFanSpeedValue); - - if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here - { - event_log_error (hashcat_ctx, "ADL_Overdrive5_FanSpeed_Set(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive6_FanSpeed_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6FanSpeedValue *lpFanSpeedValue) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Set (iAdapterIndex, lpFanSpeedValue); - - if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_FanSpeed_Set(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive5_FanSpeedToDefault_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int iThermalControllerIndex) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive5_FanSpeedToDefault_Set (iAdapterIndex, iThermalControllerIndex); - - if ((ADL_rc != ADL_OK) && (ADL_rc != ADL_ERR_NOT_SUPPORTED)) // exception allowed only here - { - event_log_error (hashcat_ctx, "ADL_Overdrive5_FanSpeedToDefault_Set(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_PowerControlInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6PowerControlInfo *powertune) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_PowerControlInfo_Get (iAdapterIndex, powertune); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_PowerControlInfo_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_PowerControl_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *iCurrentValue) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - int default_value = 0; - - const int ADL_rc = adl->ADL_Overdrive6_PowerControl_Get (iAdapterIndex, iCurrentValue, &default_value); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_PowerControl_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int level) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - ADLOD6PowerControlInfo powertune = {0, 0, 0, 0, 0}; - - const int hm_rc = hm_ADL_Overdrive_PowerControlInfo_Get (hashcat_ctx, iAdapterIndex, &powertune); - - if (hm_rc == -1) return -1; - - int min = powertune.iMinValue; - int max = powertune.iMaxValue; - int step = powertune.iStepValue; - - if (level < min || level > max) - { - event_log_error (hashcat_ctx, "ADL PowerControl level invalid."); - - return -1; - } - - if (step == 0) - { - event_log_error (hashcat_ctx, "ADL PowerControl step invalid."); - - return -1; - } - - if (level % step != 0) - { - event_log_error (hashcat_ctx, "ADL PowerControl step invalid."); - - return -1; - } - - const int ADL_rc = adl->ADL_Overdrive6_PowerControl_Set (iAdapterIndex, level); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_PowerControl_Set(): %d", ADL_rc); - - return -1; - } - - return 0; -} - static int hm_ADL_Overdrive_Caps (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *od_supported, int *od_enabled, int *od_version) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -2173,161 +1265,6 @@ static int hm_ADL_Overdrive_Caps (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, return 0; } -static int hm_ADL_Overdrive6_PowerControl_Caps (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *lpSupported) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_PowerControl_Caps (iAdapterIndex, lpSupported); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_PowerControl_Caps(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, ADLOD6Capabilities *caps) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_Capabilities_Get (iAdapterIndex, caps); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_Capabilities_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_StateInfo_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int type, ADLOD6MemClockState *state) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_StateInfo_Get (iAdapterIndex, type, state); - - if (ADL_rc == ADL_OK) - { - // check if clocks are okay with step sizes - // if not run a little hack: adjust the clocks to nearest clock size (clock down just a little bit) - - ADLOD6Capabilities caps; - - const int hm_rc = hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx, iAdapterIndex, &caps); - - if (hm_rc == -1) return -1; - - if (state->state.aLevels[0].iEngineClock % caps.sEngineClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL engine step size invalid for performance level 1."); - - //state->state.aLevels[0].iEngineClock -= state->state.aLevels[0].iEngineClock % caps.sEngineClockRange.iStep; - - return -1; - } - - if (state->state.aLevels[1].iEngineClock % caps.sEngineClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL engine step size invalid for performance level 2."); - - //state->state.aLevels[1].iEngineClock -= state->state.aLevels[1].iEngineClock % caps.sEngineClockRange.iStep; - - return -1; - } - - if (state->state.aLevels[0].iMemoryClock % caps.sMemoryClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL memory step size invalid for performance level 1."); - - //state->state.aLevels[0].iMemoryClock -= state->state.aLevels[0].iMemoryClock % caps.sMemoryClockRange.iStep; - - return -1; - } - - if (state->state.aLevels[1].iMemoryClock % caps.sMemoryClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL memory step size invalid for performance level 2."); - - //state->state.aLevels[1].iMemoryClock -= state->state.aLevels[1].iMemoryClock % caps.sMemoryClockRange.iStep; - - return -1; - } - } - else - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_StateInfo_Get(): %d", ADL_rc); - - return -1; - } - - return 0; -} - -static int hm_ADL_Overdrive_State_Set (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int type, ADLOD6StateInfo *state) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - // sanity checks - - ADLOD6Capabilities caps; - - const int hm_rc = hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx, iAdapterIndex, &caps); - - if (hm_rc == -1) return -1; - - if (state->aLevels[0].iEngineClock < caps.sEngineClockRange.iMin || state->aLevels[1].iEngineClock > caps.sEngineClockRange.iMax) - { - event_log_error (hashcat_ctx, "ADL engine clock outside valid range."); - - return -1; - } - - if (state->aLevels[1].iEngineClock % caps.sEngineClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL engine step size invalid."); - - return -1; - } - - if (state->aLevels[0].iMemoryClock < caps.sMemoryClockRange.iMin || state->aLevels[1].iMemoryClock > caps.sMemoryClockRange.iMax) - { - event_log_error (hashcat_ctx, "ADL memory clock outside valid range."); - - return -1; - } - - if (state->aLevels[1].iMemoryClock % caps.sMemoryClockRange.iStep != 0) - { - event_log_error (hashcat_ctx, "ADL memory step size invalid."); - - return -1; - } - - const int ADL_rc = adl->ADL_Overdrive6_State_Set (iAdapterIndex, type, state); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_State_Set(): %d", ADL_rc); - - return -1; - } - - return 0; -} - static int hm_ADL_Overdrive6_TargetTemperatureData_Get (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex, int *cur_temp, int *default_temp) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -2346,24 +1283,6 @@ static int hm_ADL_Overdrive6_TargetTemperatureData_Get (hashcat_ctx_t *hashcat_c return 0; } -static int hm_ADL_Overdrive6_FanSpeed_Reset (hashcat_ctx_t *hashcat_ctx, int iAdapterIndex) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - ADL_PTR *adl = hwmon_ctx->hm_adl; - - const int ADL_rc = adl->ADL_Overdrive6_FanSpeed_Reset (iAdapterIndex); - - if (ADL_rc != ADL_OK) - { - event_log_error (hashcat_ctx, "ADL_Overdrive6_FanSpeed_Reset(): %d", ADL_rc); - - return -1; - } - - return 0; -} - // general functions static int get_adapters_num_adl (hashcat_ctx_t *hashcat_ctx, int *iNumberAdapters) @@ -3077,253 +1996,6 @@ int hm_get_throttle_with_device_id (hashcat_ctx_t *hashcat_ctx, const u32 device return -1; } -int hm_set_fanspeed_with_device_id_adl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed, const int fanpolicy) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; - - if (hwmon_ctx->hm_adl) - { - if (fanpolicy == 1) - { - if (hwmon_ctx->hm_device[device_id].od_version == 5) - { - ADLFanSpeedValue lpFanSpeedValue; - - memset (&lpFanSpeedValue, 0, sizeof (lpFanSpeedValue)); - - lpFanSpeedValue.iSize = sizeof (lpFanSpeedValue); - lpFanSpeedValue.iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT; - lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED; - lpFanSpeedValue.iFanSpeed = fanspeed; - - if (hm_ADL_Overdrive5_FanSpeed_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, 0, &lpFanSpeedValue) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - if (hwmon_ctx->hm_device[device_id].od_version == 6) - { - ADLOD6FanSpeedValue fan_speed_value; - - memset (&fan_speed_value, 0, sizeof (fan_speed_value)); - - fan_speed_value.iSpeedType = ADL_OD6_FANSPEED_TYPE_PERCENT; - fan_speed_value.iFanSpeed = fanspeed; - - if (hm_ADL_Overdrive6_FanSpeed_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &fan_speed_value) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - } - else - { - if (hwmon_ctx->hm_device[device_id].od_version == 5) - { - if (hm_ADL_Overdrive5_FanSpeedToDefault_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, 0) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - if (hwmon_ctx->hm_device[device_id].od_version == 6) - { - if (hm_ADL_Overdrive6_FanSpeed_Reset (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - } - } - - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - -int hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed, const int fanpolicy) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; - - if (hwmon_ctx->hm_nvapi) - { - if (fanpolicy == 1) - { - NV_GPU_COOLER_LEVELS CoolerLevels; - - memset (&CoolerLevels, 0, sizeof (NV_GPU_COOLER_LEVELS)); - - CoolerLevels.Version = GPU_COOLER_LEVELS_VER | sizeof (NV_GPU_COOLER_LEVELS); - - CoolerLevels.Levels[0].Level = fanspeed; - CoolerLevels.Levels[0].Policy = 1; - - if (hm_NvAPI_GPU_SetCoolerLevels (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvapi, 0, &CoolerLevels) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - if (fanpolicy != 1) - { - NV_GPU_COOLER_LEVELS CoolerLevels; - - memset (&CoolerLevels, 0, sizeof (NV_GPU_COOLER_LEVELS)); - - CoolerLevels.Version = GPU_COOLER_LEVELS_VER | sizeof (NV_GPU_COOLER_LEVELS); - - CoolerLevels.Levels[0].Level = 100; - CoolerLevels.Levels[0].Policy = 0x20; - - if (hm_NvAPI_GPU_SetCoolerLevels (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvapi, 0, &CoolerLevels) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - } - - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - -int hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; - - if (hwmon_ctx->hm_xnvctrl) - { - if (hm_XNVCTRL_set_fan_speed_target (hashcat_ctx, hwmon_ctx->hm_device[device_id].xnvctrl, fanspeed) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - -int hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int fanspeed) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) return -1; - - if (hwmon_ctx->hm_sysfs) - { - if (hm_SYSFS_set_fan_speed_target (hashcat_ctx, device_id, fanspeed) == -1) - { - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - -static int hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanpolicy_set_supported == false) return -1; - - if (hwmon_ctx->hm_xnvctrl) - { - if (hm_XNVCTRL_set_fan_control (hashcat_ctx, hwmon_ctx->hm_device[device_id].xnvctrl, val) == -1) - { - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - -static int hm_set_fanctrl_with_device_id_sysfs (hashcat_ctx_t *hashcat_ctx, const u32 device_id, const int val) -{ - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - - if (hwmon_ctx->enabled == false) return -1; - - if (hwmon_ctx->hm_device[device_id].fanpolicy_set_supported == false) return -1; - - if (hwmon_ctx->hm_sysfs) - { - if (hm_SYSFS_set_fan_control (hashcat_ctx, device_id, val) == -1) - { - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; - } - - return 0; - } - - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported = false; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported = false; - - return -1; -} - int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; @@ -3348,19 +2020,17 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) * Initialize shared libraries */ - hm_attrs_t *hm_adapters_adl = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - hm_attrs_t *hm_adapters_nvapi = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - hm_attrs_t *hm_adapters_nvml = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - hm_attrs_t *hm_adapters_xnvctrl = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - hm_attrs_t *hm_adapters_sysfs = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); + hm_attrs_t *hm_adapters_adl = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); + hm_attrs_t *hm_adapters_nvapi = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); + hm_attrs_t *hm_adapters_nvml = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); + hm_attrs_t *hm_adapters_sysfs = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); - #define FREE_ADAPTERS \ - { \ - hcfree (hm_adapters_adl); \ - hcfree (hm_adapters_nvapi); \ - hcfree (hm_adapters_nvml); \ - hcfree (hm_adapters_xnvctrl); \ - hcfree (hm_adapters_sysfs); \ + #define FREE_ADAPTERS \ + { \ + hcfree (hm_adapters_adl); \ + hcfree (hm_adapters_nvapi); \ + hcfree (hm_adapters_nvml); \ + hcfree (hm_adapters_sysfs); \ } if (opencl_ctx->need_nvml == true) @@ -3387,18 +2057,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) } } - if ((opencl_ctx->need_xnvctrl == true) && (hwmon_ctx->hm_nvml)) // xnvctrl can't work alone, we need nvml, too - { - hwmon_ctx->hm_xnvctrl = (XNVCTRL_PTR *) hcmalloc (sizeof (XNVCTRL_PTR)); - - if (xnvctrl_init (hashcat_ctx) == -1) - { - hcfree (hwmon_ctx->hm_xnvctrl); - - hwmon_ctx->hm_xnvctrl = NULL; - } - } - if (opencl_ctx->need_adl == true) { hwmon_ctx->hm_adl = (ADL_PTR *) hcmalloc (sizeof (ADL_PTR)); @@ -3521,9 +2179,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hm_adapters_nvapi[platform_devices_id].nvapi = nvGPUHandle[i]; - hm_adapters_nvapi[platform_devices_id].fanspeed_set_supported = true; hm_adapters_nvapi[platform_devices_id].fanpolicy_get_supported = true; - hm_adapters_nvapi[platform_devices_id].fanpolicy_set_supported = true; hm_adapters_nvapi[platform_devices_id].throttle_get_supported = true; } } @@ -3533,58 +2189,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) } } - if (hwmon_ctx->hm_xnvctrl) - { - if (hm_XNVCTRL_XOpenDisplay (hashcat_ctx) == 0) - { - int tmp_in = 0; - - hm_XNVCTRL_query_target_count (hashcat_ctx, &tmp_in); - - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if ((device_param->device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (device_param->device_vendor_id != VENDOR_ID_NV) continue; - - for (int i = 0; i < tmp_in; i++) - { - int pci_bus = 0; - int pci_device = 0; - int pci_function = 0; - - const int rc1 = hm_XNVCTRL_get_pci_bus (hashcat_ctx, i, &pci_bus); - - if (rc1 == -1) continue; - - const int rc2 = hm_XNVCTRL_get_pci_device (hashcat_ctx, i, &pci_device); - - if (rc2 == -1) continue; - - const int rc3 = hm_XNVCTRL_get_pci_function (hashcat_ctx, i, &pci_function); - - if (rc3 == -1) continue; - - if ((device_param->pcie_bus == pci_bus) - && (device_param->pcie_device == pci_device) - && (device_param->pcie_function == pci_function)) - { - const u32 platform_devices_id = device_param->platform_devices_id; - - hm_adapters_xnvctrl[platform_devices_id].xnvctrl = i; - - hm_adapters_xnvctrl[platform_devices_id].fanspeed_get_supported = true; - hm_adapters_xnvctrl[platform_devices_id].fanspeed_set_supported = true; - hm_adapters_xnvctrl[platform_devices_id].fanpolicy_get_supported = true; - hm_adapters_xnvctrl[platform_devices_id].fanpolicy_set_supported = true; - } - } - } - } - } - if (hwmon_ctx->hm_adl) { if (hm_ADL_Main_Control_Create (hashcat_ctx, ADL_Main_Memory_Alloc, 0) == 0) @@ -3644,9 +2248,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hm_adapters_adl[platform_devices_id].buslanes_get_supported = true; hm_adapters_adl[platform_devices_id].corespeed_get_supported = true; hm_adapters_adl[platform_devices_id].fanspeed_get_supported = true; - hm_adapters_adl[platform_devices_id].fanspeed_set_supported = true; hm_adapters_adl[platform_devices_id].fanpolicy_get_supported = true; - hm_adapters_adl[platform_devices_id].fanpolicy_set_supported = true; hm_adapters_adl[platform_devices_id].memoryspeed_get_supported = true; hm_adapters_adl[platform_devices_id].temperature_get_supported = true; hm_adapters_adl[platform_devices_id].threshold_slowdown_get_supported = true; @@ -3676,9 +2278,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hm_adapters_sysfs[hm_adapters_id].buslanes_get_supported = true; hm_adapters_sysfs[hm_adapters_id].corespeed_get_supported = true; hm_adapters_sysfs[hm_adapters_id].fanspeed_get_supported = true; - hm_adapters_sysfs[hm_adapters_id].fanspeed_set_supported = true; hm_adapters_sysfs[hm_adapters_id].fanpolicy_get_supported = true; - hm_adapters_sysfs[hm_adapters_id].fanpolicy_set_supported = true; hm_adapters_sysfs[hm_adapters_id].memoryspeed_get_supported = true; hm_adapters_sysfs[hm_adapters_id].temperature_get_supported = true; @@ -3687,7 +2287,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) } } - if (hwmon_ctx->hm_adl == NULL && hwmon_ctx->hm_nvml == NULL && hwmon_ctx->hm_xnvctrl == NULL && hwmon_ctx->hm_sysfs == NULL) + if (hwmon_ctx->hm_adl == NULL && hwmon_ctx->hm_nvml == NULL && hwmon_ctx->hm_sysfs == NULL) { FREE_ADAPTERS; @@ -3706,10 +2306,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->od_clock_mem_status = (ADLOD6MemClockState *) hccalloc (opencl_ctx->devices_cnt, sizeof (ADLOD6MemClockState)); - hwmon_ctx->od_power_control_status = (int *) hccalloc (opencl_ctx->devices_cnt, sizeof (int)); - - hwmon_ctx->nvml_power_limit = (unsigned int *) hccalloc (opencl_ctx->devices_cnt, sizeof (unsigned int)); - /** * HM devices: copy */ @@ -3730,7 +2326,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].sysfs = hm_adapters_sysfs[platform_devices_id].sysfs; hwmon_ctx->hm_device[device_id].nvapi = 0; hwmon_ctx->hm_device[device_id].nvml = 0; - hwmon_ctx->hm_device[device_id].xnvctrl = 0; hwmon_ctx->hm_device[device_id].od_version = 0; if (hwmon_ctx->hm_adl) @@ -3740,9 +2335,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_adl[platform_devices_id].buslanes_get_supported; hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_adl[platform_devices_id].corespeed_get_supported; hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_adl[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_adl[platform_devices_id].fanspeed_set_supported; hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_adl[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_adl[platform_devices_id].fanpolicy_set_supported; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_adl[platform_devices_id].memoryspeed_get_supported; hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_adl[platform_devices_id].temperature_get_supported; hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_adl[platform_devices_id].threshold_shutdown_get_supported; @@ -3756,9 +2349,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_sysfs[platform_devices_id].buslanes_get_supported; hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_sysfs[platform_devices_id].corespeed_get_supported; hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_sysfs[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_sysfs[platform_devices_id].fanspeed_set_supported; hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_sysfs[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_sysfs[platform_devices_id].fanpolicy_set_supported; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_sysfs[platform_devices_id].memoryspeed_get_supported; hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_sysfs[platform_devices_id].temperature_get_supported; hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_sysfs[platform_devices_id].threshold_shutdown_get_supported; @@ -3774,7 +2365,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].sysfs = 0; hwmon_ctx->hm_device[device_id].nvapi = hm_adapters_nvapi[platform_devices_id].nvapi; hwmon_ctx->hm_device[device_id].nvml = hm_adapters_nvml[platform_devices_id].nvml; - hwmon_ctx->hm_device[device_id].xnvctrl = hm_adapters_xnvctrl[platform_devices_id].xnvctrl; hwmon_ctx->hm_device[device_id].od_version = 0; if (hwmon_ctx->hm_nvml) @@ -3782,9 +2372,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_nvml[platform_devices_id].buslanes_get_supported; hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_nvml[platform_devices_id].corespeed_get_supported; hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_nvml[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_nvml[platform_devices_id].fanspeed_set_supported; hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_nvml[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_nvml[platform_devices_id].fanpolicy_set_supported; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_nvml[platform_devices_id].memoryspeed_get_supported; hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_nvml[platform_devices_id].temperature_get_supported; hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_nvml[platform_devices_id].threshold_shutdown_get_supported; @@ -3798,9 +2386,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_nvapi[platform_devices_id].buslanes_get_supported; hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_nvapi[platform_devices_id].corespeed_get_supported; hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_nvapi[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_nvapi[platform_devices_id].fanspeed_set_supported; hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_nvapi[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_nvapi[platform_devices_id].fanpolicy_set_supported; hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_nvapi[platform_devices_id].memoryspeed_get_supported; hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_nvapi[platform_devices_id].temperature_get_supported; hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_nvapi[platform_devices_id].threshold_shutdown_get_supported; @@ -3808,22 +2394,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) hwmon_ctx->hm_device[device_id].throttle_get_supported |= hm_adapters_nvapi[platform_devices_id].throttle_get_supported; hwmon_ctx->hm_device[device_id].utilization_get_supported |= hm_adapters_nvapi[platform_devices_id].utilization_get_supported; } - - if (hwmon_ctx->hm_xnvctrl) - { - hwmon_ctx->hm_device[device_id].buslanes_get_supported |= hm_adapters_xnvctrl[platform_devices_id].buslanes_get_supported; - hwmon_ctx->hm_device[device_id].corespeed_get_supported |= hm_adapters_xnvctrl[platform_devices_id].corespeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_get_supported |= hm_adapters_xnvctrl[platform_devices_id].fanspeed_get_supported; - hwmon_ctx->hm_device[device_id].fanspeed_set_supported |= hm_adapters_xnvctrl[platform_devices_id].fanspeed_set_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_get_supported |= hm_adapters_xnvctrl[platform_devices_id].fanpolicy_get_supported; - hwmon_ctx->hm_device[device_id].fanpolicy_set_supported |= hm_adapters_xnvctrl[platform_devices_id].fanpolicy_set_supported; - hwmon_ctx->hm_device[device_id].memoryspeed_get_supported |= hm_adapters_xnvctrl[platform_devices_id].memoryspeed_get_supported; - hwmon_ctx->hm_device[device_id].temperature_get_supported |= hm_adapters_xnvctrl[platform_devices_id].temperature_get_supported; - hwmon_ctx->hm_device[device_id].threshold_shutdown_get_supported |= hm_adapters_xnvctrl[platform_devices_id].threshold_shutdown_get_supported; - hwmon_ctx->hm_device[device_id].threshold_slowdown_get_supported |= hm_adapters_xnvctrl[platform_devices_id].threshold_slowdown_get_supported; - hwmon_ctx->hm_device[device_id].throttle_get_supported |= hm_adapters_xnvctrl[platform_devices_id].throttle_get_supported; - hwmon_ctx->hm_device[device_id].utilization_get_supported |= hm_adapters_xnvctrl[platform_devices_id].utilization_get_supported; - } } // by calling the different functions here this will disable them in case they will error out @@ -3843,421 +2413,15 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) FREE_ADAPTERS; - /** - * powertune on user request - */ - - if (user_options->powertune_enable == true) - { - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if (device_param->skipped == true) continue; - - if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - /** - * 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? - */ - - if (hwmon_ctx->hm_device[device_id].od_version == 6) - { - int ADL_rc; - - // check powertune capabilities first, if not available then skip device - - int powertune_supported = 0; - - ADL_rc = hm_ADL_Overdrive6_PowerControl_Caps (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &powertune_supported); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get ADL PowerControl capabilities."); - - return -1; - } - - // first backup current value, we will restore it later - - if (powertune_supported != 0) - { - // powercontrol settings - - ADLOD6PowerControlInfo powertune = {0, 0, 0, 0, 0}; - - ADL_rc = hm_ADL_Overdrive_PowerControlInfo_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &powertune); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get current ADL PowerControl values."); - - return -1; - } - - ADL_rc = hm_ADL_Overdrive_PowerControl_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &hwmon_ctx->od_power_control_status[device_id]); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get current ADL PowerControl values."); - - return -1; - } - - ADL_rc = hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, powertune.iMaxValue); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to set new ADL PowerControl values."); - - return -1; - } - - // clocks - - memset (&hwmon_ctx->od_clock_mem_status[device_id], 0, sizeof (ADLOD6MemClockState)); - - hwmon_ctx->od_clock_mem_status[device_id].state.iNumberOfPerformanceLevels = 2; - - ADL_rc = hm_ADL_Overdrive_StateInfo_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, ADL_OD6_GETSTATEINFO_CUSTOM_PERFORMANCE, &hwmon_ctx->od_clock_mem_status[device_id]); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get ADL memory and engine clock frequency."); - - return -1; - } - - // Query capabilities only to see if profiles were not "damaged", if so output a warning but do accept the users profile settings - - ADLOD6Capabilities caps = {0, 0, 0, {0, 0, 0}, {0, 0, 0}, 0, 0}; - - ADL_rc = hm_ADL_Overdrive_Capabilities_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &caps); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get ADL device capabilities."); - - return -1; - } - - int engine_clock_max = (int) (0.6666f * caps.sEngineClockRange.iMax); - int memory_clock_max = (int) (0.6250f * caps.sMemoryClockRange.iMax); - - int warning_trigger_engine = (int) (0.25f * engine_clock_max); - int warning_trigger_memory = (int) (0.25f * memory_clock_max); - - int engine_clock_profile_max = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[1].iEngineClock; - int memory_clock_profile_max = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[1].iMemoryClock; - - // warning if profile has too low max values - - if ((engine_clock_max - engine_clock_profile_max) > warning_trigger_engine) - { - event_log_error (hashcat_ctx, "Custom profile has low maximum engine clock value. Expect reduced performance."); - } - - if ((memory_clock_max - memory_clock_profile_max) > warning_trigger_memory) - { - event_log_error (hashcat_ctx, "Custom profile has low maximum memory clock value. Expect reduced performance."); - } - - ADLOD6StateInfo *performance_state = (ADLOD6StateInfo*) hccalloc (1, sizeof (ADLOD6StateInfo) + sizeof (ADLOD6PerformanceLevel)); - - performance_state->iNumberOfPerformanceLevels = 2; - - performance_state->aLevels[0].iEngineClock = engine_clock_profile_max; - performance_state->aLevels[1].iEngineClock = engine_clock_profile_max; - performance_state->aLevels[0].iMemoryClock = memory_clock_profile_max; - performance_state->aLevels[1].iMemoryClock = memory_clock_profile_max; - - ADL_rc = hm_ADL_Overdrive_State_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, ADL_OD6_SETSTATE_PERFORMANCE, performance_state); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to set ADL performance state."); - - return -1; - } - - hcfree (performance_state); - } - - // set powertune value only - - if (powertune_supported != 0) - { - // powertune set - ADLOD6PowerControlInfo powertune = {0, 0, 0, 0, 0}; - - ADL_rc = hm_ADL_Overdrive_PowerControlInfo_Get (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &powertune); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to get current ADL PowerControl settings."); - - return -1; - } - - ADL_rc = hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, powertune.iMaxValue); - - if (ADL_rc == ADL_ERR) - { - event_log_error (hashcat_ctx, "Failed to set new ADL PowerControl values."); - - return -1; - } - } - } - } - - if (hwmon_ctx->hm_sysfs) - { - hm_SYSFS_set_power_dpm_force_performance_level (hashcat_ctx, device_id, "high"); - } - } - - if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_NV) - { - // first backup current value, we will restore it later - - unsigned int limit; - - bool powertune_supported = false; - - if (hm_NVML_nvmlDeviceGetPowerManagementLimit (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, &limit) == NVML_SUCCESS) - { - powertune_supported = true; - } - - // if backup worked, activate the maximum allowed - - if (powertune_supported == true) - { - unsigned int minLimit; - unsigned int maxLimit; - - if (hm_NVML_nvmlDeviceGetPowerManagementLimitConstraints (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, &minLimit, &maxLimit) == NVML_SUCCESS) - { - if (maxLimit > 0) - { - if (hm_NVML_nvmlDeviceSetPowerManagementLimit (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, maxLimit) == NVML_SUCCESS) - { - // now we can be sure we need to reset later - - hwmon_ctx->nvml_power_limit[device_id] = limit; - } - } - } - } - } - } - } - - /** - * Store initial fanspeed if gpu_temp_retain is enabled - */ - - if (user_options->gpu_temp_retain > 0) - { - bool one_success = false; - - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if (device_param->skipped == true) continue; - - if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (hwmon_ctx->hm_device[device_id].fanspeed_get_supported == false) continue; - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) continue; - - const int fanspeed = hm_get_fanspeed_with_device_id (hashcat_ctx, device_id); - - if (fanspeed == -1) continue; - - if (device_param->device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - hm_set_fanspeed_with_device_id_adl (hashcat_ctx, device_id, fanspeed, 1); - } - - if (hwmon_ctx->hm_sysfs) - { - hm_set_fanctrl_with_device_id_sysfs (hashcat_ctx, device_id, 1); - - hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx, device_id, fanspeed); - } - } - else if (device_param->device_vendor_id == VENDOR_ID_NV) - { - if (hwmon_ctx->hm_xnvctrl) - { - hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx, device_id, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE); - - hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx, device_id, fanspeed); - } - - if (hwmon_ctx->hm_nvapi) - { - hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx, device_id, fanspeed, 1); - } - } - - if ((hwmon_ctx->hm_device[device_id].fanpolicy_set_supported == true) && (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == true)) one_success = true; - } - - if (one_success == false) user_options->gpu_temp_retain = 0; - } - return 0; } void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx) { - hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; - opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; - user_options_t *user_options = hashcat_ctx->user_options; + hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; if (hwmon_ctx->enabled == false) return; - // reset default fan speed - - if (user_options->gpu_temp_retain > 0) - { - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if (device_param->skipped == true) continue; - - if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (hwmon_ctx->hm_device[device_id].fanspeed_get_supported == false) continue; - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) continue; - - int rc = -1; - - if (device_param->device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - rc = hm_set_fanspeed_with_device_id_adl (hashcat_ctx, device_id, 100, 0); - } - - if (hwmon_ctx->hm_sysfs) - { - rc = hm_set_fanctrl_with_device_id_sysfs (hashcat_ctx, device_id, 2); - } - } - else if (device_param->device_vendor_id == VENDOR_ID_NV) - { - if (hwmon_ctx->hm_xnvctrl) - { - rc = hm_set_fanctrl_with_device_id_xnvctrl (hashcat_ctx, device_id, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE); - } - - if (hwmon_ctx->hm_nvapi) - { - rc = hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx, device_id, 100, 0); - } - } - - if (rc == -1) event_log_error (hashcat_ctx, "Failed to restore default fan speed and policy for device #%u", device_id + 1); - } - } - - // reset power tuning - - if (user_options->powertune_enable == true) - { - for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) - { - hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; - - if (device_param->skipped == true) continue; - - if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - if (hwmon_ctx->hm_device[device_id].od_version == 6) - { - // check powertune capabilities first, if not available then skip device - - int powertune_supported = 0; - - if ((hm_ADL_Overdrive6_PowerControl_Caps (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, &powertune_supported)) == -1) - { - //event_log_error (hashcat_ctx, "Failed to get ADL PowerControl capabilities."); - - continue; - } - - if (powertune_supported != 0) - { - // powercontrol settings - - if ((hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, hwmon_ctx->od_power_control_status[device_id])) == -1) - { - //event_log_error (hashcat_ctx, "Failed to restore the ADL PowerControl values."); - - continue; - } - - // clocks - - ADLOD6StateInfo *performance_state = (ADLOD6StateInfo*) hccalloc (1, sizeof (ADLOD6StateInfo) + sizeof (ADLOD6PerformanceLevel)); - - performance_state->iNumberOfPerformanceLevels = 2; - - performance_state->aLevels[0].iEngineClock = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[0].iEngineClock; - performance_state->aLevels[1].iEngineClock = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[1].iEngineClock; - performance_state->aLevels[0].iMemoryClock = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[0].iMemoryClock; - performance_state->aLevels[1].iMemoryClock = hwmon_ctx->od_clock_mem_status[device_id].state.aLevels[1].iMemoryClock; - - if ((hm_ADL_Overdrive_State_Set (hashcat_ctx, hwmon_ctx->hm_device[device_id].adl, ADL_OD6_SETSTATE_PERFORMANCE, performance_state)) == -1) - { - //event_log_error (hashcat_ctx, "Failed to restore ADL performance state."); - - continue; - } - - hcfree (performance_state); - } - } - } - - if (hwmon_ctx->hm_sysfs) - { - hm_SYSFS_set_power_dpm_force_performance_level (hashcat_ctx, device_id, "auto"); - } - } - - if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_NV) - { - unsigned int power_limit = hwmon_ctx->nvml_power_limit[device_id]; - - if (power_limit > 0) - { - hm_NVML_nvmlDeviceSetPowerManagementLimit (hashcat_ctx, hwmon_ctx->hm_device[device_id].nvml, power_limit); - } - } - } - } - // unload shared libraries if (hwmon_ctx->hm_nvml) @@ -4274,13 +2438,6 @@ void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx) nvapi_close (hashcat_ctx); } - if (hwmon_ctx->hm_xnvctrl) - { - hm_XNVCTRL_XCloseDisplay (hashcat_ctx); - - xnvctrl_close (hashcat_ctx); - } - if (hwmon_ctx->hm_adl) { hm_ADL_Main_Control_Destroy (hashcat_ctx); @@ -4296,8 +2453,6 @@ void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx) // free memory - hcfree (hwmon_ctx->nvml_power_limit); - hcfree (hwmon_ctx->od_power_control_status); hcfree (hwmon_ctx->od_clock_mem_status); hcfree (hwmon_ctx->hm_device); diff --git a/src/main.c b/src/main.c index 8f5049059..a176d9352 100644 --- a/src/main.c +++ b/src/main.c @@ -516,15 +516,6 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, event_log_info (hashcat_ctx, "Watchdog: Temperature abort trigger disabled."); } - if (hwmon_ctx->enabled == true && user_options->gpu_temp_retain > 0) - { - event_log_info (hashcat_ctx, "Watchdog: Temperature retain trigger set to %uc", user_options->gpu_temp_retain); - } - else - { - event_log_info (hashcat_ctx, "Watchdog: Temperature retain trigger disabled."); - } - event_log_info (hashcat_ctx, NULL); } diff --git a/src/monitor.c b/src/monitor.c index e0a41effa..ed3470b11 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -58,12 +58,9 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) bool hwmon_check = false; bool performance_check = false; - const int sleep_time = 1; - const int temp_threshold = 1; // degrees celcius - const int fan_speed_min = 33; // in percentage - const int fan_speed_max = 100; - const double exec_low = 50.0; // in ms - const double util_low = 90.0; // in percent + const int sleep_time = 1; + const double exec_low = 50.0; // in ms + const double util_low = 90.0; // in percent if (user_options->runtime) { @@ -100,20 +97,6 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) return 0; } - // these variables are mainly used for fan control - - int fan_speed_chgd[DEVICES_MAX]; - - memset (fan_speed_chgd, 0, sizeof (fan_speed_chgd)); - - // temperature controller "loopback" values - - int temp_diff_old[DEVICES_MAX]; - int temp_diff_sum[DEVICES_MAX]; - - memset (temp_diff_old, 0, sizeof (temp_diff_old)); - memset (temp_diff_sum, 0, sizeof (temp_diff_sum)); - // timer hc_time_t last_temp_check_time; @@ -127,24 +110,12 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) u32 remove_left = user_options->remove_timer; u32 status_left = user_options->status_timer; - u32 devices_status_old = status_ctx->devices_status; - while (status_ctx->shutdown_inner == false) { sleep (sleep_time); if (status_ctx->devices_status == STATUS_INIT) continue; - if ((devices_status_old == STATUS_PAUSED) && (status_ctx->devices_status == STATUS_RUNNING)) - { - memset (fan_speed_chgd, 0, sizeof (fan_speed_chgd)); - - memset (temp_diff_old, 0, sizeof (temp_diff_old)); - memset (temp_diff_sum, 0, sizeof (temp_diff_sum)); - } - - devices_status_old = status_ctx->devices_status; - if (hwmon_check == true) { hc_thread_mutex_lock (status_ctx->mux_hwmon); @@ -204,84 +175,6 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) myabort (hashcat_ctx); } - - if (hwmon_ctx->hm_device[device_id].fanspeed_get_supported == false) continue; - if (hwmon_ctx->hm_device[device_id].fanspeed_set_supported == false) continue; - - const u32 gpu_temp_retain = user_options->gpu_temp_retain; - - if (gpu_temp_retain > 0) - { - int temp_cur = temperature; - - int temp_diff_new = (int) gpu_temp_retain - temp_cur; - - temp_diff_sum[device_id] = temp_diff_sum[device_id] + temp_diff_new; - - // calculate Ta value (time difference in seconds between the last check and this check) - - last_temp_check_time = temp_check_time; - - float Kp = 1.6f; - float Ki = 0.001f; - float Kd = 10.0f; - - // PID controller (3-term controller: proportional - Kp, integral - Ki, derivative - Kd) - - int fan_diff_required = (int) (Kp * (float)temp_diff_new + Ki * Ta * (float)temp_diff_sum[device_id] + Kd * ((float)(temp_diff_new - temp_diff_old[device_id])) / Ta); - - if (abs (fan_diff_required) >= temp_threshold) - { - const int fan_speed_cur = hm_get_fanspeed_with_device_id (hashcat_ctx, device_id); - - int fan_speed_level = fan_speed_cur; - - if (fan_speed_chgd[device_id] == 0) fan_speed_level = temp_cur; - - int fan_speed_new = fan_speed_level - fan_diff_required; - - if (fan_speed_new > fan_speed_max) fan_speed_new = fan_speed_max; - if (fan_speed_new < fan_speed_min) fan_speed_new = fan_speed_min; - - if (fan_speed_new != fan_speed_cur) - { - int freely_change_fan_speed = (fan_speed_chgd[device_id] == 1); - int fan_speed_must_change = (fan_speed_new > fan_speed_cur); - - if ((freely_change_fan_speed == 1) || (fan_speed_must_change == 1)) - { - if (device_param->device_vendor_id == VENDOR_ID_AMD) - { - if (hwmon_ctx->hm_adl) - { - hm_set_fanspeed_with_device_id_adl (hashcat_ctx, device_id, fan_speed_new, 1); - } - - if (hwmon_ctx->hm_sysfs) - { - hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx, device_id, fan_speed_new); - } - } - else if (device_param->device_vendor_id == VENDOR_ID_NV) - { - if (hwmon_ctx->hm_nvapi) - { - hm_set_fanspeed_with_device_id_nvapi (hashcat_ctx, device_id, fan_speed_new, 1); - } - - if (hwmon_ctx->hm_xnvctrl) - { - hm_set_fanspeed_with_device_id_xnvctrl (hashcat_ctx, device_id, fan_speed_new); - } - } - - fan_speed_chgd[device_id] = 1; - } - - temp_diff_old[device_id] = temp_diff_new; - } - } - } } hc_thread_mutex_unlock (status_ctx->mux_hwmon); diff --git a/src/opencl.c b/src/opencl.c index df32776e3..79aa1b8c5 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -2631,7 +2631,6 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) bool need_adl = false; bool need_nvml = false; bool need_nvapi = false; - bool need_xnvctrl = false; bool need_sysfs = false; u32 devices_cnt = 0; @@ -3170,10 +3169,6 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) { need_nvml = true; - #if defined (__linux__) - need_xnvctrl = true; - #endif - #if defined (_WIN) need_nvapi = true; #endif @@ -3457,18 +3452,17 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) } } - opencl_ctx->target_msec = TARGET_MSEC_PROFILE[user_options->workload_profile - 1]; + opencl_ctx->target_msec = TARGET_MSEC_PROFILE[user_options->workload_profile - 1]; - opencl_ctx->devices_cnt = devices_cnt; - opencl_ctx->devices_active = devices_active; + opencl_ctx->devices_cnt = devices_cnt; + opencl_ctx->devices_active = devices_active; - opencl_ctx->need_adl = need_adl; - opencl_ctx->need_nvml = need_nvml; - opencl_ctx->need_nvapi = need_nvapi; - opencl_ctx->need_xnvctrl = need_xnvctrl; - opencl_ctx->need_sysfs = need_sysfs; + opencl_ctx->need_adl = need_adl; + opencl_ctx->need_nvml = need_nvml; + opencl_ctx->need_nvapi = need_nvapi; + opencl_ctx->need_sysfs = need_sysfs; - opencl_ctx->comptime = comptime; + opencl_ctx->comptime = comptime; return 0; } @@ -3501,11 +3495,10 @@ void opencl_ctx_devices_destroy (hashcat_ctx_t *hashcat_ctx) opencl_ctx->devices_cnt = 0; opencl_ctx->devices_active = 0; - opencl_ctx->need_adl = false; - opencl_ctx->need_nvml = false; - opencl_ctx->need_nvapi = false; - opencl_ctx->need_xnvctrl = false; - opencl_ctx->need_sysfs = false; + opencl_ctx->need_adl = false; + opencl_ctx->need_nvml = false; + opencl_ctx->need_nvapi = false; + opencl_ctx->need_sysfs = false; } void opencl_ctx_devices_update_power (hashcat_ctx_t *hashcat_ctx) diff --git a/src/usage.c b/src/usage.c index a8854cf97..e40116a6e 100644 --- a/src/usage.c +++ b/src/usage.c @@ -96,8 +96,6 @@ static const char *const USAGE_BIG[] = " --nvidia-spin-damp | Num | Workaround NVIDIAs CPU burning loop bug, in percent | --nvidia-spin-damp=50", " --gpu-temp-disable | | Disable temperature and fanspeed reads and triggers |", " --gpu-temp-abort | Num | Abort if GPU temperature reaches X degrees Celsius | --gpu-temp-abort=100", - " --gpu-temp-retain | Num | Try to retain GPU temperature at X degrees Celsius | --gpu-temp-retain=95", - " --powertune-enable | | Enable power tuning. Restores settings when finished |", " --scrypt-tmto | Num | Manually override TMTO value for scrypt to X | --scrypt-tmto=3", " -s, --skip | Num | Skip X words from the start | -s 1000000", " -l, --limit | Num | Limit X words from the start + skipped words | -l 1000000", diff --git a/src/user_options.c b/src/user_options.c index 14b2d9bcd..5116dec44 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -40,7 +40,6 @@ static const struct option long_options[] = {"generate-rules-seed", required_argument, 0, IDX_RP_GEN_SEED}, {"gpu-temp-abort", required_argument, 0, IDX_GPU_TEMP_ABORT}, {"gpu-temp-disable", no_argument, 0, IDX_GPU_TEMP_DISABLE}, - {"gpu-temp-retain", required_argument, 0, IDX_GPU_TEMP_RETAIN}, {"hash-type", required_argument, 0, IDX_HASH_MODE}, {"hccapx-message-pair", required_argument, 0, IDX_HCCAPX_MESSAGE_PAIR}, {"help", no_argument, 0, IDX_HELP}, @@ -80,7 +79,6 @@ static const struct option long_options[] = {"wordlist-autohex-disable", no_argument, 0, IDX_WORDLIST_AUTOHEX_DISABLE}, {"potfile-disable", no_argument, 0, IDX_POTFILE_DISABLE}, {"potfile-path", required_argument, 0, IDX_POTFILE_PATH}, - {"powertune-enable", no_argument, 0, IDX_POWERTUNE_ENABLE}, {"quiet", no_argument, 0, IDX_QUIET}, {"remove", no_argument, 0, IDX_REMOVE}, {"remove-timer", required_argument, 0, IDX_REMOVE_TIMER}, @@ -145,7 +143,6 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx) user_options->force = FORCE; user_options->gpu_temp_abort = GPU_TEMP_ABORT; user_options->gpu_temp_disable = GPU_TEMP_DISABLE; - user_options->gpu_temp_retain = GPU_TEMP_RETAIN; user_options->hash_mode = HASH_MODE; user_options->hccapx_message_pair = HCCAPX_MESSAGE_PAIR; user_options->hex_charset = HEX_CHARSET; @@ -184,7 +181,6 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx) user_options->outfile = NULL; user_options->potfile_disable = POTFILE_DISABLE; user_options->potfile_path = NULL; - user_options->powertune_enable = POWERTUNE_ENABLE; user_options->quiet = QUIET; user_options->remove = REMOVE; user_options->remove_timer = REMOVE_TIMER; @@ -275,7 +271,6 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) case IDX_KERNEL_LOOPS: case IDX_NVIDIA_SPIN_DAMP: case IDX_GPU_TEMP_ABORT: - case IDX_GPU_TEMP_RETAIN: case IDX_HCCAPX_MESSAGE_PAIR: case IDX_NONCE_ERROR_CORRECTIONS: case IDX_VERACRYPT_PIM: @@ -395,8 +390,6 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) user_options->nvidia_spin_damp_chgd = true; break; case IDX_GPU_TEMP_DISABLE: user_options->gpu_temp_disable = true; break; case IDX_GPU_TEMP_ABORT: user_options->gpu_temp_abort = strtoul (optarg, NULL, 10); break; - case IDX_GPU_TEMP_RETAIN: user_options->gpu_temp_retain = strtoul (optarg, NULL, 10); break; - case IDX_POWERTUNE_ENABLE: user_options->powertune_enable = true; break; case IDX_LOGFILE_DISABLE: user_options->logfile_disable = true; break; case IDX_HCCAPX_MESSAGE_PAIR: user_options->hccapx_message_pair = strtoul (optarg, NULL, 10); user_options->hccapx_message_pair_chgd = true; break; @@ -844,16 +837,6 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx) return -1; } - if ((user_options->gpu_temp_abort != 0) && (user_options->gpu_temp_retain != 0)) - { - if (user_options->gpu_temp_abort < user_options->gpu_temp_retain) - { - event_log_error (hashcat_ctx, "Value for --gpu-temp-abort must not be less than --gpu-temp-retain value."); - - return -1; - } - } - if (user_options->benchmark == true) { if (user_options->attack_mode_chgd == true) @@ -1225,10 +1208,8 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) user_options_t *user_options = hashcat_ctx->user_options; #if !defined (WITH_HWMON) - user_options->powertune_enable = false; user_options->gpu_temp_disable = true; user_options->gpu_temp_abort = 0; - user_options->gpu_temp_retain = 0; #endif // WITH_HWMON // some options can influence or overwrite other options @@ -1246,7 +1227,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) user_options->nvidia_spin_damp = 0; user_options->outfile_check_timer = 0; user_options->potfile_disable = true; - user_options->powertune_enable = false; user_options->restore_disable = true; user_options->restore = false; user_options->restore_timer = 0; @@ -1259,13 +1239,11 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) { user_options->attack_mode = ATTACK_MODE_BF; user_options->gpu_temp_disable = false; - user_options->gpu_temp_retain = 0; user_options->increment = false; user_options->left = false; user_options->logfile_disable = true; user_options->nvidia_spin_damp = 0; user_options->potfile_disable = true; - user_options->powertune_enable = true; user_options->progress_only = false; user_options->restore_disable = true; user_options->restore = false; @@ -1391,7 +1369,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx) if (user_options->gpu_temp_disable == true) { user_options->gpu_temp_abort = 0; - user_options->gpu_temp_retain = 0; } // default mask @@ -2244,7 +2221,6 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) logfile_top_uint (user_options->force); logfile_top_uint (user_options->gpu_temp_abort); logfile_top_uint (user_options->gpu_temp_disable); - logfile_top_uint (user_options->gpu_temp_retain); logfile_top_uint (user_options->hash_mode); logfile_top_uint (user_options->hex_charset); logfile_top_uint (user_options->hex_salt); @@ -2272,7 +2248,6 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) logfile_top_uint (user_options->outfile_format); logfile_top_uint (user_options->wordlist_autohex_disable); logfile_top_uint (user_options->potfile_disable); - logfile_top_uint (user_options->powertune_enable); logfile_top_uint (user_options->progress_only); logfile_top_uint (user_options->quiet); logfile_top_uint (user_options->remove);