-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTL_RESULT_SUCCESS_STILL_OPEN_BY_ANOTHER_CALLER #78
Comments
Hi @Valkirie... do you close the existing DX adapter/device as well during such an additional GPU plug-in event? Close everything including IGCL using ctlClose and recreate adapter/IGCL. Can you try it and let us know? Thanks |
Hey @kpsam2000Intel, sorry I'm slightly confused by what you mean with close the existing DX adapter/device. Whenever a new device is added, I'm closing and (re)opening IGCL. Please see GetDeviceIdx() in the following c# wrapper I made : https://pastebin.com/neu3rK05 GetDeviceIdx() is called anytime a new device has landed. public static int GetDeviceIdx(string deviceName)
{
// test
Terminate();
Initialize();
ctl_result_t Result = ctl_result_t.CTL_RESULT_SUCCESS;
uint adapterCount = 0;
// Get the number of Intel devices
IntPtr hDevices = EnumerateDevices(ref adapterCount);
if (hDevices == IntPtr.Zero)
return -1;
// Convert the device handles to an array of IntPtr
devices = new IntPtr[adapterCount];
Marshal.Copy(hDevices, devices, 0, (int)adapterCount);
if (devices.Length == 0)
return -1;
for (int idx = 0; idx < devices.Length; idx++)
{
ctl_device_adapter_properties_t StDeviceAdapterProperties = new();
ctl_device_adapter_handle_t hDevice = new()
{
handle = devices[idx]
};
Result = GetDeviceProperties(hDevice, ref StDeviceAdapterProperties);
if (Result != ctl_result_t.CTL_RESULT_SUCCESS)
continue;
if (deviceName.Equals(StDeviceAdapterProperties.name))
return idx;
}
return -1;
}
public static void Terminate()
{
if (pDll != IntPtr.Zero)
{
CloseIgcl();
FreeLibrary(pDll);
pDll = IntPtr.Zero;
}
} |
Still unable to fix CTL_RESULT_ERROR_OS_CALL and fix intel/drivers.gpu.control-library#78
Any update ? It's still impossible to properly detect a hotswapped display while the dll is loaded. Application has to be restarted. |
@kpsam2000Intel still around ? |
I believe Sameer was referring to disabling the current adapter that was enabled as well, will let him confirm but please try disabling that device before IGCL close and see if that helps. |
I'm using IGCL within a c# project using DllImport. If I start my project, load IGCL, enumerate devices and adapter count with one GPU plugged in, it'll properly report it. If I plug another GPU while the app is running and call EnumerateDevices once more, IGCL will still only report one GPU.
Calling CloseIgcl() and InitializeIgcl() doesn't change anything as ctlClose() will return CTL_RESULT_SUCCESS_STILL_OPEN_BY_ANOTHER_CALLER. Even though I'm trying to terminate IGCL from my C# app.
The text was updated successfully, but these errors were encountered: