twosixlabs / armory-library

Python library for Adversarial ML Evaluation
https://twosixlabs.github.io/armory-library/
MIT License
9 stars 3 forks source link

[BUG]: Pyproject.toml creates broken environment on GPU instance #185

Open deprit opened 1 month ago

deprit commented 1 month ago

Description of the bug

The virtual environment defined by the dependencies inlibrary/pyproject.toml produces an error when evaluating import torch.

Steps To Reproduce

  1. In Armory-Library root, create venv and install packages
    $ python3.12 -m venv ./venv
    $ source ./venv/bin/activate
    $ ./dev-install.sh
  2. Start Python interpreter and import torch package
    $ python
    Python 3.12.3 | packaged by Anaconda, Inc. | (main, May  6 2024, 19:46:43) [GCC 11.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import torch
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/etienne.deprit/projects/armory-library-test/venv/lib/python3.12/site-packages/torch/__init__.py", line 368, in <module>
    from torch._C import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^
    ImportError: /home/etienne.deprit/projects/armory-library-test/venv/lib/python3.12/site-packages/torch/lib/../../nvidia/cusparse/lib/libcusparse.so.12: undefined symbol: __nvJitLinkComplete_12_4, version libnvJitLink.so.12
    >>> 

Additional Information

The project dependencies appeared to work until the release of torch version 2.5.0 on 10/17/2024. Note that the new torch version works correctly in CPU environments and only fails on GPU-enabled machines. Changing the dependency to torch<2.5.0 seemed to resolve the issue.