From fda0d668e569f8aa6352fb4f94233b5b9b83158f Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 23 Jan 2021 18:51:25 +0100 Subject: [PATCH] use skip also with first checks of backend_session_begin() --- src/backend.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/src/backend.c b/src/backend.c index eaeca049f..39794f256 100644 --- a/src/backend.c +++ b/src/backend.c @@ -7913,7 +7913,11 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (device_param->is_opencl == true) { - if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG, sizeof (vector_width), &vector_width, NULL) == -1) return -1; + if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG, sizeof (vector_width), &vector_width, NULL) == -1) + { + device_param->skipped = true; + continue; + } } } else @@ -7927,7 +7931,11 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (device_param->is_opencl == true) { - if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, sizeof (vector_width), &vector_width, NULL) == -1) return -1; + if (hc_clGetDeviceInfo (hashcat_ctx, device_param->opencl_device, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, sizeof (vector_width), &vector_width, NULL) == -1) + { + device_param->skipped = true; + continue; + } } } } @@ -8108,7 +8116,11 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (device_param->is_cuda == true) { - if (hc_cuCtxCreate (hashcat_ctx, &device_param->cuda_context, CU_CTX_SCHED_BLOCKING_SYNC, device_param->cuda_device) == -1) return -1; + if (hc_cuCtxCreate (hashcat_ctx, &device_param->cuda_context, CU_CTX_SCHED_BLOCKING_SYNC, device_param->cuda_device) == -1) + { + device_param->skipped = true; + continue; + } } if (device_param->is_opencl == true) @@ -8149,7 +8161,11 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (device_param->is_cuda == true) { - if (hc_cuStreamCreate (hashcat_ctx, &device_param->cuda_stream, CU_STREAM_DEFAULT) == -1) return -1; + if (hc_cuStreamCreate (hashcat_ctx, &device_param->cuda_stream, CU_STREAM_DEFAULT) == -1) + { + device_param->skipped = true; + continue; + } } /** @@ -8158,9 +8174,17 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (device_param->is_cuda == true) { - if (hc_cuEventCreate (hashcat_ctx, &device_param->cuda_event1, CU_EVENT_BLOCKING_SYNC) == -1) return -1; + if (hc_cuEventCreate (hashcat_ctx, &device_param->cuda_event1, CU_EVENT_BLOCKING_SYNC) == -1) + { + device_param->skipped = true; + continue; + } - if (hc_cuEventCreate (hashcat_ctx, &device_param->cuda_event2, CU_EVENT_BLOCKING_SYNC) == -1) return -1; + if (hc_cuEventCreate (hashcat_ctx, &device_param->cuda_event2, CU_EVENT_BLOCKING_SYNC) == -1) + { + device_param->skipped = true; + continue; + } } /** @@ -8221,7 +8245,8 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) { event_log_error (hashcat_ctx, "Invalid extra buffer size."); - return -1; + device_param->skipped = true; + continue; } device_param->extra_buffer_size = extra_buffer_size;