Skip to content
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

Update numpy requirement from 1.19.3 to 1.20.3 #180

Merged
merged 1 commit into from
Jun 20, 2021

Conversation

reductionista
Copy link
Contributor

@reductionista reductionista commented Jun 19, 2021

There is an ABI compatibility issue on some platforms involving the interaction between the Cython-generated shared object files included in the OpenGL-accelerate 3.1.5 and numpy 1.19.3 PyPI packages which can cause a missing symbol error during import.
This causes friture to throw an exception On MacOS Big Sur and Windows during startup.

Fixes two reports of the issue here: #177
And (probably) this one without the logs also: #170.
(I see the same symptom when I try to install the downloadable fricture dmg file on Big Sur)

I don't have a full understanding of the underlying issue, or a full list of which platforms it affects, but I can confirm from my testing on Big Sur that updating the requirements to numpy 1.20.3 fixes the problem there.

Even without friture, the problem can be reproduced in a clean virtualenv by simply installing both pip packages and trying to import like this:

from OpenGL_accelerate.numpy_formathandler import NumpyHandler

It will fail due to this error:

ValueError: ('numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject', 1, <OpenGL.platform.baseplatform.glGetIntegerv object at 0x13f2b60c0>)

And then if you silence that one, it runs into this error instead:

File "src/numpy_formathandler.pyx", line 39, in init OpenGL_accelerate.numpy_formathandler
AttributeError: type object 'OpenGL_accelerate.numpy_formathandler.NumpyHandler' has no attribute '__reduce_cython__'

My guess is that they may have been compiled with different versions of Cython, where there was a change to the way it handles the pickling of classes (replaces __reduce_cython__ with __reduce__ at runtime), but not sure how to confirm that since the pip packages only include the .so files, not the intermediate .c files.

There is an ABI compatibility issue between OpenGL-accelerate 3.1.5 and
numpy 1.19.3 which can cause a missing symbol error during import.
This causes friture to throw an exception On MacOS Big Sur and Windows
during startup.  Updating to numpy 1.20.3 fixes the problem.
@tlecomte
Copy link
Owner

Thank you very much @reductionista for the great description of the situation and the proposed fix! I'm letting the Github workflow run for this PR, I will do a quick smoke test on Windows and will merge if everything looks ok.

@tlecomte
Copy link
Owner

Looks alright on Windows, I'm merging, thanks again!

I'll increment Friture's version and make a release soon.

@tlecomte tlecomte merged commit 62722be into tlecomte:master Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants