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

Google Colaboratory example not working anymore #3

Open
benediktbrandt opened this issue Oct 13, 2020 · 4 comments
Open

Google Colaboratory example not working anymore #3

benediktbrandt opened this issue Oct 13, 2020 · 4 comments

Comments

@benediktbrandt
Copy link

The example code Openpiv_Python_Cython_GPU_demo.ipynb run in Googles Colaboratory (at import pycuda.autoinit) throws the following error:

/usr/local/lib/python2.7/dist-packages/pycuda/driver.py:66: UserWarning: Failed to import the CUDA driver interface, with an error message indicating that the version of your CUDA header does not match the version of your CUDA driver.
  warn("Failed to import the CUDA driver interface, with an error "

ImportErrorTraceback (most recent call last)
<ipython-input-4-6b190a107c72> in <module>()
      1 # check to make sure PyCUDA installed properly
----> 2 import pycuda.autoinit

1 frames
/usr/local/lib/python2.7/dist-packages/pycuda/driver.py in <module>()
     60 
     61 try:
---> 62     from pycuda._driver import *  # noqa
     63 except ImportError as e:
     64     if "_v2" in str(e):

ImportError: /usr/local/lib/python2.7/dist-packages/pycuda/_driver.so: undefined symbol: cuIpcOpenMemHandle_v2
@alexlib
Copy link
Member

alexlib commented Oct 15, 2020

thanks for pointing it out. Do you have by any chance a thought how to solve it? @benediktbrandt
I'm not an expert on PyCUDA and I believe we should move it to Python 3 anyhow.
Could you please check that when you select Google Runtime - Python 3 -

@benediktbrandt
Copy link
Author

If I change the runtime to python3 in colab I get this error:

ImportError: /usr/local/lib/python3.6/dist-packages/pycuda/_driver.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cuDevicePrimaryCtxRelease_v2

I have played around with this quite extensively and even locally I couldn't get python 3 to work, no matter what CUDA toolkit / pycuda version I tried. The failure cause was always an incompatible c++ signature in pycuda (seemingly python 2 does an implicit cast from np.int64 to unsinged long long which python 3 does not do). Not sure whether the root cause for this is a bug in pycuda or something in the openpiv-gpu code.

However I was able to get the notebook to work locally with python 2.7, CUDA toolkit 9.0, gcc 6, pip installed scikit-cuda and latest pip package versions for everything.

@alexlib
Copy link
Member

alexlib commented Oct 16, 2020 via email

@CameronDallas5000
Copy link
Collaborator

Hi @benediktbrandt, thanks for bringing this to my attention! I'm glad you found a way to get the demo running through Python2 and using the old Cuda toolkit. Unfortunately, when I wrote this, Python2 was the only option. I think to truly fix this issue I need to update the code to run with Python3 as there are sections of the code right now that are not compatible with that. I'll keep this issue open as a reminder to me to update this at some point when I have some time. Let me know if in the meantime I can help with anything else.

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

No branches or pull requests

3 participants