opendr-eu / opendr

A modular, open and non-proprietary toolkit for core robotic functionalities by harnessing deep learning
Apache License 2.0
611 stars 94 forks source link

GPU installation fix #463

Closed tsampazk closed 10 months ago

tsampazk commented 10 months ago

Fixes #461

This PR fixes GPU detectron2 and torch installation in install.sh and introduces a temporary fix by removing problematic tools (Continual SLAM and Panoptic Segmentation). Detectron2 installation taken from here (CUDA 11.3) and PyTorch installation taken from here (v1.13.1 -> Linux and Windows -> CUDA 11.6).

GPU installation was tested on develop branch with:

Installation of Panoptic Segmentation and Continual SLAM fail during building probably due to mismatches between CUDA versions (system 11.2 vs torch 11.6), so install.sh entirely removes their src directories.

Detectron2 installs fine but seems to fail the tests:

Spoiler warning ERROR: test_single_demo_grasp (unittest.loader._FailedTest) ---------------------------------------------------------------------- ImportError: Failed to import test module: test_single_demo_grasp Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/unittest/loader.py", line 436, in _find_test_path module = self._get_module_from_name(name) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name __import__(name) File "/home/runner/work/opendr/opendr/tests/sources/tools/control/single_demo_grasp/test_single_demo_grasp.py", line 20, in from detectron2.modeling import build_model File "/home/runner/work/opendr/opendr/venv/lib/python3.8/site-packages/detectron2/modeling/__init__.py", line 2, in from detectron2.layers import ShapeSpec File "/home/runner/work/opendr/opendr/venv/lib/python3.8/site-packages/detectron2/layers/__init__.py", line 3, in from .deform_conv import DeformConv, ModulatedDeformConv File "/home/runner/work/opendr/opendr/venv/lib/python3.8/site-packages/detectron2/layers/deform_conv.py", line 11, in from detectron2 import _C ImportError: /home/runner/work/opendr/opendr/venv/lib/python3.8/site-packages/detectron2/_C.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN2at4_ops5zeros4callEN3c108ArrayRefIlEENS2_8optionalINS2_10ScalarTypeEEENS5_INS2_6LayoutEEENS5_INS2_6DeviceEEENS5_IbEE

Temporarily disabled single demo grasp tests.

Any suggestions and/or independent testing are welcome.

tsampazk commented 10 months ago

Test failure is unrelated to this PR, more information https://github.com/opendr-eu/opendr/pull/462#issuecomment-1735049829.