[GH-ISSUE #836] Opencl issues with PCI id mapping on Windows #446

Closed
opened 2026-10-14 03:07:58 +07:00 by bsakaguchi · 15 comments
Owner

Originally created by @jfoug on GitHub (Oct 29, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/836

This section of opencl-common.c fails, but if I comment it out things are fine. (around line 330)

// Get hardware bus/PCIE information.
HANDLE_CLERROR(
    get_pci_info(sequential_id,
    &ocl_device_list[sequential_id].pci_info),
    "Error querying PCI bus info");

If this code is NOT required, then why should it be allowed to cause jtr to fail?

Originally created by @jfoug on GitHub (Oct 29, 2014). Original GitHub issue: https://github.com/openwall/john/issues/836 This section of opencl-common.c fails, but if I comment it out things are fine. (around line 330) ``` // Get hardware bus/PCIE information. HANDLE_CLERROR( get_pci_info(sequential_id, &ocl_device_list[sequential_id].pci_info), "Error querying PCI bus info"); ``` If this code is NOT required, then why should it be allowed to cause jtr to fail?
bsakaguchi 2026-10-14 03:07:58 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@jfoug commented on GitHub (Oct 29, 2014):

With the above code, I get this:

$ ../run/john -test=0 -format=rar-opencl
Will run 8 OpenMP threads
OpenCL error (CL_INVALID_VALUE) in file (common-opencl.c) at line (330) - (Error querying PCI bus info)
<!-- gh-comment-id:60984672 --> @jfoug commented on GitHub (Oct 29, 2014): With the above code, I get this: ``` $ ../run/john -test=0 -format=rar-opencl Will run 8 OpenMP threads OpenCL error (CL_INVALID_VALUE) in file (common-opencl.c) at line (330) - (Error querying PCI bus info) ```
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2014):

That's a new one. No we should definitely not fail hard on that. This code is tested on a number of Intel CPU drivers - what version are you using?

The PCI info is required for proper matching of devices <-> sensor readings from AMD and nvidia GPUs. For Intel, we don't need it at all but I have never seen this problem and I do test several drivers. Incuding the ones on well, bull and super.

<!-- gh-comment-id:61009798 --> @magnumripper commented on GitHub (Oct 29, 2014): That's a new one. No we should definitely not fail hard on that. This code is tested on a number of Intel CPU drivers - what version are you using? The PCI info is required for proper matching of devices <-> sensor readings from AMD and nvidia GPUs. For Intel, we don't need it at all but I have never seen this problem and I do test several drivers. Incuding the ones on well, bull and super.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2014):

Does --list=opencl-devices also fail?

<!-- gh-comment-id:61009879 --> @magnumripper commented on GitHub (Oct 29, 2014): Does --list=opencl-devices also fail?
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2014):

The function called, get_pci_info(), even have this

            if (cpu_intel(device_info[sequential_id]))
                return CL_SUCCESS;

So something is not right.

<!-- gh-comment-id:61010874 --> @magnumripper commented on GitHub (Oct 29, 2014): The function called, get_pci_info(), even have this ``` if (cpu_intel(device_info[sequential_id])) return CL_SUCCESS; ``` So something is not right.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2014):

Is this Windows or Linux?

<!-- gh-comment-id:61011766 --> @magnumripper commented on GitHub (Oct 29, 2014): Is this Windows or Linux?
Author
Owner

@jfoug commented on GitHub (Oct 29, 2014):

$ ../run/john --list=opencl-devices

Platform #0 name: AMD Accelerated Parallel Processing
Platform version: OpenCL 1.2 AMD-APP (1124.2)
        Device #0 (0) name:     Cedar
        Board name:             ATI Radeon HD 5450
        Device vendor:          Advanced Micro Devices, Inc.
        Device type:            GPU (LE)
        Device version:         OpenCL 1.2 AMD-APP (1124.2)
        Driver version:         1124.2 (VM)
        Native vector widths:   char 16, short 8, int 4, long 2
        Preferred vector width: char 16, short 8, int 4, long 2
        Global Memory:          512.5 MB
        Local Memory:           32.0 KB (Local)
        Max memory alloc. size: 190.1 MB
        Max clock (MHz):        650
        Profiling timer res.:   1 ns
        Max Work Group Size:    128
        Parallel compute cores: 2
        Stream processors:      160  (2 x 80)
        PCI device topology:

        Device #1 (1) name:     Cedar
        Board name:             ATI Radeon HD 5450
        Device vendor:          Advanced Micro Devices, Inc.
        Device type:            GPU (LE)
        Device version:         OpenCL 1.2 AMD-APP (1124.2)
        Driver version:         1124.2 (VM)
        Native vector widths:   char 16, short 8, int 4, long 2
        Preferred vector width: char 16, short 8, int 4, long 2
        Global Memory:          512.5 MB
        Local Memory:           32.0 KB (Local)
        Max memory alloc. size: 190.1 MB
        Max clock (MHz):        650
        Profiling timer res.:   1 ns
        Max Work Group Size:    128
        Parallel compute cores: 2
        Stream processors:      160  (2 x 80)
        PCI device topology:

        Device #2 (2) name:     Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
        Device vendor:          GenuineIntel
        Device type:            CPU (LE)
        Device version:         OpenCL 1.2 AMD-APP (1124.2)
        Driver version:         1124.2 (sse2,avx)
        Native vector widths:   char 16, short 8, int 4, long 2
        Preferred vector width: char 16, short 8, int 4, long 2
        Global Memory:          7.0 GB
        Global Memory Cache:    32.0 KB
        Local Memory:           32.0 KB (Global)
        Max memory alloc. size: 2.0 GB
        Max clock (MHz):        3392
        Profiling timer res.:   301 ns
        Max Work Group Size:    1024
        Parallel compute cores: 8
        PCI device topology:

This is Win7-64

<!-- gh-comment-id:61013735 --> @jfoug commented on GitHub (Oct 29, 2014): $ ../run/john --list=opencl-devices ``` Platform #0 name: AMD Accelerated Parallel Processing Platform version: OpenCL 1.2 AMD-APP (1124.2) Device #0 (0) name: Cedar Board name: ATI Radeon HD 5450 Device vendor: Advanced Micro Devices, Inc. Device type: GPU (LE) Device version: OpenCL 1.2 AMD-APP (1124.2) Driver version: 1124.2 (VM) Native vector widths: char 16, short 8, int 4, long 2 Preferred vector width: char 16, short 8, int 4, long 2 Global Memory: 512.5 MB Local Memory: 32.0 KB (Local) Max memory alloc. size: 190.1 MB Max clock (MHz): 650 Profiling timer res.: 1 ns Max Work Group Size: 128 Parallel compute cores: 2 Stream processors: 160 (2 x 80) PCI device topology: Device #1 (1) name: Cedar Board name: ATI Radeon HD 5450 Device vendor: Advanced Micro Devices, Inc. Device type: GPU (LE) Device version: OpenCL 1.2 AMD-APP (1124.2) Driver version: 1124.2 (VM) Native vector widths: char 16, short 8, int 4, long 2 Preferred vector width: char 16, short 8, int 4, long 2 Global Memory: 512.5 MB Local Memory: 32.0 KB (Local) Max memory alloc. size: 190.1 MB Max clock (MHz): 650 Profiling timer res.: 1 ns Max Work Group Size: 128 Parallel compute cores: 2 Stream processors: 160 (2 x 80) PCI device topology: Device #2 (2) name: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz Device vendor: GenuineIntel Device type: CPU (LE) Device version: OpenCL 1.2 AMD-APP (1124.2) Driver version: 1124.2 (sse2,avx) Native vector widths: char 16, short 8, int 4, long 2 Preferred vector width: char 16, short 8, int 4, long 2 Global Memory: 7.0 GB Global Memory Cache: 32.0 KB Local Memory: 32.0 KB (Global) Max memory alloc. size: 2.0 GB Max clock (MHz): 3392 Profiling timer res.: 301 ns Max Work Group Size: 1024 Parallel compute cores: 8 PCI device topology: ``` This is Win7-64
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2014):

Step the get_pci_info() function and see why it does not return CL_SUCCESS

<!-- gh-comment-id:61014069 --> @magnumripper commented on GitHub (Oct 29, 2014): Step the get_pci_info() function and see why it does not return CL_SUCCESS
Author
Owner

@jfoug commented on GitHub (Oct 29, 2014):

Again, this is with that code commented out that has problems on this machine

<!-- gh-comment-id:61014628 --> @jfoug commented on GitHub (Oct 29, 2014): Again, this is with that code commented out that has problems on this machine
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2014):

I bet 10d966e fixes it. But I can't really see why it's needed.

<!-- gh-comment-id:61015286 --> @magnumripper commented on GitHub (Oct 29, 2014): I bet 10d966e fixes it. But I can't really see why it's needed.
Author
Owner

@jfoug commented on GitHub (Oct 29, 2014):

Line 283 is the return. So clGetDeviceInfo() does not return suucess and then cpu_intel() returns false

<!-- gh-comment-id:61016584 --> @jfoug commented on GitHub (Oct 29, 2014): Line 283 is the return. So clGetDeviceInfo() does not return suucess and then cpu_intel() returns false
Author
Owner

@jfoug commented on GitHub (Oct 29, 2014):

I added this to the return

            if (cpu_intel(device_info[sequential_id]))
                return CL_SUCCESS;
            else {
+               printf ("sequential_id=%d and ret%d\n", sequential_id,ret);
                return ret;
            }

and it shows:

sequential_id=0 and ret-30

<!-- gh-comment-id:61016965 --> @jfoug commented on GitHub (Oct 29, 2014): I added this to the return ``` if (cpu_intel(device_info[sequential_id])) return CL_SUCCESS; else { + printf ("sequential_id=%d and ret%d\n", sequential_id,ret); return ret; } ``` and it shows: sequential_id=0 and ret-30
Author
Owner

@jfoug commented on GitHub (Oct 29, 2014):

10d966e works the same as my original comment it out method. I am sure the call still fails, it is just that it does not fail with a fatal error now.

<!-- gh-comment-id:61017217 --> @jfoug commented on GitHub (Oct 29, 2014): 10d966e works the same as my original comment it out method. I am sure the call still fails, it is just that it does not fail with a fatal error now.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2014):

Well not exactly the same. In 10d966e it will work as intended with an AMD or nvidia GPU and Linux as OS...

<!-- gh-comment-id:61018001 --> @magnumripper commented on GitHub (Oct 29, 2014): Well not exactly the same. In 10d966e it will work as intended with an AMD or nvidia GPU and Linux as OS...
Author
Owner

@magnumripper commented on GitHub (Oct 30, 2014):

sequential_id=0 and ret-30

So it's not about the CPU, it fails mapping PCI id to GPU too. This is also seen in the list output. Perhaps the Windows driver lacks that functionality. Error -30 is CL_INVALID_VALUE

<!-- gh-comment-id:61058511 --> @magnumripper commented on GitHub (Oct 30, 2014): > sequential_id=0 and ret-30 So it's not about the CPU, it fails mapping PCI id to GPU too. This is also seen in the list output. Perhaps the Windows driver lacks that functionality. Error -30 is CL_INVALID_VALUE
Author
Owner

@magnumripper commented on GitHub (Oct 30, 2014):

Anyway, until we try to add sensors support to Windows builds, this is closed.

<!-- gh-comment-id:61111846 --> @magnumripper commented on GitHub (Oct 30, 2014): Anyway, until we try to add sensors support to Windows builds, this is closed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#446
No description provided.