robotology-superbuild icon indicating copy to clipboard operation
robotology-superbuild copied to clipboard

Problems installing PyTorch with cuda support in conda environment used for compiling robotology-superbuild

Open traversaro opened this issue 9 months ago • 0 comments

@carloscp3009 @GiulioRomualdi reported me that there were problems installing PyTorch with cuda support in an environment used to create robotology-superbuild. I tried now with:

mamba create -n robenvpytorch -c conda-forge ace asio assimp boost eigen freetype glew glfw glm graphviz gsl ipopt irrlicht libjpeg-turbo libmatio libode libxml2 nlohmann_json pcl opencv portaudio qt-main sdl sdl2 sqlite tinyxml tinyxml2 spdlog lua soxr qhull cmake compilers make ninja pkg-config tomlplusplus libzlib ffmpeg onnxruntime-cpp pytorch

that seems to work fine:

(robenvpytorch) traversaro@IITBMP014LW012:~$ python
Python 3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:50:58) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True

So we probably need to investigate more what happened on the robot laptop. Note that in general installing packages from channels not compatible with conda-forge (such as pytorch or nvidia) may work but can create problems, see https://github.com/conda-forge/pytorch-cpu-feedstock/issues/218#issuecomment-1918954704 .

traversaro avatar May 05 '24 21:05 traversaro