mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-22 14:48:12 +00:00
Added new options --backend-ignore-cuda and --backend-ingore-opencl, to ignore CUDA and/or OpenCL interface from being load on startup
This commit is contained in:
parent
469e13aa0b
commit
d0fb171da9
@ -7,6 +7,7 @@
|
||||
- Fully modularized hash-mode integration via plugin interface and conversion of all existing hash-modes
|
||||
- Refactor hashcat backend interface to allow adding compute API other than OpenCL
|
||||
- Added CUDA as a new compute API to hashcat backend (enables hashcat to run on NVIDIA Jetson, IBM POWER9 w/ Nvidia V100, etc.)
|
||||
- Added new options --backend-ignore-cuda and --backend-ingore-opencl, to ignore CUDA and/or OpenCL interface from being load on startup
|
||||
- Support use of all available GPU memory using CUDA backend
|
||||
- Support use of all available CPU cores for hash-mode specific hooks
|
||||
- Support on-the-fly loading of compressed wordlists in zip and gzip format
|
||||
|
@ -250,7 +250,7 @@ _hashcat ()
|
||||
local BUILD_IN_CHARSETS='?l ?u ?d ?a ?b ?s ?h ?H'
|
||||
|
||||
local SHORT_OPTS="-m -a -V -h -b -t -T -o -p -c -d -D -w -n -u -j -k -r -g -1 -2 -3 -4 -i -I -s -l -O -S -z"
|
||||
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-json --status-timer --stdin-timeout-abort --machine-readable --loopback --markov-hcstat2 --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --backend-info --backend-devices --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --spin-damp --hwmon-disable --hwmon-temp-abort --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable --slow-candidates --brain-server --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password"
|
||||
local LONG_OPTS="--hash-type --attack-mode --version --help --quiet --benchmark --benchmark-all --hex-salt --hex-wordlist --hex-charset --force --status --status-json --status-timer --stdin-timeout-abort --machine-readable --loopback --markov-hcstat2 --markov-disable --markov-classic --markov-threshold --runtime --session --speed-only --progress-only --restore --restore-file-path --restore-disable --outfile --outfile-format --outfile-autohex-disable --outfile-check-timer --outfile-check-dir --wordlist-autohex-disable --separator --show --left --username --remove --remove-timer --potfile-disable --potfile-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --example-hashes --backend-ignore-cuda --backend-ignore-opencl --backend-info --backend-devices --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --spin-damp --hwmon-disable --hwmon-temp-abort --skip --limit --keyspace --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment --increment-min --increment-max --logfile-disable --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --stdout --keep-guessing --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --optimized-kernel-enable --self-test-disable --slow-candidates --brain-server --brain-client --brain-client-features --brain-host --brain-port --brain-session --brain-session-whitelist --brain-password"
|
||||
local OPTIONS="-m -a -t -o -p -c -d -w -n -u -j -k -r -g -1 -2 -3 -4 -s -l --hash-type --attack-mode --status-timer --stdin-timeout-abort --markov-hcstat2 --markov-threshold --runtime --session --timer --outfile --outfile-format --outfile-check-timer --outfile-check-dir --separator --remove-timer --potfile-path --restore-file-path --debug-mode --debug-file --induction-dir --segment-size --bitmap-min --bitmap-max --cpu-affinity --backend-devices --opencl-device-types --backend-vector-width --workload-profile --kernel-accel --kernel-loops --kernel-threads --spin-damp --hwmon-temp-abort --skip --limit --rule-left --rule-right --rules-file --generate-rules --generate-rules-func-min --generate-rules-func-max --generate-rules-seed --custom-charset1 --custom-charset2 --custom-charset3 --custom-charset4 --hook-threads --increment-min --increment-max --scrypt-tmto --keyboard-layout-mapping --truecrypt-keyfiles --veracrypt-keyfiles --veracrypt-pim-start --veracrypt-pim-stop --hccapx-message-pair --nonce-error-corrections --encoding-from --encoding-to --brain-client-features --brain-host --brain-password --brain-port --brain-session --brain-session-whitelist"
|
||||
|
||||
COMPREPLY=()
|
||||
|
152
include/types.h
152
include/types.h
@ -604,6 +604,8 @@ typedef enum user_options_defaults
|
||||
MARKOV_DISABLE = false,
|
||||
MARKOV_THRESHOLD = 0,
|
||||
NONCE_ERROR_CORRECTIONS = 8,
|
||||
BACKEND_IGNORE_CUDA = false,
|
||||
BACKEND_IGNORE_OPENCL = false,
|
||||
BACKEND_INFO = false,
|
||||
BACKEND_VECTOR_WIDTH = 0,
|
||||
OPTIMIZED_KERNEL_ENABLE = false,
|
||||
@ -650,109 +652,111 @@ typedef enum user_options_map
|
||||
IDX_ADVICE_DISABLE = 0xff00,
|
||||
IDX_ATTACK_MODE = 'a',
|
||||
IDX_BACKEND_DEVICES = 'd',
|
||||
IDX_BACKEND_IGNORE_CUDA = 0xff01,
|
||||
IDX_BACKEND_IGNORE_OPENCL = 0xff02,
|
||||
IDX_BACKEND_INFO = 'I',
|
||||
IDX_BACKEND_VECTOR_WIDTH = 0xff01,
|
||||
IDX_BENCHMARK_ALL = 0xff02,
|
||||
IDX_BACKEND_VECTOR_WIDTH = 0xff03,
|
||||
IDX_BENCHMARK_ALL = 0xff04,
|
||||
IDX_BENCHMARK = 'b',
|
||||
IDX_BITMAP_MAX = 0xff03,
|
||||
IDX_BITMAP_MIN = 0xff04,
|
||||
IDX_BITMAP_MAX = 0xff05,
|
||||
IDX_BITMAP_MIN = 0xff06,
|
||||
#ifdef WITH_BRAIN
|
||||
IDX_BRAIN_CLIENT = 'z',
|
||||
IDX_BRAIN_CLIENT_FEATURES = 0xff05,
|
||||
IDX_BRAIN_HOST = 0xff06,
|
||||
IDX_BRAIN_PASSWORD = 0xff07,
|
||||
IDX_BRAIN_PORT = 0xff08,
|
||||
IDX_BRAIN_SERVER = 0xff09,
|
||||
IDX_BRAIN_SESSION = 0xff0a,
|
||||
IDX_BRAIN_SESSION_WHITELIST = 0xff0b,
|
||||
IDX_BRAIN_CLIENT_FEATURES = 0xff07,
|
||||
IDX_BRAIN_HOST = 0xff08,
|
||||
IDX_BRAIN_PASSWORD = 0xff09,
|
||||
IDX_BRAIN_PORT = 0xff0a,
|
||||
IDX_BRAIN_SERVER = 0xff0b,
|
||||
IDX_BRAIN_SESSION = 0xff0c,
|
||||
IDX_BRAIN_SESSION_WHITELIST = 0xff0d,
|
||||
#endif
|
||||
IDX_CPU_AFFINITY = 0xff0c,
|
||||
IDX_CPU_AFFINITY = 0xff0e,
|
||||
IDX_CUSTOM_CHARSET_1 = '1',
|
||||
IDX_CUSTOM_CHARSET_2 = '2',
|
||||
IDX_CUSTOM_CHARSET_3 = '3',
|
||||
IDX_CUSTOM_CHARSET_4 = '4',
|
||||
IDX_DEBUG_FILE = 0xff0d,
|
||||
IDX_DEBUG_MODE = 0xff0e,
|
||||
IDX_ENCODING_FROM = 0xff0f,
|
||||
IDX_ENCODING_TO = 0xff10,
|
||||
IDX_EXAMPLE_HASHES = 0xff11,
|
||||
IDX_FORCE = 0xff12,
|
||||
IDX_HWMON_DISABLE = 0xff13,
|
||||
IDX_HWMON_TEMP_ABORT = 0xff14,
|
||||
IDX_DEBUG_FILE = 0xff0f,
|
||||
IDX_DEBUG_MODE = 0xff10,
|
||||
IDX_ENCODING_FROM = 0xff11,
|
||||
IDX_ENCODING_TO = 0xff12,
|
||||
IDX_EXAMPLE_HASHES = 0xff13,
|
||||
IDX_FORCE = 0xff14,
|
||||
IDX_HWMON_DISABLE = 0xff15,
|
||||
IDX_HWMON_TEMP_ABORT = 0xff16,
|
||||
IDX_HASH_MODE = 'm',
|
||||
IDX_HCCAPX_MESSAGE_PAIR = 0xff15,
|
||||
IDX_HCCAPX_MESSAGE_PAIR = 0xff17,
|
||||
IDX_HELP = 'h',
|
||||
IDX_HEX_CHARSET = 0xff16,
|
||||
IDX_HEX_SALT = 0xff17,
|
||||
IDX_HEX_WORDLIST = 0xff18,
|
||||
IDX_HOOK_THREADS = 0xff19,
|
||||
IDX_HEX_CHARSET = 0xff18,
|
||||
IDX_HEX_SALT = 0xff19,
|
||||
IDX_HEX_WORDLIST = 0xff1a,
|
||||
IDX_HOOK_THREADS = 0xff1b,
|
||||
IDX_INCREMENT = 'i',
|
||||
IDX_INCREMENT_MAX = 0xff1a,
|
||||
IDX_INCREMENT_MIN = 0xff1b,
|
||||
IDX_INDUCTION_DIR = 0xff1c,
|
||||
IDX_KEEP_GUESSING = 0xff1d,
|
||||
IDX_INCREMENT_MAX = 0xff1c,
|
||||
IDX_INCREMENT_MIN = 0xff1d,
|
||||
IDX_INDUCTION_DIR = 0xff1e,
|
||||
IDX_KEEP_GUESSING = 0xff1f,
|
||||
IDX_KERNEL_ACCEL = 'n',
|
||||
IDX_KERNEL_LOOPS = 'u',
|
||||
IDX_KERNEL_THREADS = 'T',
|
||||
IDX_KEYBOARD_LAYOUT_MAPPING = 0xff1e,
|
||||
IDX_KEYSPACE = 0xff1f,
|
||||
IDX_LEFT = 0xff20,
|
||||
IDX_KEYBOARD_LAYOUT_MAPPING = 0xff20,
|
||||
IDX_KEYSPACE = 0xff21,
|
||||
IDX_LEFT = 0xff22,
|
||||
IDX_LIMIT = 'l',
|
||||
IDX_LOGFILE_DISABLE = 0xff21,
|
||||
IDX_LOOPBACK = 0xff22,
|
||||
IDX_MACHINE_READABLE = 0xff23,
|
||||
IDX_MARKOV_CLASSIC = 0xff24,
|
||||
IDX_MARKOV_DISABLE = 0xff25,
|
||||
IDX_MARKOV_HCSTAT2 = 0xff26,
|
||||
IDX_LOGFILE_DISABLE = 0xff23,
|
||||
IDX_LOOPBACK = 0xff24,
|
||||
IDX_MACHINE_READABLE = 0xff25,
|
||||
IDX_MARKOV_CLASSIC = 0xff26,
|
||||
IDX_MARKOV_DISABLE = 0xff27,
|
||||
IDX_MARKOV_HCSTAT2 = 0xff28,
|
||||
IDX_MARKOV_THRESHOLD = 't',
|
||||
IDX_NONCE_ERROR_CORRECTIONS = 0xff27,
|
||||
IDX_NONCE_ERROR_CORRECTIONS = 0xff29,
|
||||
IDX_OPENCL_DEVICE_TYPES = 'D',
|
||||
IDX_OPTIMIZED_KERNEL_ENABLE = 'O',
|
||||
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff28,
|
||||
IDX_OUTFILE_CHECK_DIR = 0xff29,
|
||||
IDX_OUTFILE_CHECK_TIMER = 0xff2a,
|
||||
IDX_OUTFILE_FORMAT = 0xff2b,
|
||||
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff2a,
|
||||
IDX_OUTFILE_CHECK_DIR = 0xff2b,
|
||||
IDX_OUTFILE_CHECK_TIMER = 0xff2c,
|
||||
IDX_OUTFILE_FORMAT = 0xff2d,
|
||||
IDX_OUTFILE = 'o',
|
||||
IDX_POTFILE_DISABLE = 0xff2c,
|
||||
IDX_POTFILE_PATH = 0xff2d,
|
||||
IDX_PROGRESS_ONLY = 0xff2e,
|
||||
IDX_QUIET = 0xff2f,
|
||||
IDX_REMOVE = 0xff30,
|
||||
IDX_REMOVE_TIMER = 0xff31,
|
||||
IDX_RESTORE = 0xff32,
|
||||
IDX_RESTORE_DISABLE = 0xff33,
|
||||
IDX_RESTORE_FILE_PATH = 0xff34,
|
||||
IDX_POTFILE_DISABLE = 0xff2e,
|
||||
IDX_POTFILE_PATH = 0xff2f,
|
||||
IDX_PROGRESS_ONLY = 0xff30,
|
||||
IDX_QUIET = 0xff31,
|
||||
IDX_REMOVE = 0xff32,
|
||||
IDX_REMOVE_TIMER = 0xff33,
|
||||
IDX_RESTORE = 0xff34,
|
||||
IDX_RESTORE_DISABLE = 0xff35,
|
||||
IDX_RESTORE_FILE_PATH = 0xff36,
|
||||
IDX_RP_FILE = 'r',
|
||||
IDX_RP_GEN_FUNC_MAX = 0xff35,
|
||||
IDX_RP_GEN_FUNC_MIN = 0xff36,
|
||||
IDX_RP_GEN_FUNC_MAX = 0xff37,
|
||||
IDX_RP_GEN_FUNC_MIN = 0xff38,
|
||||
IDX_RP_GEN = 'g',
|
||||
IDX_RP_GEN_SEED = 0xff37,
|
||||
IDX_RP_GEN_SEED = 0xff39,
|
||||
IDX_RULE_BUF_L = 'j',
|
||||
IDX_RULE_BUF_R = 'k',
|
||||
IDX_RUNTIME = 0xff38,
|
||||
IDX_SCRYPT_TMTO = 0xff39,
|
||||
IDX_RUNTIME = 0xff3a,
|
||||
IDX_SCRYPT_TMTO = 0xff3b,
|
||||
IDX_SEGMENT_SIZE = 'c',
|
||||
IDX_SELF_TEST_DISABLE = 0xff3a,
|
||||
IDX_SELF_TEST_DISABLE = 0xff3c,
|
||||
IDX_SEPARATOR = 'p',
|
||||
IDX_SESSION = 0xff3b,
|
||||
IDX_SHOW = 0xff3c,
|
||||
IDX_SESSION = 0xff3d,
|
||||
IDX_SHOW = 0xff3e,
|
||||
IDX_SKIP = 's',
|
||||
IDX_SLOW_CANDIDATES = 'S',
|
||||
IDX_SPEED_ONLY = 0xff3d,
|
||||
IDX_SPIN_DAMP = 0xff3e,
|
||||
IDX_STATUS = 0xff3f,
|
||||
IDX_STATUS_JSON = 0xff40,
|
||||
IDX_STATUS_TIMER = 0xff41,
|
||||
IDX_STDOUT_FLAG = 0xff42,
|
||||
IDX_STDIN_TIMEOUT_ABORT = 0xff43,
|
||||
IDX_TRUECRYPT_KEYFILES = 0xff44,
|
||||
IDX_USERNAME = 0xff45,
|
||||
IDX_VERACRYPT_KEYFILES = 0xff46,
|
||||
IDX_VERACRYPT_PIM_START = 0xff47,
|
||||
IDX_VERACRYPT_PIM_STOP = 0xff48,
|
||||
IDX_SPEED_ONLY = 0xff3f,
|
||||
IDX_SPIN_DAMP = 0xff40,
|
||||
IDX_STATUS = 0xff41,
|
||||
IDX_STATUS_JSON = 0xff42,
|
||||
IDX_STATUS_TIMER = 0xff43,
|
||||
IDX_STDOUT_FLAG = 0xff44,
|
||||
IDX_STDIN_TIMEOUT_ABORT = 0xff45,
|
||||
IDX_TRUECRYPT_KEYFILES = 0xff46,
|
||||
IDX_USERNAME = 0xff47,
|
||||
IDX_VERACRYPT_KEYFILES = 0xff48,
|
||||
IDX_VERACRYPT_PIM_START = 0xff49,
|
||||
IDX_VERACRYPT_PIM_STOP = 0xff4a,
|
||||
IDX_VERSION_LOWER = 'v',
|
||||
IDX_VERSION = 'V',
|
||||
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff49,
|
||||
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff4b,
|
||||
IDX_WORKLOAD_PROFILE = 'w',
|
||||
|
||||
} user_options_map_t;
|
||||
@ -1875,6 +1879,8 @@ typedef struct user_options
|
||||
bool machine_readable;
|
||||
bool markov_classic;
|
||||
bool markov_disable;
|
||||
bool backend_ignore_cuda;
|
||||
bool backend_ignore_opencl;
|
||||
bool backend_info;
|
||||
bool optimized_kernel_enable;
|
||||
bool outfile_autohex;
|
||||
|
236
src/backend.c
236
src/backend.c
@ -4743,137 +4743,147 @@ int backend_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
* Load and map CUDA library calls, then init CUDA
|
||||
*/
|
||||
|
||||
CUDA_PTR *cuda = (CUDA_PTR *) hcmalloc (sizeof (CUDA_PTR));
|
||||
int rc_cuda_init = -1;
|
||||
|
||||
backend_ctx->cuda = cuda;
|
||||
|
||||
int rc_cuda_init = cuda_init (hashcat_ctx);
|
||||
|
||||
if (rc_cuda_init == -1)
|
||||
if (user_options->backend_ignore_cuda == false)
|
||||
{
|
||||
cuda_close (hashcat_ctx);
|
||||
}
|
||||
CUDA_PTR *cuda = (CUDA_PTR *) hcmalloc (sizeof (CUDA_PTR));
|
||||
|
||||
/**
|
||||
* Load and map NVRTC library calls
|
||||
*/
|
||||
backend_ctx->cuda = cuda;
|
||||
|
||||
NVRTC_PTR *nvrtc = (NVRTC_PTR *) hcmalloc (sizeof (NVRTC_PTR));
|
||||
rc_cuda_init = cuda_init (hashcat_ctx);
|
||||
|
||||
backend_ctx->nvrtc = nvrtc;
|
||||
|
||||
int rc_nvrtc_init = nvrtc_init (hashcat_ctx);
|
||||
|
||||
if (rc_nvrtc_init == -1)
|
||||
{
|
||||
nvrtc_close (hashcat_ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if both CUDA and NVRTC were load successful
|
||||
*/
|
||||
|
||||
if ((rc_cuda_init == 0) && (rc_nvrtc_init == 0))
|
||||
{
|
||||
// nvrtc version
|
||||
|
||||
int nvrtc_major = 0;
|
||||
int nvrtc_minor = 0;
|
||||
|
||||
if (hc_nvrtcVersion (hashcat_ctx, &nvrtc_major, &nvrtc_minor) == -1) return -1;
|
||||
|
||||
int nvrtc_driver_version = (nvrtc_major * 1000) + (nvrtc_minor * 10);
|
||||
|
||||
backend_ctx->nvrtc_driver_version = nvrtc_driver_version;
|
||||
|
||||
// cuda version
|
||||
|
||||
int cuda_driver_version = 0;
|
||||
|
||||
if (hc_cuDriverGetVersion (hashcat_ctx, &cuda_driver_version) == -1) return -1;
|
||||
|
||||
backend_ctx->cuda_driver_version = cuda_driver_version;
|
||||
|
||||
// some pre-check
|
||||
|
||||
if ((nvrtc_driver_version < 10000) || (cuda_driver_version < 10000))
|
||||
if (rc_cuda_init == -1)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Outdated NVIDIA CUDA Toolkit version '%d' detected!", cuda_driver_version);
|
||||
|
||||
event_log_warning (hashcat_ctx, "See hashcat.net for officially supported NVIDIA CUDA Toolkit versions.");
|
||||
event_log_warning (hashcat_ctx, NULL);
|
||||
|
||||
return -1;
|
||||
cuda_close (hashcat_ctx);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc_cuda_init = -1;
|
||||
rc_nvrtc_init = -1;
|
||||
|
||||
cuda_close (hashcat_ctx);
|
||||
nvrtc_close (hashcat_ctx);
|
||||
/**
|
||||
* Load and map NVRTC library calls
|
||||
*/
|
||||
|
||||
NVRTC_PTR *nvrtc = (NVRTC_PTR *) hcmalloc (sizeof (NVRTC_PTR));
|
||||
|
||||
backend_ctx->nvrtc = nvrtc;
|
||||
|
||||
int rc_nvrtc_init = nvrtc_init (hashcat_ctx);
|
||||
|
||||
if (rc_nvrtc_init == -1)
|
||||
{
|
||||
nvrtc_close (hashcat_ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if both CUDA and NVRTC were load successful
|
||||
*/
|
||||
|
||||
if ((rc_cuda_init == 0) && (rc_nvrtc_init == 0))
|
||||
{
|
||||
// nvrtc version
|
||||
|
||||
int nvrtc_major = 0;
|
||||
int nvrtc_minor = 0;
|
||||
|
||||
if (hc_nvrtcVersion (hashcat_ctx, &nvrtc_major, &nvrtc_minor) == -1) return -1;
|
||||
|
||||
int nvrtc_driver_version = (nvrtc_major * 1000) + (nvrtc_minor * 10);
|
||||
|
||||
backend_ctx->nvrtc_driver_version = nvrtc_driver_version;
|
||||
|
||||
// cuda version
|
||||
|
||||
int cuda_driver_version = 0;
|
||||
|
||||
if (hc_cuDriverGetVersion (hashcat_ctx, &cuda_driver_version) == -1) return -1;
|
||||
|
||||
backend_ctx->cuda_driver_version = cuda_driver_version;
|
||||
|
||||
// some pre-check
|
||||
|
||||
if ((nvrtc_driver_version < 10000) || (cuda_driver_version < 10000))
|
||||
{
|
||||
event_log_error (hashcat_ctx, "Outdated NVIDIA CUDA Toolkit version '%d' detected!", cuda_driver_version);
|
||||
|
||||
event_log_warning (hashcat_ctx, "See hashcat.net for officially supported NVIDIA CUDA Toolkit versions.");
|
||||
event_log_warning (hashcat_ctx, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc_cuda_init = -1;
|
||||
rc_nvrtc_init = -1;
|
||||
|
||||
cuda_close (hashcat_ctx);
|
||||
nvrtc_close (hashcat_ctx);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and map OpenCL library calls
|
||||
*/
|
||||
|
||||
OCL_PTR *ocl = (OCL_PTR *) hcmalloc (sizeof (OCL_PTR));
|
||||
int rc_ocl_init = -1;
|
||||
|
||||
backend_ctx->ocl = ocl;
|
||||
|
||||
const int rc_ocl_init = ocl_init (hashcat_ctx);
|
||||
|
||||
if (rc_ocl_init == -1)
|
||||
if (user_options->backend_ignore_opencl == false)
|
||||
{
|
||||
ocl_close (hashcat_ctx);
|
||||
OCL_PTR *ocl = (OCL_PTR *) hcmalloc (sizeof (OCL_PTR));
|
||||
|
||||
backend_ctx->ocl = ocl;
|
||||
|
||||
rc_ocl_init = ocl_init (hashcat_ctx);
|
||||
|
||||
if (rc_ocl_init == -1)
|
||||
{
|
||||
ocl_close (hashcat_ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
* return if both CUDA and OpenCL initialization failed
|
||||
*/
|
||||
|
||||
if ((rc_cuda_init == -1) && (rc_ocl_init == -1))
|
||||
{
|
||||
event_log_error (hashcat_ctx, "ATTENTION! No OpenCL or CUDA installation found.");
|
||||
|
||||
event_log_warning (hashcat_ctx, "You are probably missing the CUDA or OpenCL runtime installation.");
|
||||
event_log_warning (hashcat_ctx, NULL);
|
||||
|
||||
#if defined (__linux__)
|
||||
event_log_warning (hashcat_ctx, "* AMD GPUs on Linux require this driver:");
|
||||
event_log_warning (hashcat_ctx, " \"RadeonOpenCompute (ROCm)\" Software Platform (1.6.180 or later)");
|
||||
#elif defined (_WIN)
|
||||
event_log_warning (hashcat_ctx, "* AMD GPUs on Windows require this driver:");
|
||||
event_log_warning (hashcat_ctx, " \"AMD Radeon Software Crimson Edition\" (15.12 or later)");
|
||||
#endif
|
||||
|
||||
event_log_warning (hashcat_ctx, "* Intel CPUs require this runtime:");
|
||||
event_log_warning (hashcat_ctx, " \"OpenCL Runtime for Intel Core and Intel Xeon Processors\" (16.1.1 or later)");
|
||||
|
||||
#if defined (__linux__)
|
||||
event_log_warning (hashcat_ctx, "* Intel GPUs on Linux require this driver:");
|
||||
event_log_warning (hashcat_ctx, " \"OpenCL 2.0 GPU Driver Package for Linux\" (2.0 or later)");
|
||||
#elif defined (_WIN)
|
||||
event_log_warning (hashcat_ctx, "* Intel GPUs on Windows require this driver:");
|
||||
event_log_warning (hashcat_ctx, " \"OpenCL Driver for Intel Iris and Intel HD Graphics\"");
|
||||
#endif
|
||||
|
||||
event_log_warning (hashcat_ctx, "* NVIDIA GPUs require this runtime and/or driver (both):");
|
||||
event_log_warning (hashcat_ctx, " \"NVIDIA Driver\" (418.56 or later)");
|
||||
event_log_warning (hashcat_ctx, " \"CUDA Toolkit\" (10.1 or later)");
|
||||
event_log_warning (hashcat_ctx, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some permission pre-check, because AMDGPU-PRO Driver crashes if the user has no permission to do this
|
||||
*/
|
||||
|
||||
if (ocl_check_dri (hashcat_ctx) == -1) return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* return if both CUDA and OpenCL initialization failed
|
||||
*/
|
||||
|
||||
if ((rc_cuda_init == -1) && (rc_ocl_init == -1))
|
||||
{
|
||||
event_log_error (hashcat_ctx, "ATTENTION! No OpenCL or CUDA installation found.");
|
||||
|
||||
event_log_warning (hashcat_ctx, "You are probably missing the CUDA or OpenCL runtime installation.");
|
||||
event_log_warning (hashcat_ctx, NULL);
|
||||
|
||||
#if defined (__linux__)
|
||||
event_log_warning (hashcat_ctx, "* AMD GPUs on Linux require this driver:");
|
||||
event_log_warning (hashcat_ctx, " \"RadeonOpenCompute (ROCm)\" Software Platform (1.6.180 or later)");
|
||||
#elif defined (_WIN)
|
||||
event_log_warning (hashcat_ctx, "* AMD GPUs on Windows require this driver:");
|
||||
event_log_warning (hashcat_ctx, " \"AMD Radeon Software Crimson Edition\" (15.12 or later)");
|
||||
#endif
|
||||
|
||||
event_log_warning (hashcat_ctx, "* Intel CPUs require this runtime:");
|
||||
event_log_warning (hashcat_ctx, " \"OpenCL Runtime for Intel Core and Intel Xeon Processors\" (16.1.1 or later)");
|
||||
|
||||
#if defined (__linux__)
|
||||
event_log_warning (hashcat_ctx, "* Intel GPUs on Linux require this driver:");
|
||||
event_log_warning (hashcat_ctx, " \"OpenCL 2.0 GPU Driver Package for Linux\" (2.0 or later)");
|
||||
#elif defined (_WIN)
|
||||
event_log_warning (hashcat_ctx, "* Intel GPUs on Windows require this driver:");
|
||||
event_log_warning (hashcat_ctx, " \"OpenCL Driver for Intel Iris and Intel HD Graphics\"");
|
||||
#endif
|
||||
|
||||
event_log_warning (hashcat_ctx, "* NVIDIA GPUs require this runtime and/or driver (both):");
|
||||
event_log_warning (hashcat_ctx, " \"NVIDIA Driver\" (418.56 or later)");
|
||||
event_log_warning (hashcat_ctx, " \"CUDA Toolkit\" (10.1 or later)");
|
||||
event_log_warning (hashcat_ctx, NULL);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some permission pre-check, because AMDGPU-PRO Driver crashes if the user has no permission to do this
|
||||
*/
|
||||
|
||||
if (ocl_check_dri (hashcat_ctx) == -1) return -1;
|
||||
|
||||
/**
|
||||
* Backend device selection
|
||||
*/
|
||||
|
@ -90,6 +90,8 @@ static const char *const USAGE_BIG_PRE_HASHMODES[] =
|
||||
" --cpu-affinity | Str | Locks to CPU devices, separated with commas | --cpu-affinity=1,2,3",
|
||||
" --hook-threads | Num | Sets number of threads for a hook (per compute unit) | --hook-threads=8",
|
||||
" --example-hashes | | Show an example hash for each hash-mode |",
|
||||
" --backend-ignore-cuda | | Do not try to open CUDA interface on startup |",
|
||||
" --backend-ignore-opencl | | Do not try to open OpenCL interface on startup |",
|
||||
" -I, --backend-info | | Show info about detected backend API devices | -I",
|
||||
" -d, --backend-devices | Str | Backend devices to use, separated with commas | -d 1",
|
||||
" -D, --opencl-device-types | Str | OpenCL device-types to use, separated with commas | -D 1",
|
||||
|
@ -29,6 +29,8 @@ static const struct option long_options[] =
|
||||
{"advice-disable", no_argument, NULL, IDX_ADVICE_DISABLE},
|
||||
{"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-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},
|
||||
{"benchmark-all", no_argument, NULL, IDX_BENCHMARK_ALL},
|
||||
@ -153,6 +155,8 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
|
||||
user_options->advice_disable = ADVICE_DISABLE;
|
||||
user_options->attack_mode = ATTACK_MODE;
|
||||
user_options->backend_devices = NULL;
|
||||
user_options->backend_ignore_cuda = BACKEND_IGNORE_CUDA;
|
||||
user_options->backend_ignore_opencl = BACKEND_IGNORE_OPENCL;
|
||||
user_options->backend_info = BACKEND_INFO;
|
||||
user_options->backend_vector_width = BACKEND_VECTOR_WIDTH;
|
||||
user_options->benchmark_all = BENCHMARK_ALL;
|
||||
@ -426,6 +430,8 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
case IDX_HEX_SALT: user_options->hex_salt = true; break;
|
||||
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_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;
|
||||
case IDX_BACKEND_VECTOR_WIDTH: user_options->backend_vector_width = hc_strtoul (optarg, NULL, 10);
|
||||
|
Loading…
Reference in New Issue
Block a user