mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-23 15:18:16 +00:00
Fix opencl_devices_active and backend_devices_active
This commit is contained in:
parent
7e5356126c
commit
a7d04adba3
@ -75,8 +75,15 @@ static int backend_ctx_find_alias_devices (hashcat_ctx_t *hashcat_ctx)
|
||||
device_param_dst->device_id_alias_cnt++;
|
||||
|
||||
if (device_param_dst->is_opencl == true)
|
||||
{
|
||||
if (device_param_dst->skipped == false)
|
||||
{
|
||||
device_param_dst->skipped = true;
|
||||
|
||||
backend_ctx->opencl_devices_active--;
|
||||
|
||||
backend_ctx->backend_devices_active--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6381,6 +6388,15 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
|
||||
backend_ctx->backend_devices_cnt = cuda_devices_cnt + opencl_devices_cnt;
|
||||
backend_ctx->backend_devices_active = cuda_devices_active + opencl_devices_active;
|
||||
|
||||
// find duplicate devices (typically cuda and opencl!)
|
||||
// using force here enables both devices, which is the worst possible outcome
|
||||
// many users force by default, so this is not a good idea
|
||||
|
||||
//if (user_options->force == false)
|
||||
//{
|
||||
backend_ctx_find_alias_devices (hashcat_ctx);
|
||||
//}
|
||||
|
||||
if (backend_ctx->backend_devices_active == 0)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "No devices found/left.");
|
||||
@ -6388,13 +6404,6 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
|
||||
return -1;
|
||||
}
|
||||
|
||||
// find duplicate devices (typically cuda and opencl!)
|
||||
|
||||
if (user_options->force == false)
|
||||
{
|
||||
backend_ctx_find_alias_devices (hashcat_ctx);
|
||||
}
|
||||
|
||||
// additional check to see if the user has chosen a device that is not within the range of available devices (i.e. larger than devices_cnt)
|
||||
|
||||
if (backend_ctx->backend_devices_filter != (u64) -1)
|
||||
|
Loading…
Reference in New Issue
Block a user