jackun / openencodevfw

No longer a VFW (video for windows) frontend for AMD VCE H264 encoder
58 stars 12 forks source link

Encoder always uses the first VCE device #3

Closed NT-Dynamite closed 10 years ago

NT-Dynamite commented 10 years ago

I have run into a problem with openencodevfw in multi-gpu environments. The encoder will always select the first available device.

I do not know C++ well but a quick look at the code brought me to this:

compress.cpp [line 131]

    /**************************************************************************/
    /* Check deviceHandle.numDevices for number of devices and choose the     */
    /* device on which user wants to create the encoder                       */
    /* In this case device 0 is choosen                                       */
    /**************************************************************************/
    uint32 deviceId = mDeviceHandle.deviceInfo[0].device_id;
    clDeviceID = reinterpret_cast<cl_device_id>(deviceId);
    Log(L"Devices: %d\n", mDeviceHandle.numDevices);

With my limited understanding of programming i am having trouble recompiling the project with a fix in place but i suspect that the issue may as simple as saving the user choice from the GUI combobox and loading it into this line "uint32 deviceId = mDeviceHandle.deviceInfo[0].device_id;".

jackun commented 10 years ago

Yes. I haven't looked into that much yet, more specifically how to actually identify gpus reliably.

Just change:

mDeviceHandle.deviceInfo[0].device_id;

to

mDeviceHandle.deviceInfo[1].device_id;
jackun commented 10 years ago

Try binaries from latest commit. Should also fix colours. https://github.com/jackun/openencodevfw/commit/9ddab6379b99025958e809dee475e5c2dd18a1e4

NT-Dynamite commented 10 years ago

Thank you for your response, those binaries do solve the issue!