mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-22 22:58:30 +00:00
Improve CPU detection on AMDGPU-Pro
This commit is contained in:
parent
9f4c4dc14c
commit
8645571a7c
@ -9,7 +9,8 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
static const char CL_VENDOR_AMD[] = "Advanced Micro Devices, Inc.";
|
||||
static const char CL_VENDOR_AMD1[] = "Advanced Micro Devices, Inc.";
|
||||
static const char CL_VENDOR_AMD2[] = "AuthenticAMD";
|
||||
static const char CL_VENDOR_AMD_USE_INTEL[] = "GenuineIntel";
|
||||
static const char CL_VENDOR_APPLE[] = "Apple";
|
||||
static const char CL_VENDOR_INTEL_BEIGNET[] = "Intel";
|
||||
|
@ -922,8 +922,6 @@ typedef struct hc_device_param
|
||||
char *driver_version;
|
||||
char *device_opencl_version;
|
||||
|
||||
bool opencl_v12;
|
||||
|
||||
double nvidia_spin_damp;
|
||||
|
||||
cl_platform_id platform;
|
||||
|
@ -3541,6 +3541,8 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (device_param->skipped) continue;
|
||||
|
||||
if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue;
|
||||
|
||||
if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_AMD)
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
@ -3738,6 +3740,8 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (device_param->skipped) continue;
|
||||
|
||||
if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue;
|
||||
|
||||
if (hwmon_ctx->hm_device[device_id].fan_get_supported == true)
|
||||
{
|
||||
const int fanspeed = hm_get_fanspeed_with_device_id (hashcat_ctx, device_id);
|
||||
@ -3817,6 +3821,8 @@ void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (device_param->skipped) continue;
|
||||
|
||||
if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue;
|
||||
|
||||
if (hwmon_ctx->hm_device[device_id].fan_set_supported == true)
|
||||
{
|
||||
int rc = -1;
|
||||
@ -3861,6 +3867,8 @@ void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
if (device_param->skipped) continue;
|
||||
|
||||
if ((opencl_ctx->devices_param[device_id].device_type & CL_DEVICE_TYPE_GPU) == 0) continue;
|
||||
|
||||
if (opencl_ctx->devices_param[device_id].device_vendor_id == VENDOR_ID_AMD)
|
||||
{
|
||||
if (hwmon_ctx->hm_adl)
|
||||
|
14
src/opencl.c
14
src/opencl.c
@ -2271,7 +2271,11 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
|
||||
|
||||
cl_uint platform_vendor_id = 0;
|
||||
|
||||
if (strcmp (platform_vendor, CL_VENDOR_AMD) == 0)
|
||||
if (strcmp (platform_vendor, CL_VENDOR_AMD1) == 0)
|
||||
{
|
||||
platform_vendor_id = VENDOR_ID_AMD;
|
||||
}
|
||||
else if (strcmp (platform_vendor, CL_VENDOR_AMD2) == 0)
|
||||
{
|
||||
platform_vendor_id = VENDOR_ID_AMD;
|
||||
}
|
||||
@ -2385,7 +2389,11 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
|
||||
|
||||
cl_uint device_vendor_id = 0;
|
||||
|
||||
if (strcmp (device_vendor, CL_VENDOR_AMD) == 0)
|
||||
if (strcmp (device_vendor, CL_VENDOR_AMD1) == 0)
|
||||
{
|
||||
device_vendor_id = VENDOR_ID_AMD;
|
||||
}
|
||||
else if (strcmp (device_vendor, CL_VENDOR_AMD2) == 0)
|
||||
{
|
||||
device_vendor_id = VENDOR_ID_AMD;
|
||||
}
|
||||
@ -2452,8 +2460,6 @@ int opencl_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
|
||||
|
||||
device_param->device_opencl_version = device_opencl_version;
|
||||
|
||||
device_param->opencl_v12 = device_opencl_version[9] > '1' || device_opencl_version[11] >= '2';
|
||||
|
||||
// max_compute_units
|
||||
|
||||
cl_uint device_processors;
|
||||
|
Loading…
Reference in New Issue
Block a user