-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Proxy DLL Loader for Windows #7756
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
[SYCL] Proxy DLL Loader for Windows #7756
Conversation
… the same way that llinked DLLs are. This means these DLL may be unloaded before SYCLs shutdown() routine is called, which will lead to problems when that routine tries to call those DLL to release resources. This PR adds a new proxy DLL that is a linked dependency of SYCL itself. This proxy DLL loads all the SYCL manually loaded DLLs early, before SYCL itself is loaded, and conversely, they are not unloaded until the proxy itself unloads, which is after SYCL unloads. So now the manually loaded plugin DLLs will be resident when shutdown() is called and piTearDown can complete safely and successfully. Signed-off-by: Chris Perkins <[email protected]>
This was all working fine, but there have been other recent PRs that have touched the CMakeLists.txt files, and now this I'm seeing strange errors "Entry Point Not Found" in L0 once this is merged. Reverting to draft while I investigate. |
The fixes that have been merged for the unified runtime now fix the testing problems I was encountering. test suite is passing on Windows. Ready for review. |
… changes to work around windows shutdown limitations
/verify with intel/llvm-test-suite#1465 |
The basics of this PR were straightforward, but it was encountering a lot of test failures and it turns out the root cause of that is a difference seen on Windows in how threads may be terminated. This is a separate issue that is now better understood and I'm addressing. But this PR got twisted up chasing that problem. Because this PR never really made it out of draft, I'm closing it. The final work is a new PR which is here: #8242 |
DLLs manually loaded by SYCL are not tracked as direct dependencies in the same way that linked DLLs are. This means these DLL may be unloaded before SYCLs shutdown() routine is called, which will lead to problems when that routine tries to call those DLL to release resources. This PR adds a new proxy DLL that is a linked dependency of SYCL itself. This proxy DLL loads all the SYCL manually loaded DLLs early, before SYCL itself is loaded, and conversely, they are not unloaded until the proxy itself unloads, which is after SYCL unloads. So now the manually loaded plugin DLLs will be resident when shutdown() is called and piTearDown can complete safely and successfully. I had a previous PR for this work ( #7756 ), but it encountered interference with a difference in how Windows handles threads and their termination. I'm addressing that problem separately. In this version, I am reducing the shutdown() procedure on Windows to only release the plugins and nothing else. This avoids the issue for now. Tests are at intel/llvm-test-suite#1465 --------- Signed-off-by: Chris Perkins <[email protected]>
DLLs manually loaded by SYCL are not tracked as direct dependencies in the same way that linked DLLs are. This means these DLL may be unloaded before SYCLs shutdown() routine is called, which will lead to problems when that routine tries to call those DLL to release resources. This PR adds a new proxy DLL that is a linked dependency of SYCL itself. This proxy DLL loads all the SYCL manually loaded DLLs early, before SYCL itself is loaded, and conversely, they are not unloaded until the proxy itself unloads, which is after SYCL unloads. So now the manually loaded plugin DLLs will be resident when shutdown() is called and piTearDown can complete safely and successfully.
Signed-off-by: Chris Perkins [email protected]