mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 16:18:09 +00:00
Added support to utilize multiple different OpenCL platforms in parallel, ex: AMD + NV
This commit is contained in:
parent
6b4e4c060a
commit
52d71de0d4
@ -30,17 +30,32 @@ Issue: 2
|
|||||||
|
|
||||||
Type.: Feature
|
Type.: Feature
|
||||||
File.: Host
|
File.: Host
|
||||||
Desc.: No longer need NVidia-CUDA-SDK, AMD-APP-SDK and NVidia-ForceWare driver in depencies
|
Desc.: No longer requires NV CUDA-SDK, NV ForceWare or AMD APP-SDK in depencies
|
||||||
Issue: 2
|
Issue: 2
|
||||||
|
|
||||||
Type.: Feature
|
Type.: Feature
|
||||||
File.: Host
|
File.: Host
|
||||||
Desc.: Added option --opencl-platform to select a single OpenCL platform in case multiple OpenCL platforms are present
|
Desc.: Added support to utilize multiple different OpenCL platforms in parallel, ex: AMD + NV
|
||||||
Issue: 2
|
Issue: 2
|
||||||
|
|
||||||
Type.: Feature
|
Type.: Feature
|
||||||
File.: Host
|
File.: Host
|
||||||
Desc.: Added option --opencl-device-types to filter for specific OpenCL device types
|
Desc.: Added support to utilize OpenCL devices-types other than GPU, ex: CPU or FPGA
|
||||||
|
Issue: 2
|
||||||
|
|
||||||
|
Type.: Feature
|
||||||
|
File.: Host
|
||||||
|
Desc.: Added support to utilize multiple different OpenCL devices-types in parallel, ex: GPU + CPU
|
||||||
|
Issue: 2
|
||||||
|
|
||||||
|
Type.: Feature
|
||||||
|
File.: Host
|
||||||
|
Desc.: Added option --opencl-platform to select specific OpenCL platforms
|
||||||
|
Issue: 2
|
||||||
|
|
||||||
|
Type.: Feature
|
||||||
|
File.: Host
|
||||||
|
Desc.: Added option --opencl-device-types to select specific OpenCL device types
|
||||||
Issue: 2
|
Issue: 2
|
||||||
|
|
||||||
Type.: Feature
|
Type.: Feature
|
||||||
@ -51,12 +66,6 @@ Issue: 10
|
|||||||
Type.: Feature
|
Type.: Feature
|
||||||
File.: Host
|
File.: Host
|
||||||
Desc.: Moved rules_optimize to hashcat-utils
|
Desc.: Moved rules_optimize to hashcat-utils
|
||||||
Issue: 2
|
|
||||||
|
|
||||||
Type.: Change
|
|
||||||
File.: Host
|
|
||||||
Desc.: Renamed option --gpu-devices to --opencl-devices
|
|
||||||
Issue: 2
|
|
||||||
|
|
||||||
Type.: Change
|
Type.: Change
|
||||||
File.: Host
|
File.: Host
|
||||||
@ -68,6 +77,11 @@ File.: Host
|
|||||||
Desc.: Renamed option --gpu-loops to --kernel-loops
|
Desc.: Renamed option --gpu-loops to --kernel-loops
|
||||||
Issue: 2
|
Issue: 2
|
||||||
|
|
||||||
|
Type.: Change
|
||||||
|
File.: Host
|
||||||
|
Desc.: Renamed option --gpu-devices to --opencl-devices
|
||||||
|
Issue: 2
|
||||||
|
|
||||||
Type.: Bug
|
Type.: Bug
|
||||||
File.: Host
|
File.: Host
|
||||||
Desc.: Fixed a bug in combination of --restore and a user immediately aborting the session after restart
|
Desc.: Fixed a bug in combination of --restore and a user immediately aborting the session after restart
|
||||||
|
@ -185,8 +185,8 @@ _oclHashcat ()
|
|||||||
local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s'
|
local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s'
|
||||||
|
|
||||||
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 -s -l"
|
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 -s -l"
|
||||||
local LONG_OPTS="--hash-type --attack-mode --version --help --eula --quiet --benchmark --benchmark-mode --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --status-automat --loopback --weak-hash-threshold --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --restore --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --separator --show --left --username --remove --remove-timer --potfile-disable --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platform --opencl-device-types --workload-profile --kernel-accel --kernel-loops --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 --rules-cleanup --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles"
|
local LONG_OPTS="--hash-type --attack-mode --version --help --eula --quiet --benchmark --benchmark-mode --hex-salt --hex-wordlist --hex-charset --force --status --status-timer --status-automat --loopback --weak-hash-threshold --markov-hcstat --markov-disable --markov-classic --markov-threshold --runtime --session --restore --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --separator --show --left --username --remove --remove-timer --potfile-disable --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platforms --opencl-device-types --workload-profile --kernel-accel --kernel-loops --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 --rules-cleanup --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --truecrypt-keyfiles"
|
||||||
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 --benchmark-mode --status-timer --weak-hash-threshold --markov-hcstat --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platform --opencl-device-types --workload-profile --kernel-accel --kernel-loops --gpu-temp-abort --gpu-temp-retain -disable --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"
|
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 --benchmark-mode --status-timer --weak-hash-threshold --markov-hcstat --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --opencl-devices --opencl-platforms --opencl-device-types --workload-profile --kernel-accel --kernel-loops --gpu-temp-abort --gpu-temp-retain -disable --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"
|
||||||
|
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
@ -271,7 +271,7 @@ _oclHashcat ()
|
|||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--opencl-platform)
|
--opencl-platforms)
|
||||||
local icd_list=$(ls -1 /etc/OpenCL/vendors/*.icd 2> /dev/null)
|
local icd_list=$(ls -1 /etc/OpenCL/vendors/*.icd 2> /dev/null)
|
||||||
|
|
||||||
local architecture=$(getconf LONG_BIT 2> /dev/null)
|
local architecture=$(getconf LONG_BIT 2> /dev/null)
|
||||||
|
@ -11,17 +11,9 @@
|
|||||||
|
|
||||||
#if VENDOR_ID == 4098
|
#if VENDOR_ID == 4098
|
||||||
#define IS_AMD
|
#define IS_AMD
|
||||||
#endif
|
#elif VENDOR_ID == 4318
|
||||||
|
|
||||||
#if VENDOR_ID == 4318
|
|
||||||
#define IS_NV
|
#define IS_NV
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
#if VENDOR_ID == 9998 // temporary for dev
|
|
||||||
#define IS_GENERIC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if VENDOR_ID == 9999
|
|
||||||
#define IS_GENERIC
|
#define IS_GENERIC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1635,9 +1635,12 @@ void handle_left_request (pot_t *pot, uint pot_cnt, char *input_buf, int input_l
|
|||||||
void handle_show_request_lm (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
|
void handle_show_request_lm (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
|
||||||
void handle_left_request_lm (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
|
void handle_left_request_lm (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
|
||||||
|
|
||||||
|
uint setup_opencl_platforms_filter (char *opencl_platforms);
|
||||||
uint devices_to_devicemask (char *opencl_devices);
|
uint devices_to_devicemask (char *opencl_devices);
|
||||||
cl_device_type setup_device_types_filter (char *opencl_device_types);
|
cl_device_type setup_device_types_filter (char *opencl_device_types);
|
||||||
|
|
||||||
uint get_random_num (uint min, uint max);
|
uint get_random_num (uint min, uint max);
|
||||||
|
|
||||||
uint32_t mydivc32 (const uint32_t dividend, const uint32_t divisor);
|
uint32_t mydivc32 (const uint32_t dividend, const uint32_t divisor);
|
||||||
uint64_t mydivc64 (const uint64_t dividend, const uint64_t divisor);
|
uint64_t mydivc64 (const uint64_t dividend, const uint64_t divisor);
|
||||||
|
|
||||||
@ -1674,24 +1677,24 @@ void fsync (int fd);
|
|||||||
|
|
||||||
int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX]);
|
int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX]);
|
||||||
|
|
||||||
int get_adapters_num_amd (HM_LIB hm_dll, int *iNumberAdapters);
|
int get_adapters_num_amd (HM_LIB hm_dll_amd, int *iNumberAdapters);
|
||||||
|
|
||||||
int hm_get_device_num (HM_LIB hm_dll, HM_ADAPTER_AMD hm_adapter_index, int *hm_device_num);
|
int hm_get_device_num (HM_LIB hm_dll_amd, HM_ADAPTER_AMD hm_adapter_index, int *hm_device_num);
|
||||||
|
|
||||||
// void hm_get_opencl_busid_devid (hm_attrs_t *hm_device, uint opencl_num_devices, cl_device_id *devices);
|
// void hm_get_opencl_busid_devid (hm_attrs_t *hm_device, uint opencl_num_devices, cl_device_id *devices);
|
||||||
|
|
||||||
int hm_get_adapter_index_amd (hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
|
int hm_get_adapter_index_amd (hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
|
||||||
|
|
||||||
LPAdapterInfo hm_get_adapter_info_amd (HM_LIB hm_dll, int iNumberAdapters);
|
LPAdapterInfo hm_get_adapter_info_amd (HM_LIB hm_dll_amd, int iNumberAdapters);
|
||||||
|
|
||||||
uint32_t *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adapters, LPAdapterInfo lpAdapterInfo);
|
uint32_t *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adapters, LPAdapterInfo lpAdapterInfo);
|
||||||
|
|
||||||
int hm_get_overdrive_version (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
|
int hm_get_overdrive_version (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
|
||||||
int hm_check_fanspeed_control (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
|
int hm_check_fanspeed_control (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
|
||||||
|
|
||||||
void hm_close (HM_LIB hm_dll);
|
void hm_close (HM_LIB hm_dll);
|
||||||
|
|
||||||
HM_LIB hm_init ();
|
HM_LIB hm_init (const cl_uint vendor_id);
|
||||||
|
|
||||||
int hm_get_temperature_with_device_id (const uint device_id);
|
int hm_get_temperature_with_device_id (const uint device_id);
|
||||||
int hm_get_fanspeed_with_device_id (const uint device_id);
|
int hm_get_fanspeed_with_device_id (const uint device_id);
|
||||||
|
@ -886,6 +886,8 @@ struct __hc_device_param
|
|||||||
char *device_version;
|
char *device_version;
|
||||||
char *driver_version;
|
char *driver_version;
|
||||||
|
|
||||||
|
cl_uint vendor_id;
|
||||||
|
|
||||||
cl_device_id device;
|
cl_device_id device;
|
||||||
cl_device_type device_type;
|
cl_device_type device_type;
|
||||||
|
|
||||||
@ -971,9 +973,11 @@ typedef struct __hc_device_param hc_device_param_t;
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
union {
|
union
|
||||||
|
{
|
||||||
HM_ADAPTER_AMD amd;
|
HM_ADAPTER_AMD amd;
|
||||||
HM_ADAPTER_NV nv;
|
HM_ADAPTER_NV nv;
|
||||||
|
|
||||||
} adapter_index;
|
} adapter_index;
|
||||||
|
|
||||||
int od_version;
|
int od_version;
|
||||||
@ -991,8 +995,6 @@ typedef struct
|
|||||||
* threads
|
* threads
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint vendor_id;
|
|
||||||
|
|
||||||
uint devices_status;
|
uint devices_status;
|
||||||
uint devices_cnt;
|
uint devices_cnt;
|
||||||
hc_device_param_t *devices_param;
|
hc_device_param_t *devices_param;
|
||||||
@ -1034,7 +1036,8 @@ typedef struct
|
|||||||
* hardware watchdog
|
* hardware watchdog
|
||||||
*/
|
*/
|
||||||
|
|
||||||
HM_LIB hm_dll;
|
HM_LIB hm_dll_nv;
|
||||||
|
HM_LIB hm_dll_amd;
|
||||||
hm_attrs_t hm_device[DEVICES_MAX];
|
hm_attrs_t hm_device[DEVICES_MAX];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
735
src/oclHashcat.c
735
src/oclHashcat.c
File diff suppressed because it is too large
Load Diff
108
src/shared.c
108
src/shared.c
@ -2658,11 +2658,11 @@ int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX])
|
|||||||
|
|
||||||
for (uint i = 0; i < DEVICES_MAX; i++)
|
for (uint i = 0; i < DEVICES_MAX; i++)
|
||||||
{
|
{
|
||||||
if (hc_NVML_nvmlDeviceGetHandleByIndex (data.hm_dll, 1, i, &nvGPUHandle[i]) != NVML_SUCCESS) break;
|
if (hc_NVML_nvmlDeviceGetHandleByIndex (data.hm_dll_nv, 1, i, &nvGPUHandle[i]) != NVML_SUCCESS) break;
|
||||||
|
|
||||||
//can be used to determine if the device by index matches the cuda device by index
|
//can be used to determine if the device by index matches the cuda device by index
|
||||||
//char name[100]; memset (name, 0, sizeof (name));
|
//char name[100]; memset (name, 0, sizeof (name));
|
||||||
//hc_NVML_nvmlDeviceGetName (data.hm_dll, nvGPUHandle[i], name, sizeof (name) - 1);
|
//hc_NVML_nvmlDeviceGetName (data.hm_dll_nv, nvGPUHandle[i], name, sizeof (name) - 1);
|
||||||
|
|
||||||
pGpuCount++;
|
pGpuCount++;
|
||||||
}
|
}
|
||||||
@ -2689,11 +2689,11 @@ void hm_close (HM_LIB hm_dll)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
HM_LIB hm_init ()
|
HM_LIB hm_init (const cl_uint vendor_id)
|
||||||
{
|
{
|
||||||
HM_LIB hm_dll = NULL;
|
HM_LIB hm_dll = NULL;
|
||||||
|
|
||||||
if (data.vendor_id == VENDOR_ID_AMD)
|
if (vendor_id == VENDOR_ID_AMD)
|
||||||
{
|
{
|
||||||
#ifdef _POSIX
|
#ifdef _POSIX
|
||||||
hm_dll = dlopen ("libatiadlxx.so", RTLD_LAZY | RTLD_GLOBAL);
|
hm_dll = dlopen ("libatiadlxx.so", RTLD_LAZY | RTLD_GLOBAL);
|
||||||
@ -2710,7 +2710,7 @@ HM_LIB hm_init ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
if (data.vendor_id == VENDOR_ID_NV)
|
if (vendor_id == VENDOR_ID_NV)
|
||||||
{
|
{
|
||||||
hm_dll = dlopen ("libnvidia-ml.so", RTLD_LAZY | RTLD_GLOBAL);
|
hm_dll = dlopen ("libnvidia-ml.so", RTLD_LAZY | RTLD_GLOBAL);
|
||||||
}
|
}
|
||||||
@ -2719,9 +2719,9 @@ HM_LIB hm_init ()
|
|||||||
return hm_dll;
|
return hm_dll;
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_adapters_num_amd (HM_LIB hm_dll, int *iNumberAdapters)
|
int get_adapters_num_amd (HM_LIB hm_dll_amd, int *iNumberAdapters)
|
||||||
{
|
{
|
||||||
if (hc_ADL_Adapter_NumberOfAdapters_Get (hm_dll, iNumberAdapters) != ADL_OK) return -1;
|
if (hc_ADL_Adapter_NumberOfAdapters_Get (hm_dll_amd, iNumberAdapters) != ADL_OK) return -1;
|
||||||
|
|
||||||
if (iNumberAdapters == 0)
|
if (iNumberAdapters == 0)
|
||||||
{
|
{
|
||||||
@ -2769,13 +2769,13 @@ int hm_show_performance_level (HM_LIB hm_dll, int iAdapterIndex)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LPAdapterInfo hm_get_adapter_info_amd (HM_LIB hm_dll, int iNumberAdapters)
|
LPAdapterInfo hm_get_adapter_info_amd (HM_LIB hm_dll_amd, int iNumberAdapters)
|
||||||
{
|
{
|
||||||
size_t AdapterInfoSize = iNumberAdapters * sizeof (AdapterInfo);
|
size_t AdapterInfoSize = iNumberAdapters * sizeof (AdapterInfo);
|
||||||
|
|
||||||
LPAdapterInfo lpAdapterInfo = (LPAdapterInfo) mymalloc (AdapterInfoSize);
|
LPAdapterInfo lpAdapterInfo = (LPAdapterInfo) mymalloc (AdapterInfoSize);
|
||||||
|
|
||||||
if (hc_ADL_Adapter_AdapterInfo_Get (hm_dll, lpAdapterInfo, AdapterInfoSize) != ADL_OK) return NULL;
|
if (hc_ADL_Adapter_AdapterInfo_Get (hm_dll_amd, lpAdapterInfo, AdapterInfoSize) != ADL_OK) return NULL;
|
||||||
|
|
||||||
return lpAdapterInfo;
|
return lpAdapterInfo;
|
||||||
}
|
}
|
||||||
@ -2934,7 +2934,7 @@ uint32_t *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adap
|
|||||||
return adl_adapters;
|
return adl_adapters;
|
||||||
}
|
}
|
||||||
|
|
||||||
int hm_check_fanspeed_control (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo)
|
int hm_check_fanspeed_control (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo)
|
||||||
{
|
{
|
||||||
// loop through all valid devices
|
// loop through all valid devices
|
||||||
|
|
||||||
@ -2952,7 +2952,7 @@ int hm_check_fanspeed_control (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *v
|
|||||||
|
|
||||||
int opencl_device_index = i;
|
int opencl_device_index = i;
|
||||||
|
|
||||||
// if (hm_show_performance_level (hm_dll, info.iAdapterIndex) != 0) return -1;
|
// if (hm_show_performance_level (hm_dll_amd, info.iAdapterIndex) != 0) return -1;
|
||||||
|
|
||||||
// get fanspeed info
|
// get fanspeed info
|
||||||
|
|
||||||
@ -2964,7 +2964,7 @@ int hm_check_fanspeed_control (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *v
|
|||||||
|
|
||||||
FanSpeedInfo.iSize = sizeof (ADLFanSpeedInfo);
|
FanSpeedInfo.iSize = sizeof (ADLFanSpeedInfo);
|
||||||
|
|
||||||
if (hc_ADL_Overdrive5_FanSpeedInfo_Get (hm_dll, info.iAdapterIndex, 0, &FanSpeedInfo) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive5_FanSpeedInfo_Get (hm_dll_amd, info.iAdapterIndex, 0, &FanSpeedInfo) != ADL_OK) return -1;
|
||||||
|
|
||||||
// check read and write capability in fanspeedinfo
|
// check read and write capability in fanspeedinfo
|
||||||
|
|
||||||
@ -2984,7 +2984,7 @@ int hm_check_fanspeed_control (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *v
|
|||||||
|
|
||||||
memset (&faninfo, 0, sizeof (faninfo));
|
memset (&faninfo, 0, sizeof (faninfo));
|
||||||
|
|
||||||
if (hc_ADL_Overdrive6_FanSpeed_Get (hm_dll, info.iAdapterIndex, &faninfo) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive6_FanSpeed_Get (hm_dll_amd, info.iAdapterIndex, &faninfo) != ADL_OK) return -1;
|
||||||
|
|
||||||
// check read capability in fanspeedinfo
|
// check read capability in fanspeedinfo
|
||||||
|
|
||||||
@ -3002,7 +3002,7 @@ int hm_check_fanspeed_control (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *v
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int hm_get_overdrive_version (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo)
|
int hm_get_overdrive_version (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < num_adl_adapters; i++)
|
for (int i = 0; i < num_adl_adapters; i++)
|
||||||
{
|
{
|
||||||
@ -3018,7 +3018,7 @@ int hm_get_overdrive_version (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *va
|
|||||||
int od_enabled = 0;
|
int od_enabled = 0;
|
||||||
int od_version = 0;
|
int od_version = 0;
|
||||||
|
|
||||||
if (hc_ADL_Overdrive_Caps (hm_dll, info.iAdapterIndex, &od_supported, &od_enabled, &od_version) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive_Caps (hm_dll_amd, info.iAdapterIndex, &od_supported, &od_enabled, &od_version) != ADL_OK) return -1;
|
||||||
|
|
||||||
// store the overdrive version in hm_device
|
// store the overdrive version in hm_device
|
||||||
|
|
||||||
@ -3062,9 +3062,9 @@ int hm_get_temperature_with_device_id (const uint device_id)
|
|||||||
{
|
{
|
||||||
if ((data.devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) return -1;
|
if ((data.devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) return -1;
|
||||||
|
|
||||||
if (data.vendor_id == VENDOR_ID_AMD)
|
if (data.devices_param[device_id].vendor_id == VENDOR_ID_AMD)
|
||||||
{
|
{
|
||||||
if (data.hm_dll)
|
if (data.hm_dll_amd)
|
||||||
{
|
{
|
||||||
if (data.hm_device[device_id].od_version == 5)
|
if (data.hm_device[device_id].od_version == 5)
|
||||||
{
|
{
|
||||||
@ -3072,7 +3072,7 @@ int hm_get_temperature_with_device_id (const uint device_id)
|
|||||||
|
|
||||||
Temperature.iSize = sizeof (ADLTemperature);
|
Temperature.iSize = sizeof (ADLTemperature);
|
||||||
|
|
||||||
if (hc_ADL_Overdrive5_Temperature_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, 0, &Temperature) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive5_Temperature_Get (data.hm_dll_amd, data.hm_device[device_id].adapter_index.amd, 0, &Temperature) != ADL_OK) return -1;
|
||||||
|
|
||||||
return Temperature.iTemperature / 1000;
|
return Temperature.iTemperature / 1000;
|
||||||
}
|
}
|
||||||
@ -3080,19 +3080,18 @@ int hm_get_temperature_with_device_id (const uint device_id)
|
|||||||
{
|
{
|
||||||
int Temperature = 0;
|
int Temperature = 0;
|
||||||
|
|
||||||
if (hc_ADL_Overdrive6_Temperature_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &Temperature) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive6_Temperature_Get (data.hm_dll_amd, data.hm_device[device_id].adapter_index.amd, &Temperature) != ADL_OK) return -1;
|
||||||
|
|
||||||
return Temperature / 1000;
|
return Temperature / 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (data.devices_param[device_id].vendor_id == VENDOR_ID_NV)
|
||||||
if (data.vendor_id == VENDOR_ID_NV)
|
|
||||||
{
|
{
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
int temperature = 0;
|
int temperature = 0;
|
||||||
|
|
||||||
hc_NVML_nvmlDeviceGetTemperature (data.hm_dll, data.hm_device[device_id].adapter_index.nv, NVML_TEMPERATURE_GPU, (unsigned int *) &temperature);
|
hc_NVML_nvmlDeviceGetTemperature (data.hm_dll_nv, data.hm_device[device_id].adapter_index.nv, NVML_TEMPERATURE_GPU, (unsigned int *) &temperature);
|
||||||
|
|
||||||
return temperature;
|
return temperature;
|
||||||
#endif
|
#endif
|
||||||
@ -3121,9 +3120,9 @@ int hm_get_fanspeed_with_device_id (const uint device_id)
|
|||||||
|
|
||||||
if (data.hm_device[device_id].fan_supported == 1)
|
if (data.hm_device[device_id].fan_supported == 1)
|
||||||
{
|
{
|
||||||
if (data.vendor_id == VENDOR_ID_AMD)
|
if (data.devices_param[device_id].vendor_id == VENDOR_ID_AMD)
|
||||||
{
|
{
|
||||||
if (data.hm_dll)
|
if (data.hm_dll_amd)
|
||||||
{
|
{
|
||||||
if (data.hm_device[device_id].od_version == 5)
|
if (data.hm_device[device_id].od_version == 5)
|
||||||
{
|
{
|
||||||
@ -3135,7 +3134,7 @@ int hm_get_fanspeed_with_device_id (const uint device_id)
|
|||||||
lpFanSpeedValue.iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT;
|
lpFanSpeedValue.iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT;
|
||||||
lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED;
|
lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED;
|
||||||
|
|
||||||
if (hc_ADL_Overdrive5_FanSpeed_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, 0, &lpFanSpeedValue) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive5_FanSpeed_Get (data.hm_dll_amd, data.hm_device[device_id].adapter_index.amd, 0, &lpFanSpeedValue) != ADL_OK) return -1;
|
||||||
|
|
||||||
return lpFanSpeedValue.iFanSpeed;
|
return lpFanSpeedValue.iFanSpeed;
|
||||||
}
|
}
|
||||||
@ -3145,19 +3144,18 @@ int hm_get_fanspeed_with_device_id (const uint device_id)
|
|||||||
|
|
||||||
memset (&faninfo, 0, sizeof (faninfo));
|
memset (&faninfo, 0, sizeof (faninfo));
|
||||||
|
|
||||||
if (hc_ADL_Overdrive6_FanSpeed_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &faninfo) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive6_FanSpeed_Get (data.hm_dll_amd, data.hm_device[device_id].adapter_index.amd, &faninfo) != ADL_OK) return -1;
|
||||||
|
|
||||||
return faninfo.iFanSpeedPercent;
|
return faninfo.iFanSpeedPercent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (data.devices_param[device_id].vendor_id == VENDOR_ID_NV)
|
||||||
if (data.vendor_id == VENDOR_ID_NV)
|
|
||||||
{
|
{
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
int speed = 0;
|
int speed = 0;
|
||||||
|
|
||||||
hc_NVML_nvmlDeviceGetFanSpeed (data.hm_dll, 1, data.hm_device[device_id].adapter_index.nv, (unsigned int *) &speed);
|
hc_NVML_nvmlDeviceGetFanSpeed (data.hm_dll_nv, 1, data.hm_device[device_id].adapter_index.nv, (unsigned int *) &speed);
|
||||||
|
|
||||||
return speed;
|
return speed;
|
||||||
#endif
|
#endif
|
||||||
@ -3179,26 +3177,25 @@ int hm_get_utilization_with_device_id (const uint device_id)
|
|||||||
{
|
{
|
||||||
if ((data.devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) return -1;
|
if ((data.devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) return -1;
|
||||||
|
|
||||||
if (data.vendor_id == VENDOR_ID_AMD)
|
if (data.devices_param[device_id].vendor_id == VENDOR_ID_AMD)
|
||||||
{
|
{
|
||||||
if (data.hm_dll)
|
if (data.hm_dll_amd)
|
||||||
{
|
{
|
||||||
ADLPMActivity PMActivity;
|
ADLPMActivity PMActivity;
|
||||||
|
|
||||||
PMActivity.iSize = sizeof (ADLPMActivity);
|
PMActivity.iSize = sizeof (ADLPMActivity);
|
||||||
|
|
||||||
if (hc_ADL_Overdrive_CurrentActivity_Get (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &PMActivity) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive_CurrentActivity_Get (data.hm_dll_amd, data.hm_device[device_id].adapter_index.amd, &PMActivity) != ADL_OK) return -1;
|
||||||
|
|
||||||
return PMActivity.iActivityPercent;
|
return PMActivity.iActivityPercent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (data.devices_param[device_id].vendor_id == VENDOR_ID_NV)
|
||||||
if (data.vendor_id == VENDOR_ID_NV)
|
|
||||||
{
|
{
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
nvmlUtilization_t utilization;
|
nvmlUtilization_t utilization;
|
||||||
|
|
||||||
hc_NVML_nvmlDeviceGetUtilizationRates (data.hm_dll, data.hm_device[device_id].adapter_index.nv, &utilization);
|
hc_NVML_nvmlDeviceGetUtilizationRates (data.hm_dll_nv, data.hm_device[device_id].adapter_index.nv, &utilization);
|
||||||
|
|
||||||
return utilization.gpu;
|
return utilization.gpu;
|
||||||
#endif
|
#endif
|
||||||
@ -3221,7 +3218,7 @@ int hm_set_fanspeed_with_device_id_amd (const uint device_id, const int fanspeed
|
|||||||
{
|
{
|
||||||
if (data.hm_device[device_id].fan_supported == 1)
|
if (data.hm_device[device_id].fan_supported == 1)
|
||||||
{
|
{
|
||||||
if (data.hm_dll)
|
if (data.hm_dll_amd)
|
||||||
{
|
{
|
||||||
if (data.hm_device[device_id].od_version == 5)
|
if (data.hm_device[device_id].od_version == 5)
|
||||||
{
|
{
|
||||||
@ -3234,7 +3231,7 @@ int hm_set_fanspeed_with_device_id_amd (const uint device_id, const int fanspeed
|
|||||||
lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED;
|
lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED;
|
||||||
lpFanSpeedValue.iFanSpeed = fanspeed;
|
lpFanSpeedValue.iFanSpeed = fanspeed;
|
||||||
|
|
||||||
if (hc_ADL_Overdrive5_FanSpeed_Set (data.hm_dll, data.hm_device[device_id].adapter_index.amd, 0, &lpFanSpeedValue) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive5_FanSpeed_Set (data.hm_dll_amd, data.hm_device[device_id].adapter_index.amd, 0, &lpFanSpeedValue) != ADL_OK) return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3247,7 +3244,7 @@ int hm_set_fanspeed_with_device_id_amd (const uint device_id, const int fanspeed
|
|||||||
fan_speed_value.iSpeedType = ADL_OD6_FANSPEED_TYPE_PERCENT;
|
fan_speed_value.iSpeedType = ADL_OD6_FANSPEED_TYPE_PERCENT;
|
||||||
fan_speed_value.iFanSpeed = fanspeed;
|
fan_speed_value.iFanSpeed = fanspeed;
|
||||||
|
|
||||||
if (hc_ADL_Overdrive6_FanSpeed_Set (data.hm_dll, data.hm_device[device_id].adapter_index.amd, &fan_speed_value) != ADL_OK) return -1;
|
if (hc_ADL_Overdrive6_FanSpeed_Set (data.hm_dll_amd, data.hm_device[device_id].adapter_index.amd, &fan_speed_value) != ADL_OK) return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -5106,6 +5103,41 @@ void handle_left_request_lm (pot_t *pot, uint pot_cnt, char *input_buf, int inpu
|
|||||||
if (weak_hash_found == 1) myfree (pot_right_ptr);
|
if (weak_hash_found == 1) myfree (pot_right_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint setup_opencl_platforms_filter (char *opencl_platforms)
|
||||||
|
{
|
||||||
|
uint opencl_platforms_filter = 0;
|
||||||
|
|
||||||
|
if (opencl_platforms)
|
||||||
|
{
|
||||||
|
char *platforms = strdup (opencl_platforms);
|
||||||
|
|
||||||
|
char *next = strtok (platforms, ",");
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
int platform = atoi (next);
|
||||||
|
|
||||||
|
if (platform < 1 || platform > 31)
|
||||||
|
{
|
||||||
|
log_error ("ERROR: invalid OpenCL platform %u specified", platform);
|
||||||
|
|
||||||
|
exit (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
opencl_platforms_filter |= 1 << (platform - 1);
|
||||||
|
|
||||||
|
} while ((next = strtok (NULL, ",")) != NULL);
|
||||||
|
|
||||||
|
free (platforms);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
opencl_platforms_filter = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return opencl_platforms_filter;
|
||||||
|
}
|
||||||
|
|
||||||
cl_device_type setup_device_types_filter (char *opencl_device_types)
|
cl_device_type setup_device_types_filter (char *opencl_device_types)
|
||||||
{
|
{
|
||||||
cl_device_type device_types_filter = 0;
|
cl_device_type device_types_filter = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user