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
Windows+Py3.8: A dynamic link library (DLL) initialization routine failed. #214
Comments
Thanks for the report! Unfortunately, I'm completely at a loss for what's going on here, and I can't reproduce this for lack of a Windows machine. Any clues? |
I have started to look into this issue, but have no clue yet. Do pycuda and pyopencl work with Python 3.8.0b2 on Linux? |
I installed 3.8b2 from Debian, but none of pip, virtualenv, |
Just retried this endeavor on Linux (amd64) and Debian's Python 3.8.0~b2-5, and I had no issue. I had to compile
|
I retried with Python 3.8.0b3 on Windows without luck. Not sure how to tackle this. Maybe rebuilding in debug mode will reveal something... |
This seems to be related to how numpy is initialized in Things work when I take out the code from For pyopencl, this works for me: diff --git a/src/numpy_init.hpp b/src/numpy_init.hpp
index 2cf7fe0..527bbdb 100644
--- a/src/numpy_init.hpp
+++ b/src/numpy_init.hpp
@@ -32,6 +32,7 @@
#include <numpy/arrayobject.h>
#include <stdexcept>
+/*
namespace
{
@@ -55,7 +56,7 @@ namespace
} _array_importer;
}
-
+*/
#endif
diff --git a/src/wrap_cl.cpp b/src/wrap_cl.cpp
index 2ea3d59..6ec9095 100644
--- a/src/wrap_cl.cpp
+++ b/src/wrap_cl.cpp
@@ -41,6 +41,11 @@ extern void pyopencl_expose_mempool(py::module &m);
PYBIND11_MODULE(_cl, m)
{
+ if (_import_array() < 0) {
+ PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
+ return;
+ }
+
pyopencl_expose_constants(m);
pyopencl_expose_part_1(m);
pyopencl_expose_part_2(m);
|
Fix numpy initialization. x-ref: inducer/pycuda#214 See merge request inducer/pyopencl!89
Fix numpy initialization. Closes gh-214 See merge request inducer/pycuda!18
Thanks for doing the detective work on this! Looking at the documentation, it is actually kind of surprising that the previous scheme worked at all. Could you check if these recent changes work for you? (I've also made analogous changes to PyOpenCL.) If so, I would roll a new release. |
PyOpenCl and PyCUDA are now working for me on Python 3.8 for Windows.. Thank you! |
Likewise thanks for for your help. I've just released new versions of PyCUDA and PyOpenCL. |
@cgohlke reported in #213, moved here:
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed
It seems that this error is not due to CUDA, boost, or pybind11 since the simple
_pvt_struct
extension andpyopencl-2019.1
also fail:The text was updated successfully, but these errors were encountered: