undefined symbol error

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

undefined symbol error

Chris
Hey Andreas,
I am having a similar issue that Kambiz Tavabi was having. Here is the error (I have pycuda on anaconda2 just like Kambiz)

 File "main_class.py", line 17, in <module>
    import pycuda.gl as cuda_gl
 File "/home/uchytilc/anaconda2/lib/python2.7/site-packages/pycuda-2016.1.2-py2.7-linux-x86_64.egg/pycuda/gl/__init__.py", line 2, in <module>
    import pycuda._driver as _drv
ImportError: /home/uchytilc/anaconda2/lib/python2.7/site-packages/pycuda-2016.1.2-py2.7-linux-x86_64.egg/pycuda/_driver.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev

The weird thing is that I have some files that are having this problem and some that are not, with identical import statements.

import sys

from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL.ARB.vertex_buffer_object import *
from OpenGL.GL.ARB.pixel_buffer_object import *

import pycuda.gl as cuda_gl
import pycuda.driver as cuda_driver

The files that are experiencing this issue are all files that run this import statement right at the top in the main.py file, the one I initialize from. The one that doesn't hit this error has the import statements in a second file that is being imported with an __init__.py file. Not sure if this is pure coincidence or not but I figured it was worth bringing up.
Reply | Threaded
Open this post in threaded view
|

Re: undefined symbol error

Andreas Kloeckner
Chris <[hidden email]> writes:

> Hey Andreas,
> I am having a similar issue that Kambiz Tavabi was having. Here is the error
> (I have pycuda on anaconda2 just like Kambiz)
>
>  File "main_class.py", line 17, in <module>
>     import pycuda.gl as cuda_gl
>  File
> "/home/uchytilc/anaconda2/lib/python2.7/site-packages/pycuda-2016.1.2-py2.7-linux-x86_64.egg/pycuda/gl/__init__.py",
> line 2, in <module>
>     import pycuda._driver as _drv
> ImportError:
> /home/uchytilc/anaconda2/lib/python2.7/site-packages/pycuda-2016.1.2-py2.7-linux-x86_64.egg/pycuda/_driver.so:
> undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
>
> The weird thing is that I have some files that are having this problem and
> some that are not, with identical import statements.
>
> import sys
>
> from OpenGL.GL import *
> from OpenGL.GLUT import *
> from OpenGL.GLU import *
> from OpenGL.GL.ARB.vertex_buffer_object import *
> from OpenGL.GL.ARB.pixel_buffer_object import *
>
> import pycuda.gl as cuda_gl
> import pycuda.driver as cuda_driver
>
> The files that are experiencing this issue are all files that run this
> import statement right at the top in the main.py file, the one I initialize
> from. The one that doesn't hit this error has the import statements in a
> second file that is being imported with an __init__.py file. Not sure if
> this is pure coincidence or not but I figured it was worth bringing up.

Sorry for the delay in responding. GCC 5.1 switched its C++ ABI with version
5. I suspect some of the binary packages you have installed are using
the old ABI (Anaconda is built on CentOS 6 I believe and would be using
the old ABI), while C++ software you built on your machine (PyCUDA) will
use the new ABI. See here for more info:

https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html

Try adding (in PyCUDA's siteconf.py)

-D_GLIBCXX_USE_CXX11_ABI=0

to CXXFLAGS.

Hope that helps,
Andreas

_______________________________________________
PyCUDA mailing list
[hidden email]
https://lists.tiker.net/listinfo/pycuda
Reply | Threaded
Open this post in threaded view
|

Re: undefined symbol error

jredwards
Hi,

I have been getting the same error message:

Traceback (most recent call last):
  File "test/test_driver.py", line 6, in <module>
    from pycuda.tools import mark_cuda_test, dtype_to_ctype
  File "/home/jedwards/anaconda3/envs/py36/lib/python3.6/site-packages/pycuda-2016.1.2-py3.6-linux-x86_64.egg/pycuda/tools.py", line 34, in <module>
    import pycuda.driver as cuda
  File "/home/jedwards/anaconda3/envs/py36/lib/python3.6/site-packages/pycuda-2016.1.2-py3.6-linux-x86_64.egg/pycuda/driver.py", line 5, in <module>
    from pycuda._driver import *  # noqa
ImportError: /home/jedwards/anaconda3/envs/py36/lib/python3.6/site-packages/pycuda-2016.1.2-py3.6-linux-x86_64.egg/pycuda/_driver.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev

I added -D_GLIBCXX_USE_CXX11_ABI=0  to the CXXFLAGS when remaking, but the error continues to crop up.

Any ideas?

thanks

James
Reply | Threaded
Open this post in threaded view
|

Re: undefined symbol error

Peter Walsh
Andreas' suggested fix (build pycuda yourself with CXX11_ABI option) worked fine for me.

Are you sure you are running the newly built pycuda? The logs show you using a virtual env etc, sure you installed newly built pycuda to that one etc?

On 30 March 2017 at 15:15, jredwards <[hidden email]> wrote:
Hi,

I have been getting the same error message:

Traceback (most recent call last):
  File "test/test_driver.py", line 6, in <module>
    from pycuda.tools import mark_cuda_test, dtype_to_ctype
  File
"/home/jedwards/anaconda3/envs/py36/lib/python3.6/site-packages/pycuda-2016.1.2-py3.6-linux-x86_64.egg/pycuda/tools.py",
line 34, in <module>
    import pycuda.driver as cuda
  File
"/home/jedwards/anaconda3/envs/py36/lib/python3.6/site-packages/pycuda-2016.1.2-py3.6-linux-x86_64.egg/pycuda/driver.py",
line 5, in <module>
    from pycuda._driver import *  # noqa
ImportError:
/home/jedwards/anaconda3/envs/py36/lib/python3.6/site-packages/pycuda-2016.1.2-py3.6-linux-x86_64.egg/pycuda/_driver.cpython-36m-x86_64-linux-gnu.so:
undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev

I added -D_GLIBCXX_USE_CXX11_ABI=0  to the CXXFLAGS when remaking, but the
error continues to crop up.

Any ideas?

thanks

James



--
View this message in context: http://pycuda.2962900.n2.nabble.com/undefined-symbol-error-tp7575758p7575783.html
Sent from the PyCuda mailing list archive at Nabble.com.

_______________________________________________
PyCUDA mailing list
[hidden email]
https://lists.tiker.net/listinfo/pycuda


_______________________________________________
PyCUDA mailing list
[hidden email]
https://lists.tiker.net/listinfo/pycuda
Reply | Threaded
Open this post in threaded view
|

Re: undefined symbol error

jredwards
Thanks, yes it's definitely installed in that env. I have uninstalled pycuda, performed a su -c "make clean" for the pycuda download and then re-run su -c "make install" with the CXXFLAGS. Still getting the same error.
Reply | Threaded
Open this post in threaded view
|

Re: undefined symbol error

mohsan
This post has NOT been accepted by the mailing list yet.
Hi, I am getting the same error. I changed cxxflags but error didnt go away. Any one solved this problem please help.

regards
Reply | Threaded
Open this post in threaded view
|

Re: undefined symbol error

Hanan
*** After suffering for a day I found I had a misspelled the CUDA_ROOT
environment variable! The setup scripts do not verify it is correct.... Be
ware! ***




--
Sent from: http://pycuda.2962900.n2.nabble.com/

_______________________________________________
PyCUDA mailing list
[hidden email]
https://lists.tiker.net/listinfo/pycuda