1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 07:08:19 +00:00

Merge pull request #124 from philsmd/master

HMS: nvapi does not need a dll (windows + NV)
This commit is contained in:
Jens Steube 2016-01-13 21:13:39 +01:00
commit 6708fef0c2

View File

@ -12856,35 +12856,6 @@ int main (int argc, char **argv)
if (gpu_temp_disable == 0) if (gpu_temp_disable == 0)
{ {
HM_LIB hm_dll_nv = hm_init (VENDOR_ID_NV);
data.hm_dll_nv = hm_dll_nv;
if (hm_dll_nv)
{
#ifdef LINUX
if (hc_NVML_nvmlInit (hm_dll_nv) == NVML_SUCCESS)
{
HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX];
int tmp_in = hm_get_adapter_index_nv (nvGPUHandle);
int tmp_out = 0;
for (int i = 0; i < tmp_in; i++)
{
hm_adapters_nv[tmp_out++].adapter_index.nv = nvGPUHandle[i];
}
for (int i = 0; i < tmp_out; i++)
{
unsigned int speed;
if (hc_NVML_nvmlDeviceGetFanSpeed (hm_dll_nv, 1, hm_adapters_nv[i].adapter_index.nv, &speed) != NVML_ERROR_NOT_SUPPORTED) hm_adapters_nv[i].fan_supported = 1;
}
}
#endif
#ifdef WIN #ifdef WIN
if (NvAPI_Initialize () == NVAPI_OK) if (NvAPI_Initialize () == NVAPI_OK)
{ {
@ -12907,8 +12878,37 @@ int main (int argc, char **argv)
} }
} }
#endif #endif
#ifdef LINUX
HM_LIB hm_dll_nv = hm_init (VENDOR_ID_NV);
data.hm_dll_nv = hm_dll_nv;
if (hm_dll_nv)
{
if (hc_NVML_nvmlInit (hm_dll_nv) == NVML_SUCCESS)
{
HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX];
int tmp_in = hm_get_adapter_index_nv (nvGPUHandle);
int tmp_out = 0;
for (int i = 0; i < tmp_in; i++)
{
hm_adapters_nv[tmp_out++].adapter_index.nv = nvGPUHandle[i];
} }
for (int i = 0; i < tmp_out; i++)
{
unsigned int speed;
if (hc_NVML_nvmlDeviceGetFanSpeed (hm_dll_nv, 1, hm_adapters_nv[i].adapter_index.nv, &speed) != NVML_ERROR_NOT_SUPPORTED) hm_adapters_nv[i].fan_supported = 1;
}
}
}
#endif
HM_LIB hm_dll_amd = hm_init (VENDOR_ID_AMD); HM_LIB hm_dll_amd = hm_init (VENDOR_ID_AMD);
data.hm_dll_amd = hm_dll_amd; data.hm_dll_amd = hm_dll_amd;