From c49238e9cd98d784792de89d5fc869b5e3f91e7f Mon Sep 17 00:00:00 2001 From: Giulio Garzia <32651700+ozozuz@users.noreply.github.com> Date: Sat, 19 Feb 2022 15:49:41 +0000 Subject: [PATCH] OpenCL include-path workaround for Windows with AMD GPU --- src/backend.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backend.c b/src/backend.c index 4db54c13a..bc1070b86 100644 --- a/src/backend.c +++ b/src/backend.c @@ -9401,9 +9401,14 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) } else { - // when is builded with cygwin and msys, cpath_real doesn't work - #if defined (_WIN) || defined (__CYGWIN__) || defined (__MSYS__) + // workaround for AMD + if (device_param->opencl_platform_vendor_id == VENDOR_ID_AMD && device_param->opencl_device_vendor_id == VENDOR_ID_AMD) + { + build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-I . "); + } + + // when built with cygwin or msys, cpath_real doesn't work build_options_len += snprintf (build_options_buf + build_options_len, build_options_sz - build_options_len, "-D INCLUDE_PATH=%s ", "OpenCL"); #else const char *build_options_include_fmt = (strchr (folder_config->cpath_real, ' ') != NULL) ? "-D INCLUDE_PATH=\"%s\" " : "-D INCLUDE_PATH=%s ";