[GH-ISSUE #750] Match ADL/NVML device to "our" device number, using PCI ID #386

Closed
opened 2026-10-14 03:04:11 +07:00 by bsakaguchi · 35 comments
Owner

Originally created by @magnumripper on GitHub (Sep 20, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/750

Issue: http://www.openwall.com/lists/john-users/2014/09/17/1 (can also happen with AMD)

For nvidia:
http://developer.download.nvidia.com/compute/cuda/5_5/rel/nvml/nvml.5.319.43.pdf page 49:
6.11.2.18 nvmlReturn_t DECLDIR nvmlDeviceGetHandleByPciBusId (const char ∗ pciBusId, nvmlDevice_t ∗ device)
Acquire the handle for a particular device, based on its PCI bus id.
For all products.
This value corresponds to the nvmlPciInfo_t::busId returned by nvmlDeviceGetPciInfo().

Originally created by @magnumripper on GitHub (Sep 20, 2014). Original GitHub issue: https://github.com/openwall/john/issues/750 Issue: http://www.openwall.com/lists/john-users/2014/09/17/1 (can also happen with AMD) For nvidia: http://developer.download.nvidia.com/compute/cuda/5_5/rel/nvml/nvml.5.319.43.pdf page 49: **6.11.2.18 nvmlReturn_t DECLDIR nvmlDeviceGetHandleByPciBusId (const char ∗ pciBusId, nvmlDevice_t ∗ device)** _Acquire the handle for a particular device, based on its PCI bus id. For all products. This value corresponds to the nvmlPciInfo_t::busId returned by nvmlDeviceGetPciInfo()._
bsakaguchi 2026-10-14 03:04:11 +07:00
Author
Owner

@magnumripper commented on GitHub (Sep 20, 2014):

I can't seem to find anything in ADL for matching by PCI ID. We may have to use something else.

<!-- gh-comment-id:56282462 --> @magnumripper commented on GitHub (Sep 20, 2014): I can't seem to find anything in ADL for matching by PCI ID. We may have to use something else.
Author
Owner

@magnumripper commented on GitHub (Sep 20, 2014):

It turns out we may need this change at a lower (or earlier) level to guarantee proper functionality with MPI and --fork. This means the issue with ADL/NVML will probably not need a separate fix.

https://anteru.net/2014/08/01/2483/

We should build a device list like this, in PCI order or something.

<!-- gh-comment-id:56282606 --> @magnumripper commented on GitHub (Sep 20, 2014): It turns out we may need this change at a lower (or earlier) level to guarantee proper functionality with MPI and --fork. This means the issue with ADL/NVML will probably not need a separate fix. https://anteru.net/2014/08/01/2483/ We should build a device list like this, in PCI order or something.
Author
Owner

@ghost commented on GitHub (Sep 20, 2014):

My original idea is just to save PCI information about all devices. When needed, just try to find it in a list. POC

diff --git a/src/common-opencl.c b/src/common-opencl.c
index cabf96e..b021e54 100644
--- a/src/common-opencl.c
+++ b/src/common-opencl.c
@@ -258,6 +258,22 @@ static void start_opencl_environment()
    devices[device_pos] = NULL;
 }

+static int get_id_amd(sequence_nr) {
+
+   int amd_id = 0;
+
+   while (amd_id < get_number_of_devices_in_use()) {
+       ret = clGetDeviceInfo(devices[amd_id],
+           CL_DEVICE_TOPOLOGY_AMD, sizeof(topo), &topo, NULL);
+       if (ret == CL_SUCCESS)
+
+           if (dev_hw_info[sequence_nr].bus == topo.pcie.bus &&
+               dev_hw_info[sequence_nr].device = topo.pcie.device)
+               return amd_id;
+       amd_id++;
+   }
+}
+
 static int start_opencl_device(int sequential_id, int *err_type)
 {
    cl_context_properties properties[3];
@@ -271,12 +287,18 @@ static int start_opencl_device(int sequential_id, int *err_type)
    if (gpu_nvidia(device_info[sequential_id])) {
        temp_dev_id[sequential_id] = nvidia++;
        dev_get_temp[sequential_id] = nvml_lib ? nvidia_get_temp : NULL;
+       dev_hw_info[sequential_id].bus = get_device_hw(sequential_id, BUS);
+       dev_hw_info[sequential_id].device = get_device_hw(sequential_id, DEVICE);
    } else if (gpu_amd(device_info[sequential_id])) {
        temp_dev_id[sequential_id] = amd++;
        dev_get_temp[sequential_id] = adl_lib ? amd_get_temp : NULL;
+       dev_hw_info[sequential_id].bus = get_device_hw(sequential_id, BUS);
+       dev_hw_info[sequential_id].device = get_device_hw(sequential_id, DEVICE);
    } else {
        temp_dev_id[sequential_id] = sequential_id;
        dev_get_temp[sequential_id] = NULL;
+       dev_hw_info[sequential_id].bus = -1;
+       dev_hw_info[sequential_id].device = -1;
    }

    HANDLE_CLERROR(clGetDeviceInfo(devices[sequential_id], CL_DEVICE_NAME,
@@ -2362,10 +2384,10 @@ void opencl_list_devices(void)
            fan = temp = util = -1;
            if (gpu_nvidia(device_info[sequence_nr])) {
                if (nvml_lib)
-               nvidia_get_temp(nvidia++, &temp, &fan, &util);
+               nvidia_get_temp(get_id_nvidia(sequence_nr), &temp, &fan, &util);
            } else if (gpu_amd(device_info[sequence_nr])) {
                if (adl_lib)
-               amd_get_temp(amd++, &temp, &fan, &util);
+               amd_get_temp(get_id_amd(sequence_nr), &temp, &fan, &util);
            }
            if (fan >= 0)
                printf("\tFan speed:\t\t%u%%\n", fan);
<!-- gh-comment-id:56284074 --> @ghost commented on GitHub (Sep 20, 2014): My original idea is just to save PCI information about all devices. When needed, just try to find it in a list. POC ``` diff --git a/src/common-opencl.c b/src/common-opencl.c index cabf96e..b021e54 100644 --- a/src/common-opencl.c +++ b/src/common-opencl.c @@ -258,6 +258,22 @@ static void start_opencl_environment() devices[device_pos] = NULL; } +static int get_id_amd(sequence_nr) { + + int amd_id = 0; + + while (amd_id < get_number_of_devices_in_use()) { + ret = clGetDeviceInfo(devices[amd_id], + CL_DEVICE_TOPOLOGY_AMD, sizeof(topo), &topo, NULL); + if (ret == CL_SUCCESS) + + if (dev_hw_info[sequence_nr].bus == topo.pcie.bus && + dev_hw_info[sequence_nr].device = topo.pcie.device) + return amd_id; + amd_id++; + } +} + static int start_opencl_device(int sequential_id, int *err_type) { cl_context_properties properties[3]; @@ -271,12 +287,18 @@ static int start_opencl_device(int sequential_id, int *err_type) if (gpu_nvidia(device_info[sequential_id])) { temp_dev_id[sequential_id] = nvidia++; dev_get_temp[sequential_id] = nvml_lib ? nvidia_get_temp : NULL; + dev_hw_info[sequential_id].bus = get_device_hw(sequential_id, BUS); + dev_hw_info[sequential_id].device = get_device_hw(sequential_id, DEVICE); } else if (gpu_amd(device_info[sequential_id])) { temp_dev_id[sequential_id] = amd++; dev_get_temp[sequential_id] = adl_lib ? amd_get_temp : NULL; + dev_hw_info[sequential_id].bus = get_device_hw(sequential_id, BUS); + dev_hw_info[sequential_id].device = get_device_hw(sequential_id, DEVICE); } else { temp_dev_id[sequential_id] = sequential_id; dev_get_temp[sequential_id] = NULL; + dev_hw_info[sequential_id].bus = -1; + dev_hw_info[sequential_id].device = -1; } HANDLE_CLERROR(clGetDeviceInfo(devices[sequential_id], CL_DEVICE_NAME, @@ -2362,10 +2384,10 @@ void opencl_list_devices(void) fan = temp = util = -1; if (gpu_nvidia(device_info[sequence_nr])) { if (nvml_lib) - nvidia_get_temp(nvidia++, &temp, &fan, &util); + nvidia_get_temp(get_id_nvidia(sequence_nr), &temp, &fan, &util); } else if (gpu_amd(device_info[sequence_nr])) { if (adl_lib) - amd_get_temp(amd++, &temp, &fan, &util); + amd_get_temp(get_id_amd(sequence_nr), &temp, &fan, &util); } if (fan >= 0) printf("\tFan speed:\t\t%u%%\n", fan); ```
Author
Owner

@magnumripper commented on GitHub (Sep 20, 2014):

Looks good. I suppose it doesn't solve the (alleged) issue with device order not being guaranteed consistent between forks or MPI processes but in reality I have never seen that happen so your code might be all we need.

<!-- gh-comment-id:56284170 --> @magnumripper commented on GitHub (Sep 20, 2014): Looks good. I suppose it doesn't solve the (alleged) issue with device order not being guaranteed consistent between forks or MPI processes but in reality I have never seen that happen so your code might be all we need.
Author
Owner

@magnumripper commented on GitHub (Sep 21, 2014):

BTW I found an open source implementation of clinfo. It's a good source for information (though I had to make a PR for some of our recent discoveries).
https://github.com/Oblomov/clinfo/

<!-- gh-comment-id:56284248 --> @magnumripper commented on GitHub (Sep 21, 2014): BTW I found an open source implementation of clinfo. It's a good source for information (though I had to make a PR for some of our recent discoveries). https://github.com/Oblomov/clinfo/
Author
Owner

@ghost commented on GitHub (Sep 21, 2014):

Well,

  • we will load and keep 'bus_number and device_number' [1] for each device.
  • when/if device order change we can seek it using [1]. cl_device_id devices[MAX_GPU_DEVICES] is saved and safe.

I can't solve the issue with device ordering, but I prefer to order devices the way OpenCL API does. So, I will never do something different from clinfo or a 'hello world' application.

If devices change over MPI, I will use PCI details to find any. BTW: do we need a test case to test? I mean:

  • I don't know the use-cases. Suppose a MPI running in two computers, both with 2 GPUs.
    • Can I see on host the information (list=opencl-devices) about both?
    • If so, I guess there is an MPI_MACHINE_ID, inside JtR in an MPI run.
    • MPI_MACHINE_ID=0, BUS=0, DEVICE=1 exists.
    • MPI_MACHINE_ID=1, BUS=0, DEVICE=1 exists.
    • Is there a MPI test machine on Openwall? I have no idea how JtR runs in an MPI run.
<!-- gh-comment-id:56284611 --> @ghost commented on GitHub (Sep 21, 2014): Well, - we will load and keep 'bus_number and device_number' [1] for each device. - when/if device order change we can seek it using [1]. `cl_device_id devices[MAX_GPU_DEVICES]` is saved and safe. I can't solve the issue with device ordering, but I prefer to order devices the way OpenCL API does. So, I will never do something different from clinfo or a 'hello world' application. If devices change over MPI, I will use PCI details to find any. BTW: do we need a test case to test? I mean: - I don't know the use-cases. Suppose a MPI running in two computers, both with 2 GPUs. - Can I see on host the information (list=opencl-devices) about both? - If so, I guess there is an MPI_MACHINE_ID, inside JtR in an MPI run. - MPI_MACHINE_ID=0, BUS=0, DEVICE=1 exists. - MPI_MACHINE_ID=1, BUS=0, DEVICE=1 exists. - Is there a MPI test machine on Openwall? I have no idea how JtR runs in an MPI run.
Author
Owner

@magnumripper commented on GitHub (Sep 21, 2014):

MPI is basically the same as --fork (for this discussion). The options.node_min variable is essentially the machine ID.

<!-- gh-comment-id:56285328 --> @magnumripper commented on GitHub (Sep 21, 2014): MPI is basically the same as --fork (for this discussion). The options.node_min variable is essentially the machine ID.
Author
Owner

@magnumripper commented on GitHub (Sep 21, 2014):

I prefer to order devices the way OpenCL API does

The alleged problem is that OpenCL does not guarantee that the list ends up in the same order between runs. In practice, it does though. But theoretically, device 0 and 1 on Well could swap between two runs.

<!-- gh-comment-id:56285355 --> @magnumripper commented on GitHub (Sep 21, 2014): > I prefer to order devices the way OpenCL API does The alleged problem is that OpenCL does not guarantee that the list ends up in the same order between runs. In practice, it does though. But theoretically, device 0 and 1 on Well could swap between two runs.
Author
Owner

@magnumripper commented on GitHub (Sep 21, 2014):

I think our only priority is to ensure we enumerate the correct ADL/NVML device numbers that matches our device list, at init. Let's ignore the theoretical problems until we see them.

<!-- gh-comment-id:56285406 --> @magnumripper commented on GitHub (Sep 21, 2014): I think our only priority is to ensure we enumerate the correct ADL/NVML device numbers that matches our device list, at init. Let's ignore the theoretical problems until we see them.
Author
Owner

@magnumripper commented on GitHub (Sep 24, 2014):

Hmm I can't see how your patch would fix the problem. The problem is that OpenCL and ADL/NVML may have different device numbers, so OpenCL device 0 may be ADL device 1 and OpenCL device 1 maybe NVML device 0. In order to fix it, we need to ask OpenCL for PCI id of all devices, and then ask ADL (and/or NVML) for PCI id of all devices. Then match them.

Or do I miss something?

<!-- gh-comment-id:56756601 --> @magnumripper commented on GitHub (Sep 24, 2014): Hmm I can't see how your patch would fix the problem. The problem is that OpenCL and ADL/NVML may have different device numbers, so OpenCL device 0 may be ADL device 1 and OpenCL device 1 maybe NVML device 0. In order to fix it, we need to ask OpenCL for PCI id of all devices, and then **ask ADL (and/or NVML)** for PCI id of all devices. Then match them. Or do I miss something?
Author
Owner

@ghost commented on GitHub (Sep 25, 2014):

You mean get_pci_info (line 261) has to call ADL (or NVML) to get PCI data. There are such calls?

<!-- gh-comment-id:56757354 --> @ghost commented on GitHub (Sep 25, 2014): You mean get_pci_info (line 261) has to call ADL (or NVML) to get PCI data. There are such calls?
Author
Owner

@magnumripper commented on GitHub (Sep 25, 2014):

An NVML call is at top of this issue, nvmlDeviceGetPciInfo(). I haven't yet found anything for AMD but I'm pretty sure there's something we can use.

<!-- gh-comment-id:56757531 --> @magnumripper commented on GitHub (Sep 25, 2014): An NVML call is at top of this issue, `nvmlDeviceGetPciInfo()`. I haven't yet found anything for AMD but I'm pretty sure there's something we can use.
Author
Owner

@ghost commented on GitHub (Sep 25, 2014):

I see. It is useless to pair PCI info only. I have to know what the library considers 0, 1, ...

So, lets try to search on AMD info.

<!-- gh-comment-id:56757731 --> @ghost commented on GitHub (Sep 25, 2014): I see. It is useless to pair PCI info only. I have to know what the library considers 0, 1, ... So, lets try to search on AMD info.
Author
Owner

@magnumripper commented on GitHub (Sep 25, 2014):

It's even worse: ADL is OD5 or OD6.

On Well, OpenCL has devices 0=Bonaire, 1=Capeverde and 2=Juniper
The Bonaire is OD6 device 0
The Capeverde and Juniper are OD5 devices 6 and 8 (not sure which is which)

<!-- gh-comment-id:56758955 --> @magnumripper commented on GitHub (Sep 25, 2014): It's even worse: ADL is OD5 or OD6. On Well, OpenCL has devices 0=Bonaire, 1=Capeverde and 2=Juniper The Bonaire is OD6 device 0 The Capeverde and Juniper are OD5 devices 6 and 8 (not sure which is which)
Author
Owner

@magnumripper commented on GitHub (Sep 25, 2014):

BTW current bleeding-jumbo is supposed to just assume that the lowest OpenCL device number for AMD corresponds to the lowest ADL device number, and so on. And the lowest OpenCL device number for nvidia corresponds to the lowest NVML device number. In case of Well, that would happen to be correct but there seems to be a bug somewhere - I do not get any temp/fan info at all.

<!-- gh-comment-id:56759997 --> @magnumripper commented on GitHub (Sep 25, 2014): BTW current bleeding-jumbo is supposed to just assume that the lowest OpenCL device number for AMD corresponds to the lowest ADL device number, and so on. And the lowest OpenCL device number for nvidia corresponds to the lowest NVML device number. In case of Well, that would happen to be correct but there seems to be a bug somewhere - I do not get any temp/fan info at all.
Author
Owner

@ghost commented on GitHub (Sep 25, 2014):

I have a commit to test: cadf6249a1

It outputs what it is finding. Just haven't tested it properly yet.

<!-- gh-comment-id:56760329 --> @ghost commented on GitHub (Sep 25, 2014): I have a commit to test: cadf6249a1dbbe653b9259308c9dc53be802aaa6 It outputs what it is finding. Just haven't tested it properly yet.
Author
Owner

@magnumripper commented on GitHub (Sep 26, 2014):

I committed some code with (for now) some extra output. For nvidia, it shows the NVML device number as well as the PCI ID. For AMD, I still don't know how/what to match but anyway I list OD5/OD6 and their device number as picked by JtR.

Like I said, current scheme is "lowest OpenCL device number for AMD corresponds to the lowest ADL device number, and so on". Here's that code, line 271 of common-opencl.c:

    static int amd = 0, nvidia = 0;

    // Map temp monitoring function to device id
    if (gpu_nvidia(device_info[sequential_id])) {
        temp_dev_id[sequential_id] = nvidia++;
        dev_get_temp[sequential_id] = nvml_lib ? nvidia_get_temp : NULL;
    } else if (gpu_amd(device_info[sequential_id])) {
        temp_dev_id[sequential_id] = amd++;
        dev_get_temp[sequential_id] = adl_lib ? amd_get_temp : NULL;
    } else {
        temp_dev_id[sequential_id] = sequential_id;
        dev_get_temp[sequential_id] = NULL;
    }

Future code might be more like this (very roughly):

    // Map temp monitoring function to device id
    if (gpu_nvidia(device_info[sequential_id]) && nvml_lib) {
        temp_dev_id[sequential_id] = id2nvml(sequential_id);
        dev_get_temp[sequential_id] = nvidia_get_temp;
    } else if (gpu_amd(device_info[sequential_id]) && adl_lib) {
        temp_dev_id[sequential_id] = id2adl(sequential_id);
        dev_get_temp[sequential_id] = amd_get_temp;
    } else {
        temp_dev_id[sequential_id] = sequential_id;
        dev_get_temp[sequential_id] = NULL;
    }
<!-- gh-comment-id:56984592 --> @magnumripper commented on GitHub (Sep 26, 2014): I committed some code with (for now) some extra output. For nvidia, it shows the NVML device number as well as the PCI ID. For AMD, I still don't know how/what to match but anyway I list OD5/OD6 and their device number as picked by JtR. Like I said, current scheme is "lowest OpenCL device number for AMD corresponds to the lowest ADL device number, and so on". Here's that code, line 271 of common-opencl.c: ``` C static int amd = 0, nvidia = 0; // Map temp monitoring function to device id if (gpu_nvidia(device_info[sequential_id])) { temp_dev_id[sequential_id] = nvidia++; dev_get_temp[sequential_id] = nvml_lib ? nvidia_get_temp : NULL; } else if (gpu_amd(device_info[sequential_id])) { temp_dev_id[sequential_id] = amd++; dev_get_temp[sequential_id] = adl_lib ? amd_get_temp : NULL; } else { temp_dev_id[sequential_id] = sequential_id; dev_get_temp[sequential_id] = NULL; } ``` Future code might be more like this (very roughly): ``` C // Map temp monitoring function to device id if (gpu_nvidia(device_info[sequential_id]) && nvml_lib) { temp_dev_id[sequential_id] = id2nvml(sequential_id); dev_get_temp[sequential_id] = nvidia_get_temp; } else if (gpu_amd(device_info[sequential_id]) && adl_lib) { temp_dev_id[sequential_id] = id2adl(sequential_id); dev_get_temp[sequential_id] = amd_get_temp; } else { temp_dev_id[sequential_id] = sequential_id; dev_get_temp[sequential_id] = NULL; } ```
Author
Owner

@magnumripper commented on GitHub (Sep 26, 2014):

This mapping should take place in amd_probe() and nvml_probe() in common-gpu.c though. So we just use sequential_id to name devices in common-opencl.c and the get_temp() functions gets to do the mapping. There already is a weird mapping for AMD, sequential_id -> amd_id -> od5/6_id within amd_probe() and amd_get_temp().

<!-- gh-comment-id:56987135 --> @magnumripper commented on GitHub (Sep 26, 2014): This mapping should take place in `amd_probe()` and `nvml_probe()` in common-gpu.c though. So we just use `sequential_id` to name devices in common-opencl.c and the `get_temp()` functions gets to do the mapping. There already is a weird mapping for AMD, sequential_id -> amd_id -> od5/6_id within `amd_probe()` and `amd_get_temp()`.
Author
Owner

@ghost commented on GitHub (Sep 26, 2014):

Future code might be more like this (very roughly):
[...]
temp_dev_id[sequential_id] = id2nvml(sequential_id);

Indeed, NVIDIA is not a problem:

int id2nvml(int sequential_id) {
    nvmlDevice_t dev;

    if (nvmlDeviceGetHandleByPciBusId(ocl_device_list[sequential_id].busId,
        &dev) == NVML_SUCCESS) {

        int id_NVML;

        if (nvmlDeviceGetIndex(dev, &id_NVML) == NVML_SUCCESS) {
            return id_NVML;
    }
    return -1;
}
<!-- gh-comment-id:56994768 --> @ghost commented on GitHub (Sep 26, 2014): > Future code might be more like this (very roughly): > [...] > `temp_dev_id[sequential_id] = id2nvml(sequential_id);` Indeed, NVIDIA is not a problem: ``` int id2nvml(int sequential_id) { nvmlDevice_t dev; if (nvmlDeviceGetHandleByPciBusId(ocl_device_list[sequential_id].busId, &dev) == NVML_SUCCESS) { int id_NVML; if (nvmlDeviceGetIndex(dev, &id_NVML) == NVML_SUCCESS) { return id_NVML; } return -1; } ```
Author
Owner

@magnumripper commented on GitHub (Sep 26, 2014):

Yeah that looks correct. Are you testing this or should I?

<!-- gh-comment-id:57006055 --> @magnumripper commented on GitHub (Sep 26, 2014): Yeah that looks correct. Are you testing this or should I?
Author
Owner

@ghost commented on GitHub (Sep 26, 2014):

I can't (for a while). Not committed.

<!-- gh-comment-id:57006363 --> @ghost commented on GitHub (Sep 26, 2014): I can't (for a while). Not committed.
Author
Owner

@ghost commented on GitHub (Sep 27, 2014):

This mapping should take place in amd_probe() and nvml_probe() in common-gpu.c

But you decided to put these routines earlier than OpenCL initialization, so OpenCL details are not available. Are you going to load the PCI info using NV/AMD calls to compare latter?

In c81dba9501 you can see and comment on what I have for now. It is the opposite: common-opencl knows PCI detais and compare using native calls when necessary.

<!-- gh-comment-id:57065829 --> @ghost commented on GitHub (Sep 27, 2014): > This mapping should take place in amd_probe() and nvml_probe() in common-gpu.c But you decided to put these routines earlier than OpenCL initialization, so OpenCL details are not available. Are you going to load the PCI info using NV/AMD calls to compare latter? In c81dba950164e107e313703e8f261427fc4a8ac4 you can see and comment on what I have for now. It is the opposite: common-opencl knows PCI detais and compare using native calls when necessary.
Author
Owner

@ghost commented on GitHub (Sep 27, 2014):

I haven't yet found anything for AMD

Have you found this? Looking at adl_structures.h.

/////////////////////////////////////////////////////////////////////////////////////////////
/// \brief Structure containing information about adapter location.
///
/// This structure is used to store information about adapter location.
/// This structure is used by ADLMVPUStatus.
/// \nosubgrouping
////////////////////////////////////////////////////////////////////////////////////////////
typedef struct ADLAdapterLocation
{
/// PCI Bus number : 8 bits 
    int iBus;
/// Device number : 5 bits
    int iDevice;
/// Function number : 3 bits
    int iFunction;
} ADLAdapterLocation,ADLBdf;
<!-- gh-comment-id:57066319 --> @ghost commented on GitHub (Sep 27, 2014): > I haven't yet found anything for AMD Have you found this? Looking at adl_structures.h. ``` ///////////////////////////////////////////////////////////////////////////////////////////// /// \brief Structure containing information about adapter location. /// /// This structure is used to store information about adapter location. /// This structure is used by ADLMVPUStatus. /// \nosubgrouping //////////////////////////////////////////////////////////////////////////////////////////// typedef struct ADLAdapterLocation { /// PCI Bus number : 8 bits int iBus; /// Device number : 5 bits int iDevice; /// Function number : 3 bits int iFunction; } ADLAdapterLocation,ADLBdf; ```
Author
Owner

@magnumripper commented on GitHub (Sep 27, 2014):

Yeah I saw it but MultiVPU appears to be something about Crossfire or something like that. Maybe it can still be used though.

<!-- gh-comment-id:57066614 --> @magnumripper commented on GitHub (Sep 27, 2014): Yeah I saw it but MultiVPU appears to be something about Crossfire or something like that. Maybe it can still be used though.
Author
Owner

@magnumripper commented on GitHub (Sep 27, 2014):

But you decided to put these routines earlier than OpenCL initialization, so OpenCL details are not available. Are you going to load the PCI info using NV/AMD calls to compare latter?

Oh. Well your approach is better then! I have a really hard time keeping track of all of this!

<!-- gh-comment-id:57066718 --> @magnumripper commented on GitHub (Sep 27, 2014): > But you decided to put these routines earlier than OpenCL initialization, so OpenCL details are not available. Are you going to load the PCI info using NV/AMD calls to compare latter? Oh. Well your approach is better then! I have a really hard time keeping track of all of this!
Author
Owner

@magnumripper commented on GitHub (Sep 27, 2014):

I must be dumb. I can't find any function that uses ADLAdapterLocation or ADLMVPUStatus.

<!-- gh-comment-id:57066845 --> @magnumripper commented on GitHub (Sep 27, 2014): I must be dumb. I can't find any function that uses ADLAdapterLocation or ADLMVPUStatus.
Author
Owner

@magnumripper commented on GitHub (Sep 27, 2014):

OK that's because we do not have adl_api.h in our tree:
http://sterlingdesktops.com/pub/lsadl/lsadl-0.1.2/adl_api.h

<!-- gh-comment-id:57066904 --> @magnumripper commented on GitHub (Sep 27, 2014): OK that's because we do not have adl_api.h in our tree: http://sterlingdesktops.com/pub/lsadl/lsadl-0.1.2/adl_api.h
Author
Owner

@magnumripper commented on GitHub (Sep 27, 2014):

Hmm but that one doesn't come from AMD. There has to be a standard file somewhere?

<!-- gh-comment-id:57066973 --> @magnumripper commented on GitHub (Sep 27, 2014): Hmm but that one doesn't come from AMD. There has to be a standard file somewhere?
Author
Owner

@ghost commented on GitHub (Sep 27, 2014):

I haven't found any (and i just download the SDK). The includes dir is a desert.

<!-- gh-comment-id:57066993 --> @ghost commented on GitHub (Sep 27, 2014): I haven't found any (and i just download the SDK). The includes dir is a desert.
Author
Owner

@ghost commented on GitHub (Sep 27, 2014):

To try to undestand it, my best guess is (inside SDK folder).

Doc:

  • AdapterInfo Struct Reference

Sample:

  • Sample/main.c
<!-- gh-comment-id:57067208 --> @ghost commented on GitHub (Sep 27, 2014): To try to undestand it, my best guess is (inside SDK folder). Doc: - AdapterInfo Struct Reference Sample: - Sample/main.c
Author
Owner

@magnumripper commented on GitHub (Sep 27, 2014):

I think it may be worthwile to build http://sterlingdesktops.com/pub/lsadl/lsadl-0.1.2.tar.bz2 and see what it outputs (assuming it's like clinfo but for ADL)

<!-- gh-comment-id:57067699 --> @magnumripper commented on GitHub (Sep 27, 2014): I think it may be worthwile to build http://sterlingdesktops.com/pub/lsadl/lsadl-0.1.2.tar.bz2 and see what it outputs (assuming it's like clinfo but for ADL)
Author
Owner

@magnumripper commented on GitHub (Sep 27, 2014):

Why the f@ck would anyone want gtk in such a tool? I need a command line tool.

<!-- gh-comment-id:57068539 --> @magnumripper commented on GitHub (Sep 27, 2014): Why the f@ck would anyone want gtk in such a tool? I need a command line tool.
Author
Owner

@magnumripper commented on GitHub (Sep 27, 2014):

Nah it doesn't list anything new anyway. Scrap that tool.

<!-- gh-comment-id:57068964 --> @magnumripper commented on GitHub (Sep 27, 2014): Nah it doesn't list anything new anyway. Scrap that tool.
Author
Owner

@ghost commented on GitHub (Sep 29, 2014):

You gave up too soon. Latest commit is a hope. AMD doesn't have the same kind of API, but it seems to work.

<!-- gh-comment-id:57244128 --> @ghost commented on GitHub (Sep 29, 2014): You gave up too soon. Latest commit is a hope. AMD doesn't have the same kind of API, but it seems to work.
Author
Owner

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

Excellent, I believe we can close this.

<!-- gh-comment-id:57854526 --> @magnumripper commented on GitHub (Oct 3, 2014): Excellent, I believe we can close this.
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#386
No description provided.