Skip to content

Undefined symbol: _Z24RasterizeMeshesNaiveCudaRKN2at6TensorES2_S2_ifib in pytorch3D (0.1.0) #1456

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

Open
YY-GX opened this issue Feb 18, 2023 · 0 comments

Comments

@YY-GX
Copy link

YY-GX commented Feb 18, 2023

Description of the issue

I'm now using some old codebase implemented by others that depends on pytorch3D (version 0.1.0). So after I install the corresponding version of pytorch3D and run their codebase, then I get this error:

Traceback (most recent call last):
  File "/my_folder/main.py", line 60, in <module>
    from pytorch3d.structures import Meshes, Textures
  File "/my_folder/pytorch3d-0.1.0/pytorch3d/structures/__init__.py", line 3, in <module>
    from .meshes import Meshes
  File "/my_folder/pytorch3d-0.1.0/pytorch3d/structures/meshes.py", line 6, in <module>
    from pytorch3d import _C
ImportError: /my_folder/HandTexture/pytorch3d-0.1.0/pytorch3d/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _Z24RasterizeMeshesNaiveCudaRKN2at6TensorES2_S2_ifib

I've found a similar issue (#29), which seems to be a version issue that requires me to upgrade pytorch3D. However, after I upgrade the pytorch3D, I find that several functions in the old codebase cannot be used: Textures in pytorch3d.structures, TexturedPhongShader in pytorch3d.renderer.

So I guess there're 2 ways to solve this:

  1. Find some other method to solve this undefined symbol issue aside from upgrading pytorch3D.
  2. Replace the Textures in pytorch3d.structures and TexturedPhongShader in pytorch3d.renderer with some new functions (I've attached the corresponding code for this 2 functions used in the codebase).

Could you help me with this issue? Thank you so much!!

corresponding code for the 2 functions

tex = Textures(verts_uvs=verts_uvs, faces_uvs=faces_uvs, maps=new_tex_img)
MeshRenderer(
            rasterizer=MeshRasterizer(
                cameras=self.cameras, 
                raster_settings=raster_settings
            ),
            shader=TexturedPhongShader(
                device=self.device,
                lights=lights,
                materials = material,
                cameras = self.cameras)
        )

conda and pip list

conda list:

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             5.1                       1_gnu  
ca-certificates           2023.01.10           h06a4308_0  
certifi                   2022.12.7        py37h06a4308_0  
charset-normalizer        3.0.1                    pypi_0    pypi
fvcore                    0.1.5.post20221221          pypi_0    pypi
idna                      3.4                      pypi_0    pypi
imageio                   2.25.1                   pypi_0    pypi
iopath                    0.1.10                   pypi_0    pypi
ld_impl_linux-64          2.38                 h1181459_1  
libffi                    3.4.2                h6a678d5_6  
libgcc-ng                 11.2.0               h1234567_1  
libgomp                   11.2.0               h1234567_1  
libstdcxx-ng              11.2.0               h1234567_1  
ncurses                   6.4                  h6a678d5_0  
numpy                     1.21.6                   pypi_0    pypi
nvidia-cublas-cu11        11.10.3.66               pypi_0    pypi
nvidia-cuda-nvrtc-cu11    11.7.99                  pypi_0    pypi
nvidia-cuda-runtime-cu11  11.7.99                  pypi_0    pypi
nvidia-cudnn-cu11         8.5.0.96                 pypi_0    pypi
opencv-python             4.7.0.68                 pypi_0    pypi
openssl                   1.1.1t               h7f8727e_0  
pillow                    9.4.0                    pypi_0    pypi
pip                       22.3.1           py37h06a4308_0  
portalocker               2.7.0                    pypi_0    pypi
python                    3.7.16               h7a1cb2a_0  
pytorch3d                 0.1                       dev_0    <develop>
pyyaml                    6.0                      pypi_0    pypi
readline                  8.2                  h5eee18b_0  
requests                  2.28.2                   pypi_0    pypi
setuptools                65.6.3           py37h06a4308_0  
sqlite                    3.40.1               h5082296_0  
tabulate                  0.9.0                    pypi_0    pypi
termcolor                 2.2.0                    pypi_0    pypi
tk                        8.6.12               h1ccaba5_0  
torch                     1.13.1                   pypi_0    pypi
torchvision               0.14.1                   pypi_0    pypi
tqdm                      4.64.1                   pypi_0    pypi
typing-extensions         4.5.0                    pypi_0    pypi
urllib3                   1.26.14                  pypi_0    pypi
wheel                     0.38.4           py37h06a4308_0  
xz                        5.2.10               h5eee18b_1  
yacs                      0.1.8                    pypi_0    pypi

pip list:

Package                  Version            Editable project location
------------------------ ------------------ -----------------------------------------------------------------------------------------------------
certifi                  2022.12.7
charset-normalizer       3.0.1
fvcore                   0.1.5.post20221221
garage                   2020.9.0rc2.dev0
idna                     3.4
imageio                  2.25.1
iopath                   0.1.10
numpy                    1.21.6
nvidia-cublas-cu11       11.10.3.66
nvidia-cuda-nvrtc-cu11   11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11        8.5.0.96
opencv-python            4.7.0.68
Pillow                   9.4.0
pip                      22.3.1
portalocker              2.7.0
pytorch3d                0.1                /my_folder/pytorch3d-0.1.0
PyYAML                   6.0
requests                 2.28.2
setuptools               65.6.3
tabulate                 0.9.0
termcolor                2.2.0
torch                    1.13.1
torchvision              0.14.1
tqdm                     4.64.1
typing_extensions        4.5.0
urllib3                  1.26.14
wheel                    0.38.4
yacs                     0.1.8

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

1 participant