pmh47 / dirt

DIRT: a fast differentiable renderer for TensorFlow
MIT License
313 stars 63 forks source link

undefined symbol: cuCtxSetCurrent #57

Closed mureva closed 4 years ago

mureva commented 4 years ago

Hi,

I need to get dirt to work as a dependency for something else that I'm wanting to try out.

The install seems to go fine, and then running the test I get undefined references to what I presume is a cuda function: cuCtxSetCurrent

Any suggestions?

I have installed tensorflow 1.14, and am using cuda-10.1 on an Ubuntu 18.04 LTS system.

Name: tensorflow-gpu
Version: 1.14.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages
Requires: tensorboard, astor, tensorflow-estimator, termcolor, gast, grpcio, wheel, keras-preprocessing, wrapt, numpy, keras-applications, absl-py, six, protobuf, google-pasta
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic

Full error output:

 (pyVirtEnv) me@machine:/opt/multiGarment/dirt$ python3 tests/square_test.py 
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint8 = np.dtype([("qint8", np.int8, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint16 = np.dtype([("qint16", np.int16, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint32 = np.dtype([("qint32", np.int32, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   np_resource = np.dtype([("resource", np.ubyte, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint8 = np.dtype([("qint8", np.int8, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint16 = np.dtype([("qint16", np.int16, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   _np_qint32 = np.dtype([("qint32", np.int32, 1)])
 /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
   np_resource = np.dtype([("resource", np.ubyte, 1)])
 Traceback (most recent call last):
   File "tests/square_test.py", line 4, in <module>
     import dirt
   File "/opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/dirt/__init__.py", line 2, in <module>
     from .rasterise_ops import rasterise, rasterise_batch, rasterise_deferred, rasterise_batch_deferred
   File "/opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/dirt/rasterise_ops.py", line 6, in <module>
     _rasterise_module = tf.load_op_library(_lib_path + '/librasterise.so')
   File "/opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py", line 61, in load_op_library
     lib_handle = py_tf.TF_LoadLibrary(library_filename)
 tensorflow.python.framework.errors_impl.NotFoundError: /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/dirt/librasterise.so: undefined symbol: cuCtxSetCurrent

Extra info:

(pyVirtEnv) me@machine:/opt/multiGarment/dirt$ ldd /opt/multiGarment/pyVirtEnv/lib/python3.6/site-packages/dirt/librasterise.so
    linux-vdso.so.1 (0x00007ffe91dba000)
    libEGL.so.1 => /usr/lib/x86_64-linux-gnu/libEGL.so.1 (0x00007fc9b06e8000)
    libOpenGL.so.0 => /usr/lib/x86_64-linux-gnu/libOpenGL.so.0 (0x00007fc9b04ba000)
    libtensorflow_framework.so.1 => not found
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc9b02b2000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc9b0093000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc9afe8f000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc9afb06000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc9af768000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc9af550000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc9af15f000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fc9b0bed000)
    libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fc9aeea9000)
pmh47 commented 4 years ago

This might be a problem with tf 1.14 and cuda 10.1, which are officially not compatible. Does other tf code run correctly (with GPU) in this virtualenv?

mureva commented 4 years ago

Can't claim that it does - looks to me that I need tensorflow >= 2.0 for cuda 10.1.

Looks like the things I'm wanting to test are not tested on tf > 1.13 so...

Will for now assume I need to try and install older Cuda - this should be fun :(

pmh47 commented 4 years ago

Closing as this isn't DIRT-specific. Good luck!