Skip to content

Fix for [libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent] running setup.py #246

@nistream

Description

@nistream

Symption

The setup command crashed with the following output:

(hybrik) {username}:~/HybrIK$ python setup.py develop
Traceback (most recent call last):
  File "setup.py", line 6, in <module>
    from torch.utils.cpp_extension import BuildExtension, CUDAExtension
  File "/home/{username}/anaconda3/envs/hybrik/lib/python3.8/site-packages/torch/__init__.py", line 197, in <module>
    from torch._C import *  # noqa: F403
ImportError: /home/{username}/anaconda3/envs/hybrik/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent

Cause (Suspected)

The installed PyTorch version (or the conda channel it came from) is no longer compatible with your current system environment.

Solution

  1. Remove the broken environment:

    conda deactivate
    conda env remove -n hybrik
  2. Rerun the installation steps, REPLACING this:

    conda install pytorch==1.9.1 torchvision==0.10.1 -c pytorch

    WITH this:

    pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
    
  3. If encounter the following error:

    error: Couldn't find a setup script in /tmp/easy_install-8uovd3gj/scipy-1.16.0rc1.tar.gz

    Just run

    pip install scipy

    Then rerun:

    python setup.py develop
  4. Everything should now work as expected.

Environment

  • Ubuntu 22.04.5 LTS
  • NVIDIA RTX 4090

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions