+1
-1
@@ -360,7 +360,7 @@ EMU_OBJS_ALL += emu_inc_rp emu_inc_rp_optimized
|
||||
EMU_OBJS_ALL += emu_inc_hash_md4 emu_inc_hash_md5 emu_inc_hash_ripemd160 emu_inc_hash_sha1 emu_inc_hash_sha256 emu_inc_hash_sha384 emu_inc_hash_sha512 emu_inc_hash_streebog256 emu_inc_hash_streebog512 emu_inc_ecc_secp256k1
|
||||
EMU_OBJS_ALL += emu_inc_cipher_aes emu_inc_cipher_camellia emu_inc_cipher_des emu_inc_cipher_kuznyechik emu_inc_cipher_serpent emu_inc_cipher_twofish
|
||||
|
||||
OBJS_ALL := affinity autotune backend benchmark bitmap bitops combinator common convert cpt cpu_crc32 debugfile dictstat dispatch dynloader event ext_ADL ext_cuda ext_nvapi ext_nvml ext_nvrtc ext_OpenCL ext_sysfs_amdgpu ext_sysfs_cpu ext_iokit ext_lzma filehandling folder hashcat hashes hlfmt hwmon induct interface keyboard_layout locking logfile loopback memory monitor mpsp outfile_check outfile pidfile potfile restore rp rp_cpu selftest slow_candidates shared status stdout straight terminal thread timer tuningdb usage user_options wordlist $(EMU_OBJS_ALL)
|
||||
OBJS_ALL := affinity autotune backend benchmark bitmap bitops combinator common convert cpt cpu_crc32 debugfile dictstat dispatch dynloader event ext_ADL ext_cuda ext_hip ext_nvapi ext_nvml ext_nvrtc ext_hiprtc ext_OpenCL ext_sysfs_amdgpu ext_sysfs_cpu ext_iokit ext_lzma filehandling folder hashcat hashes hlfmt hwmon induct interface keyboard_layout locking logfile loopback memory monitor mpsp outfile_check outfile pidfile potfile restore rp rp_cpu selftest slow_candidates shared status stdout straight terminal thread timer tuningdb usage user_options wordlist $(EMU_OBJS_ALL)
|
||||
|
||||
ifeq ($(ENABLE_BRAIN),1)
|
||||
OBJS_ALL += brain
|
||||
|
||||
+52
-3
@@ -157,8 +157,9 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
|
||||
const u32 kernel_power_max = device_param->hardware_power * kernel_accel_max;
|
||||
|
||||
int CL_rc;
|
||||
int CU_rc;
|
||||
int HIP_rc;
|
||||
int CL_rc;
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
@@ -167,6 +168,13 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (CU_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
HIP_rc = run_hip_kernel_atinit (hashcat_ctx, device_param, device_param->hip_d_pws_buf, kernel_power_max);
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
CL_rc = run_opencl_kernel_atinit (hashcat_ctx, device_param, device_param->opencl_d_pws_buf, kernel_power_max);
|
||||
@@ -190,6 +198,13 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (CU_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
HIP_rc = hc_hipMemcpyDtoD (hashcat_ctx, device_param->hip_d_rules_c, device_param->hip_d_rules, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t));
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
CL_rc = hc_clEnqueueCopyBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_rules, device_param->opencl_d_rules_c, 0, 0, MIN (kernel_loops_max, KERNEL_RULES) * sizeof (kernel_rule_t), 0, NULL, NULL);
|
||||
@@ -383,6 +398,27 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (CU_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
int HIP_rc;
|
||||
|
||||
HIP_rc = run_hip_kernel_memset (hashcat_ctx, device_param, device_param->hip_d_pws_buf, 0, device_param->size_pws);
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
|
||||
HIP_rc = run_hip_kernel_memset (hashcat_ctx, device_param, device_param->hip_d_plain_bufs, 0, device_param->size_plains);
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
|
||||
HIP_rc = run_hip_kernel_memset (hashcat_ctx, device_param, device_param->hip_d_digests_shown, 0, device_param->size_shown);
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
|
||||
HIP_rc = run_hip_kernel_memset (hashcat_ctx, device_param, device_param->hip_d_result, 0, device_param->size_results);
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
int CL_rc;
|
||||
@@ -451,9 +487,12 @@ HC_API_CALL void *thread_autotune (void *p)
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
const int rc_cuCtxSetCurrent = hc_cuCtxSetCurrent (hashcat_ctx, device_param->cuda_context);
|
||||
if (hc_cuCtxPushCurrent (hashcat_ctx, device_param->cuda_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (rc_cuCtxSetCurrent == -1) return NULL;
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipCtxPushCurrent (hashcat_ctx, device_param->hip_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
const int rc_autotune = autotune (hashcat_ctx, device_param);
|
||||
@@ -463,5 +502,15 @@ HC_API_CALL void *thread_autotune (void *p)
|
||||
// we should do something here, tell hashcat main that autotune failed to abort
|
||||
}
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
if (hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipCtxPopCurrent (hashcat_ctx, &device_param->hip_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+3932
-27
File diff suppressed because it is too large
Load Diff
+32
-2
@@ -347,7 +347,12 @@ HC_API_CALL void *thread_calc_stdin (void *p)
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
if (hc_cuCtxSetCurrent (hashcat_ctx, device_param->cuda_context) == -1) return NULL;
|
||||
if (hc_cuCtxPushCurrent (hashcat_ctx, device_param->cuda_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipCtxPushCurrent (hashcat_ctx, device_param->hip_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (calc_stdin (hashcat_ctx, device_param) == -1)
|
||||
@@ -357,6 +362,16 @@ HC_API_CALL void *thread_calc_stdin (void *p)
|
||||
status_ctx->devices_status = STATUS_ERROR;
|
||||
}
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
if (hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipCtxPopCurrent (hashcat_ctx, &device_param->hip_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1581,7 +1596,12 @@ HC_API_CALL void *thread_calc (void *p)
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
if (hc_cuCtxSetCurrent (hashcat_ctx, device_param->cuda_context) == -1) return NULL;
|
||||
if (hc_cuCtxPushCurrent (hashcat_ctx, device_param->cuda_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipCtxPushCurrent (hashcat_ctx, device_param->hip_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (calc (hashcat_ctx, device_param) == -1)
|
||||
@@ -1591,5 +1611,15 @@ HC_API_CALL void *thread_calc (void *p)
|
||||
status_ctx->devices_status = STATUS_ERROR;
|
||||
}
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
if (hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipCtxPopCurrent (hashcat_ctx, &device_param->hip_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "types.h"
|
||||
#include "ext_hip.h"
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "types.h"
|
||||
#include "ext_hiprtc.h"
|
||||
|
||||
int hiprtc_make_options_array_from_string (char *string, char **options)
|
||||
{
|
||||
char *saveptr = NULL;
|
||||
|
||||
char *next = strtok_r (string, " ", &saveptr);
|
||||
|
||||
int cnt = 0;
|
||||
|
||||
do
|
||||
{
|
||||
options[cnt] = next;
|
||||
|
||||
cnt++;
|
||||
|
||||
} while ((next = strtok_r ((char *) NULL, " ", &saveptr)) != NULL);
|
||||
|
||||
return cnt;
|
||||
}
|
||||
@@ -322,6 +322,11 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
||||
hc_cuMemcpyDtoH (hashcat_ctx, tmps, device_param->cuda_d_tmps + (plain->gidvid * hashconfig->tmp_size), hashconfig->tmp_size);
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
hc_hipMemcpyDtoH (hashcat_ctx, tmps, device_param->hip_d_tmps + (plain->gidvid * hashconfig->tmp_size), hashconfig->tmp_size);
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_tmps, CL_TRUE, plain->gidvid * hashconfig->tmp_size, hashconfig->tmp_size, tmps, 0, NULL, NULL);
|
||||
@@ -481,6 +486,7 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
|
||||
u32 num_cracked = 0;
|
||||
|
||||
int CU_rc;
|
||||
int HIP_rc;
|
||||
int CL_rc;
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
@@ -490,6 +496,13 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
|
||||
if (CU_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
HIP_rc = hc_hipMemcpyDtoH (hashcat_ctx, &num_cracked, device_param->hip_d_result, sizeof (u32));
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
CL_rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL);
|
||||
@@ -516,6 +529,13 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
|
||||
if (CU_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
HIP_rc = hc_hipMemcpyDtoH (hashcat_ctx, cracked, device_param->hip_d_plain_bufs, num_cracked * sizeof (plain_t));
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
CL_rc = hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_plain_bufs, CL_TRUE, 0, num_cracked * sizeof (plain_t), cracked, 0, NULL, NULL);
|
||||
@@ -573,6 +593,13 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
|
||||
if (CU_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
HIP_rc = hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_digests_shown + (salt_buf->digests_offset * sizeof (u32)), &hashes->digests_shown_tmp[salt_buf->digests_offset], salt_buf->digests_cnt * sizeof (u32));
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_digests_shown, CL_TRUE, salt_buf->digests_offset * sizeof (u32), salt_buf->digests_cnt * sizeof (u32), &hashes->digests_shown_tmp[salt_buf->digests_offset], 0, NULL, NULL);
|
||||
@@ -611,6 +638,13 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param)
|
||||
if (CU_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
HIP_rc = hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_result, &num_cracked, sizeof (u32));
|
||||
|
||||
if (HIP_rc == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL);
|
||||
|
||||
+26
-26
@@ -95,11 +95,11 @@ int hm_get_threshold_slowdown_with_devices_idx (hashcat_ctx_t *hashcat_ctx, cons
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
{
|
||||
@@ -176,11 +176,11 @@ int hm_get_threshold_shutdown_with_devices_idx (hashcat_ctx_t *hashcat_ctx, cons
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
{
|
||||
@@ -245,7 +245,7 @@ int hm_get_temperature_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int b
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_CPU)
|
||||
{
|
||||
@@ -313,7 +313,7 @@ int hm_get_temperature_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int b
|
||||
}
|
||||
#endif
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
{
|
||||
@@ -401,11 +401,11 @@ int hm_get_fanpolicy_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int bac
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
{
|
||||
@@ -499,11 +499,11 @@ int hm_get_fanspeed_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int back
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
{
|
||||
@@ -609,11 +609,11 @@ int hm_get_buslanes_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int back
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
{
|
||||
@@ -696,11 +696,11 @@ int hm_get_utilization_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int b
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
{
|
||||
@@ -800,11 +800,11 @@ int hm_get_memoryspeed_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int b
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
{
|
||||
@@ -887,11 +887,11 @@ int hm_get_corespeed_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int bac
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
{
|
||||
@@ -1003,11 +1003,11 @@ int hm_get_throttle_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int back
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->devices_param[backend_device_idx].is_opencl == true)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true))
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1382,11 +1382,11 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
if ((device_param->is_opencl == true) || (device_param->is_hip == true))
|
||||
{
|
||||
if ((device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) == 0) continue;
|
||||
|
||||
if (device_param->opencl_device_vendor_id != VENDOR_ID_AMD) continue;
|
||||
if ((device_param->opencl_device_vendor_id != VENDOR_ID_AMD) && (device_param->opencl_device_vendor_id != VENDOR_ID_AMD_USE_HIP)) continue;
|
||||
|
||||
for (int i = 0; i < tmp_in; i++)
|
||||
{
|
||||
@@ -1438,7 +1438,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
if ((device_param->is_opencl == true) || (device_param->is_hip == true))
|
||||
{
|
||||
const u32 device_id = device_param->device_id;
|
||||
|
||||
@@ -1485,7 +1485,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
if ((device_param->is_opencl == true) || (device_param->is_hip == true))
|
||||
{
|
||||
const u32 device_id = device_param->device_id;
|
||||
|
||||
@@ -1594,7 +1594,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
}
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
if ((device_param->is_opencl == true) || (device_param->is_hip == true))
|
||||
{
|
||||
if (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU)
|
||||
{
|
||||
@@ -1655,7 +1655,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) || (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP))
|
||||
{
|
||||
hwmon_ctx->hm_device[backend_devices_idx].adl = hm_adapters_adl[device_id].adl;
|
||||
hwmon_ctx->hm_device[backend_devices_idx].sysfs_amdgpu = hm_adapters_sysfs_amdgpu[device_id].sysfs_amdgpu;
|
||||
|
||||
@@ -59,6 +59,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -179,6 +179,14 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-DDESCRYPT_SALT=%u -D _unroll", hashes->salts_buf[0].salt_buf[0] & 0xfff);
|
||||
}
|
||||
}
|
||||
// ROCM
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
if ((user_options->attack_mode == ATTACK_MODE_BF) && (hashes->salts_cnt == 1) && (user_options->slow_candidates == false))
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-DDESCRYPT_SALT=%u -D _unroll", hashes->salts_buf[0].salt_buf[0] & 0xfff);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((user_options->attack_mode == ATTACK_MODE_BF) && (hashes->salts_cnt == 1) && (user_options->slow_candidates == false))
|
||||
|
||||
@@ -58,6 +58,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -58,6 +58,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -59,6 +59,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -438,6 +438,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-fno-unroll-loops");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -81,6 +81,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -81,6 +81,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -83,25 +83,6 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
return false;
|
||||
}
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
// Extra treatment for Apple systems
|
||||
if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE)
|
||||
{
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
bool module_potfile_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const bool potfile_disable = true;
|
||||
@@ -303,7 +284,7 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook23 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_salt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_build_options = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_cache_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
|
||||
@@ -83,25 +83,6 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
return false;
|
||||
}
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
// Extra treatment for Apple systems
|
||||
if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE)
|
||||
{
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
bool module_potfile_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const bool potfile_disable = true;
|
||||
@@ -303,7 +284,7 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook23 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_salt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_build_options = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_cache_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
|
||||
@@ -83,25 +83,6 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
return false;
|
||||
}
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
// Extra treatment for Apple systems
|
||||
if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE)
|
||||
{
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
bool module_potfile_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const bool potfile_disable = true;
|
||||
@@ -301,7 +282,7 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook23 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_salt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_build_options = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_cache_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
|
||||
@@ -78,6 +78,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -244,6 +244,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -245,6 +245,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -80,6 +80,17 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
native_threads = 64;
|
||||
}
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
if (device_param->device_local_mem_size < 49152)
|
||||
{
|
||||
native_threads = 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -79,6 +79,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ static const u32 HASH_CATEGORY = HASH_CATEGORY_PASSWORD_MANAGER;
|
||||
static const char *HASH_NAME = "1Password, cloudkeychain";
|
||||
static const u64 KERN_TYPE = 8200;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
||||
| OPTI_TYPE_USES_BITS_64
|
||||
| OPTI_TYPE_SLOW_HASH_SIMD_LOOP;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||
|
||||
@@ -60,6 +60,19 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
|
||||
return pw_max;
|
||||
}
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-fno-unroll-loops");
|
||||
}
|
||||
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len)
|
||||
{
|
||||
u32 *digest = (u32 *) digest_buf;
|
||||
@@ -179,7 +192,7 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook23 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_salt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_cache_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
|
||||
@@ -85,6 +85,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -77,6 +77,10 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -77,6 +77,10 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -58,6 +58,41 @@ static const char *SIGNATURE_OLDOFFICE = "$oldoffice$";
|
||||
static const char *SIGNATURE_OLDOFFICE0 = "$oldoffice$0";
|
||||
static const char *SIGNATURE_OLDOFFICE1 = "$oldoffice$1";
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
u32 native_threads = 0;
|
||||
|
||||
if (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU)
|
||||
{
|
||||
native_threads = 1;
|
||||
}
|
||||
else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK)
|
||||
{
|
||||
native_threads = 8;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
}
|
||||
}
|
||||
|
||||
hc_asprintf (&jit_build_options, "-D FIXED_LOCAL_SIZE=%u -D _unroll", native_threads);
|
||||
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const u64 esalt_size = (const u64) sizeof (oldoffice01_t);
|
||||
@@ -273,7 +308,7 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook23 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_salt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_cache_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
|
||||
@@ -79,6 +79,10 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -78,6 +78,10 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -80,6 +80,10 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -84,6 +84,10 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -85,6 +85,10 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -64,6 +64,41 @@ typedef struct pdf
|
||||
|
||||
static const char *SIGNATURE_PDF = "$pdf$";
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
u32 native_threads = 0;
|
||||
|
||||
if (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU)
|
||||
{
|
||||
native_threads = 1;
|
||||
}
|
||||
else if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU)
|
||||
{
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_INTEL_SDK)
|
||||
{
|
||||
native_threads = 8;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
}
|
||||
}
|
||||
|
||||
hc_asprintf (&jit_build_options, "-D FIXED_LOCAL_SIZE=%u -D _unroll", native_threads);
|
||||
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
const u64 esalt_size = (const u64) sizeof (pdf_t);
|
||||
@@ -369,7 +404,7 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook23 = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_salt_size = MODULE_DEFAULT;
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_cache_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
|
||||
@@ -108,6 +108,10 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -72,6 +72,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -72,6 +72,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -72,6 +72,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -73,6 +73,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -73,6 +73,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -73,6 +73,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -77,6 +77,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -81,6 +81,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -111,6 +111,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -81,6 +81,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -69,6 +69,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -69,6 +69,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -75,6 +75,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -79,6 +79,17 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
native_threads = 64;
|
||||
}
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
if (device_param->device_local_mem_size < 49152)
|
||||
{
|
||||
native_threads = 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -76,6 +76,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -113,6 +113,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -69,6 +69,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -78,6 +78,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -78,6 +78,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -79,6 +79,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -79,6 +79,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -170,6 +170,11 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
// it leads to CL_KERNEL_WORK_GROUP_SIZE to return 0 and later we will divide with 0
|
||||
// workaround would be to rewrite kernel to use global memory
|
||||
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -170,6 +170,11 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
// it leads to CL_KERNEL_WORK_GROUP_SIZE to return 0 and later we will divide with 0
|
||||
// workaround would be to rewrite kernel to use global memory
|
||||
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -170,6 +170,11 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
// it leads to CL_KERNEL_WORK_GROUP_SIZE to return 0 and later we will divide with 0
|
||||
// workaround would be to rewrite kernel to use global memory
|
||||
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -79,6 +79,17 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
native_threads = 64;
|
||||
}
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
if (device_param->device_local_mem_size < 49152)
|
||||
{
|
||||
native_threads = 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -78,6 +78,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -80,6 +80,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -71,6 +71,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -72,6 +72,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -96,6 +96,11 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
}
|
||||
}
|
||||
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// amdgpu-pro-20.50-1234664-ubuntu-20.04 (rocr)
|
||||
// test_1620713931/test_report.log:! unhandled return code 255, cmdline : cat test_1620713931/21800_passwords.txt | ./hashcat --quiet --potfile-disable --runtime 400 --hwmon-disable -O -D 2 --backend-vector-width 4 -a 0 -m 21800 test_1620713931/21800_hashes.txt
|
||||
// test_1620719578/test_report.log:! unhandled return code 255, cmdline : cat test_1620719578/21800_passwords.txt | ./hashcat --quiet --potfile-disable --runtime 400 --hwmon-disable -D 2 --backend-vector-width 4 -a 0 -m 21800 test_1620719578/21800_hashes.txt
|
||||
|
||||
@@ -86,6 +86,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -72,6 +72,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -96,6 +96,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -69,6 +69,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -79,6 +79,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -72,6 +72,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -118,6 +118,17 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
native_threads = 64;
|
||||
}
|
||||
}
|
||||
else if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
if (device_param->device_local_mem_size < 49152)
|
||||
{
|
||||
native_threads = 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 64;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
native_threads = 32;
|
||||
|
||||
@@ -74,6 +74,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -81,6 +81,12 @@ char* module_jit_build_options(MAYBE_UNUSED const hashconfig_t *hashconfig, MAYB
|
||||
hc_asprintf(&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -74,6 +74,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
@@ -74,6 +74,12 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
return jit_build_options;
|
||||
}
|
||||
|
||||
// HIP
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)
|
||||
{
|
||||
hc_asprintf (&jit_build_options, "-D _unroll");
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
|
||||
+134
-5
@@ -32,6 +32,13 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
device_param->kernel_params[18] = &device_param->cuda_d_st_esalts_buf;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
device_param->kernel_params[15] = &device_param->hip_d_st_digests_buf;
|
||||
device_param->kernel_params[17] = &device_param->hip_d_st_salts_buf;
|
||||
device_param->kernel_params[18] = &device_param->hip_d_st_esalts_buf;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
device_param->kernel_params[15] = &device_param->opencl_d_st_digests_buf;
|
||||
@@ -91,6 +98,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -126,6 +138,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -190,6 +207,13 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_combs_c, &comb, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_combs_c, CL_TRUE, 0, 1 * sizeof (pw_t), &comb, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -225,6 +249,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -276,6 +305,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_bfs_c, &bf, 1 * sizeof (bf_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_bfs_c, &bf, 1 * sizeof (bf_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_bfs_c, CL_TRUE, 0, 1 * sizeof (bf_t), &bf, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -372,6 +406,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -400,6 +439,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_pws_buf, &pw, 1 * sizeof (pw_t)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_pws_buf, CL_TRUE, 0, 1 * sizeof (pw_t), &pw, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -446,6 +490,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (run_cuda_kernel_utf8toutf16le (hashcat_ctx, device_param, device_param->cuda_d_pws_buf, 1) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (run_hip_kernel_utf8toutf16le (hashcat_ctx, device_param, device_param->hip_d_pws_buf, 1) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (run_opencl_kernel_utf8toutf16le (hashcat_ctx, device_param, device_param->opencl_d_pws_buf, 1) == -1) return -1;
|
||||
@@ -463,6 +512,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, device_param->size_hooks) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, device_param->size_hooks) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -475,6 +529,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -526,6 +585,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->cuda_d_hooks, device_param->size_hooks) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyDtoH (hashcat_ctx, device_param->hooks_buf, device_param->hip_d_hooks, device_param->size_hooks) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -538,6 +602,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyHtoD (hashcat_ctx, device_param->cuda_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyHtoD (hashcat_ctx, device_param->hip_d_hooks, device_param->hooks_buf, device_param->size_hooks) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_hooks, CL_TRUE, 0, device_param->size_hooks, device_param->hooks_buf, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -617,6 +686,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (hc_cuMemcpyDtoH (hashcat_ctx, &num_cracked, device_param->cuda_d_result, sizeof (u32)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipMemcpyDtoH (hashcat_ctx, &num_cracked, device_param->hip_d_result, sizeof (u32)) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (hc_clEnqueueReadBuffer (hashcat_ctx, device_param->opencl_command_queue, device_param->opencl_d_result, CL_TRUE, 0, sizeof (u32), &num_cracked, 0, NULL, NULL) == -1) return -1;
|
||||
@@ -646,6 +720,20 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_result, device_param->size_results) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
device_param->kernel_params[15] = &device_param->hip_d_digests_buf;
|
||||
device_param->kernel_params[17] = &device_param->hip_d_salt_bufs;
|
||||
device_param->kernel_params[18] = &device_param->hip_d_esalt_bufs;
|
||||
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_pws_buf, device_param->size_pws) == -1) return -1;
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_tmps, device_param->size_tmps) == -1) return -1;
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_hooks, device_param->size_hooks) == -1) return -1;
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_plain_bufs, device_param->size_plains) == -1) return -1;
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_digests_shown, device_param->size_shown) == -1) return -1;
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_result, device_param->size_results) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
device_param->kernel_params[15] = &device_param->opencl_d_digests_buf;
|
||||
@@ -667,6 +755,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_rules_c, device_param->size_rules_c) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_rules_c, device_param->size_rules_c) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_rules_c, device_param->size_rules_c) == -1) return -1;
|
||||
@@ -681,6 +774,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_rules_c, device_param->size_rules_c) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_rules_c, device_param->size_rules_c) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_rules_c, device_param->size_rules_c) == -1) return -1;
|
||||
@@ -693,6 +791,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_combs_c, device_param->size_combs) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_combs_c, device_param->size_combs) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_combs_c, device_param->size_combs) == -1) return -1;
|
||||
@@ -705,6 +808,11 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_bfs_c, device_param->size_bfs) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (run_hip_kernel_bzero (hashcat_ctx, device_param, device_param->hip_d_bfs_c, device_param->size_bfs) == -1) return -1;
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_bfs_c, device_param->size_bfs) == -1) return -1;
|
||||
@@ -718,15 +826,21 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
|
||||
{
|
||||
hc_thread_mutex_lock (status_ctx->mux_display);
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "* Device #%u: ATTENTION! OpenCL kernel self-test failed.", device_param->device_id + 1);
|
||||
}
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "* Device #%u: ATTENTION! CUDA kernel self-test failed.", device_param->device_id + 1);
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "* Device #%u: ATTENTION! HIP kernel self-test failed.", device_param->device_id + 1);
|
||||
}
|
||||
|
||||
if (device_param->is_opencl == true)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "* Device #%u: ATTENTION! OpenCL kernel self-test failed.", device_param->device_id + 1);
|
||||
}
|
||||
|
||||
event_log_warning (hashcat_ctx, "Your device driver installation is probably broken.");
|
||||
event_log_warning (hashcat_ctx, "See also: https://hashcat.net/faq/wrongdriver");
|
||||
event_log_warning (hashcat_ctx, NULL);
|
||||
@@ -761,7 +875,12 @@ HC_API_CALL void *thread_selftest (void *p)
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
if (hc_cuCtxSetCurrent (hashcat_ctx, device_param->cuda_context) == -1) return NULL;
|
||||
if (hc_cuCtxPushCurrent (hashcat_ctx, device_param->cuda_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipCtxPushCurrent (hashcat_ctx, device_param->hip_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
const int rc_selftest = selftest (hashcat_ctx, device_param);
|
||||
@@ -782,5 +901,15 @@ HC_API_CALL void *thread_selftest (void *p)
|
||||
}
|
||||
}
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
if (hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
if (device_param->is_hip == true)
|
||||
{
|
||||
if (hc_hipCtxPopCurrent (hashcat_ctx, &device_param->hip_context) == -1) return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+107
@@ -810,6 +810,54 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->hip)
|
||||
{
|
||||
event_log_info (hashcat_ctx, "HIP Info:");
|
||||
event_log_info (hashcat_ctx, "=========");
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
|
||||
int hip_devices_cnt = backend_ctx->hip_devices_cnt;
|
||||
int hip_driver_version = backend_ctx->hip_driver_version;
|
||||
|
||||
event_log_info (hashcat_ctx, "HIP.Version.: %d.%d", hip_driver_version / 1000, (hip_driver_version % 100) / 10);
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
|
||||
for (int hip_devices_idx = 0; hip_devices_idx < hip_devices_cnt; hip_devices_idx++)
|
||||
{
|
||||
const int backend_devices_idx = backend_ctx->backend_device_from_hip[hip_devices_idx];
|
||||
|
||||
const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
|
||||
|
||||
int device_id = device_param->device_id;
|
||||
char *device_name = device_param->device_name;
|
||||
u32 device_processors = device_param->device_processors;
|
||||
u32 device_maxclock_frequency = device_param->device_maxclock_frequency;
|
||||
u64 device_available_mem = device_param->device_available_mem;
|
||||
u64 device_global_mem = device_param->device_global_mem;
|
||||
u8 pcie_domain = device_param->pcie_domain;
|
||||
u8 pcie_bus = device_param->pcie_bus;
|
||||
u8 pcie_device = device_param->pcie_device;
|
||||
u8 pcie_function = device_param->pcie_function;
|
||||
|
||||
if (device_param->device_id_alias_cnt)
|
||||
{
|
||||
event_log_info (hashcat_ctx, "Backend Device ID #%d (Alias: #%d)", device_id + 1, device_param->device_id_alias_buf[0] + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
event_log_info (hashcat_ctx, "Backend Device ID #%d", device_id + 1);
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, " Name...........: %s", device_name);
|
||||
event_log_info (hashcat_ctx, " Processor(s)...: %u", device_processors);
|
||||
event_log_info (hashcat_ctx, " Clock..........: %u", device_maxclock_frequency);
|
||||
event_log_info (hashcat_ctx, " Memory.Total...: %" PRIu64 " MB", device_global_mem / 1024 / 1024);
|
||||
event_log_info (hashcat_ctx, " Memory.Free....: %" PRIu64 " MB", device_available_mem / 1024 / 1024);
|
||||
event_log_info (hashcat_ctx, " PCI.Addr.BDFe..: %04x:%02x:%02x.%d", (u16) pcie_domain, pcie_bus, pcie_device, pcie_function);
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (backend_ctx->ocl)
|
||||
{
|
||||
event_log_info (hashcat_ctx, "OpenCL Info:");
|
||||
@@ -908,6 +956,10 @@ void backend_info_compact (hashcat_ctx_t *hashcat_ctx)
|
||||
if (user_options->machine_readable == true) return;
|
||||
if (user_options->status_json == true) return;
|
||||
|
||||
/**
|
||||
* CUDA
|
||||
*/
|
||||
|
||||
if (backend_ctx->cuda)
|
||||
{
|
||||
int cuda_devices_cnt = backend_ctx->cuda_devices_cnt;
|
||||
@@ -955,6 +1007,61 @@ void backend_info_compact (hashcat_ctx_t *hashcat_ctx)
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* HIP
|
||||
*/
|
||||
|
||||
if (backend_ctx->hip)
|
||||
{
|
||||
int hip_devices_cnt = backend_ctx->hip_devices_cnt;
|
||||
int hip_driver_version = backend_ctx->hip_driver_version;
|
||||
|
||||
const size_t len = event_log_info (hashcat_ctx, "HIP API (HIP %d.%d)", hip_driver_version / 1000, (hip_driver_version % 100) / 10);
|
||||
|
||||
char line[HCBUFSIZ_TINY] = { 0 };
|
||||
|
||||
memset (line, '=', len);
|
||||
|
||||
line[len] = 0;
|
||||
|
||||
event_log_info (hashcat_ctx, "%s", line);
|
||||
|
||||
for (int hip_devices_idx = 0; hip_devices_idx < hip_devices_cnt; hip_devices_idx++)
|
||||
{
|
||||
const int backend_devices_idx = backend_ctx->backend_device_from_hip[hip_devices_idx];
|
||||
|
||||
const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
|
||||
|
||||
int device_id = device_param->device_id;
|
||||
char *device_name = device_param->device_name;
|
||||
u32 device_processors = device_param->device_processors;
|
||||
u64 device_global_mem = device_param->device_global_mem;
|
||||
u64 device_available_mem = device_param->device_available_mem;
|
||||
|
||||
if ((device_param->skipped == false) && (device_param->skipped_warning == false))
|
||||
{
|
||||
event_log_info (hashcat_ctx, "* Device #%u: %s, %" PRIu64 "/%" PRIu64 " MB, %uMCU",
|
||||
device_id + 1,
|
||||
device_name,
|
||||
device_available_mem / 1024 / 1024,
|
||||
device_global_mem / 1024 / 1024,
|
||||
device_processors);
|
||||
}
|
||||
else
|
||||
{
|
||||
event_log_info (hashcat_ctx, "* Device #%u: %s, skipped",
|
||||
device_id + 1,
|
||||
device_name);
|
||||
}
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* OpenCL
|
||||
*/
|
||||
|
||||
if (backend_ctx->ocl)
|
||||
{
|
||||
cl_uint opencl_platforms_cnt = backend_ctx->opencl_platforms_cnt;
|
||||
|
||||
@@ -31,6 +31,7 @@ static const struct option long_options[] =
|
||||
{"attack-mode", required_argument, NULL, IDX_ATTACK_MODE},
|
||||
{"backend-devices", required_argument, NULL, IDX_BACKEND_DEVICES},
|
||||
{"backend-ignore-cuda", no_argument, NULL, IDX_BACKEND_IGNORE_CUDA},
|
||||
{"backend-ignore-hip", no_argument, NULL, IDX_BACKEND_IGNORE_HIP},
|
||||
{"backend-ignore-opencl", no_argument, NULL, IDX_BACKEND_IGNORE_OPENCL},
|
||||
{"backend-info", no_argument, NULL, IDX_BACKEND_INFO},
|
||||
{"backend-vector-width", required_argument, NULL, IDX_BACKEND_VECTOR_WIDTH},
|
||||
@@ -162,6 +163,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->autodetect = AUTODETECT;
|
||||
user_options->backend_devices = NULL;
|
||||
user_options->backend_ignore_cuda = BACKEND_IGNORE_CUDA;
|
||||
user_options->backend_ignore_hip = BACKEND_IGNORE_HIP;
|
||||
user_options->backend_ignore_opencl = BACKEND_IGNORE_OPENCL;
|
||||
user_options->backend_info = BACKEND_INFO;
|
||||
user_options->backend_vector_width = BACKEND_VECTOR_WIDTH;
|
||||
@@ -441,6 +443,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
case IDX_HEX_WORDLIST: user_options->hex_wordlist = true; break;
|
||||
case IDX_CPU_AFFINITY: user_options->cpu_affinity = optarg; break;
|
||||
case IDX_BACKEND_IGNORE_CUDA: user_options->backend_ignore_cuda = true; break;
|
||||
case IDX_BACKEND_IGNORE_HIP: user_options->backend_ignore_hip = true; break;
|
||||
case IDX_BACKEND_IGNORE_OPENCL: user_options->backend_ignore_opencl = true; break;
|
||||
case IDX_BACKEND_INFO: user_options->backend_info = true; break;
|
||||
case IDX_BACKEND_DEVICES: user_options->backend_devices = optarg; break;
|
||||
|
||||
Reference in New Issue
Block a user