jhwangbo / ME491_2022_project

MIT License
0 stars 2 forks source link

error with compile setup.py in ME491_2022_project #12

Closed SanghaJeon closed 1 year ago

SanghaJeon commented 1 year ago

Hi,

I checked that anymal examples(setup.py, runner.py, tester.py, and retrain) is working. Because of my python3 path problem, I'm using code like these,

sudo -E /home/sangha/miniconda3/bin/python3 setup.py develop sudo -E /home/sangha/miniconda3/bin/python3 raisimGymME491/env/envs/aliengo_jump/runner.py

But with these codes, I have error in first code(setup.py). And if I run ' sudo python3 setup.py develop', it works with compiling setup.py But after compile, I have error in ' sudo python3 raisimGymME491/env/envs/aliengo_jump/runner.py '. The error message is like this,

Traceback (most recent call last): File "raisimGymME491/env/envs/aliengo_jump/runner.py", line 3, in from raisimGymME491.helper.raisim_gym_helper import ConfigurationSaver, load_param, tensorboard_launcher File "/home/sangha/raisim_ws/raisimlib/ME491_2022_project/raisimGymME491/helper/init.py", line 1, in from .raisim_gym_helper import * File "/home/sangha/raisim_ws/raisimlib/ME491_2022_project/raisimGymME491/helper/raisim_gym_helper.py", line 5, in import torch File "/usr/local/lib/python3.8/dist-packages/torch-1.13.0-py3.8-linux-x86_64.egg/torch/init.py", line 191, in _load_global_deps() File "/usr/local/lib/python3.8/dist-packages/torch-1.13.0-py3.8-linux-x86_64.egg/torch/init.py", line 153, in _load_global_deps ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL) File "/usr/lib/python3.8/ctypes/init.py", line 373, in init self._handle = _dlopen(self._name, mode) OSError: libcublas.so.11: cannot open shared object file: No such file or directory

I add some information about my PC python path info to help understand my situation.

sudo which python3

usr/bin/python3

which python3

/home/sangha/miniconda3/bin/python3

which python

/home/sangha/miniconda3/bin/python

Thank you.

SanghaJeon commented 1 year ago

Error message when I run 'sudo -E /home/sangha/miniconda3/bin/python3 ./setup.py develop' :

running develop /home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( /home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running egg_info writing raisim_gym_torch.egg-info/PKG-INFO writing dependency_links to raisim_gym_torch.egg-info/dependency_links.txt writing requirements to raisim_gym_torch.egg-info/requires.txt writing top-level names to raisim_gym_torch.egg-info/top_level.txt reading manifest file 'raisim_gym_torch.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'raisim_gym_torch.egg-info/SOURCES.txt' running build_ext CMake Error: The current CMakeCache.txt directory /home/sangha/raisim_ws/raisimlib/ME491_2022_project/build/temp.linux-x86_64-cpython-39/CMakeCache.txt is different than the directory /home/sangha/raisim_ws/ME491_2022_project/build/temp.linux-x86_64-cpython-39 where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt CMake Error: The source "/home/sangha/raisim_ws/raisimlib/ME491_2022_project/CMakeLists.txt" does not match the source "/home/sangha/raisim_ws/ME491_2022_project/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory. Traceback (most recent call last): File "/home/sangha/raisim_ws/raisimlib/ME491_2022_project/./setup.py", line 68, in setup( File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands self.run_command(cmd) File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command super().run_command(command) File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.run() File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run self.install_for_development() File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/command/develop.py", line 114, in install_for_development self.run_command('build_ext') File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command self.distribution.run_command(command) File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command super().run_command(command) File "/home/sangha/miniconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.run() File "/home/sangha/raisim_ws/raisimlib/ME491_2022_project/./setup.py", line 38, in run self.build_extension(ext) File "/home/sangha/raisim_ws/raisimlib/ME491_2022_project/./setup.py", line 65, in build_extension subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env) File "/home/sangha/miniconda3/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/home/sangha/raisim_ws/raisimlib/ME491_2022_project', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/sangha/raisim_ws/raisimlib/ME491_2022_project', '-DPYTHON_EXECUTABLE=/home/sangha/miniconda3/bin/python3', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

SanghaJeon commented 1 year ago

There is no pytorch for cuda 11.7 with pip. But my graphic card is recommanded to use cuda 11.7. Should I use cuda 11.6 and pytorch with pip? I think these error occurs with conda.

SeungHunJeon commented 1 year ago

Please follow the raisim Installation. Also, refer to previous question #6.

latest cuda version is not necessary, but you must install the proper version of CUDA w.r.t your graphic driver. follow this link CUDA INSTALL.

Also, you must consider the cuda version when you install the pytorch. follow this link TORCH INSTALL

Meaning of the sudo command : Execute the command with administrator permission => It is necessary while making build file into usr/ directory. also, if you type sudo python, it brings the usr/ directory python (standard python in your local)

As aforementioned, please use conda environment. Do not use sudo command while using conda environment. It automatically build the library into conda/~~/library directory that the permission is not necessary.

sudo -E /home/sangha/miniconda3/bin/python3 setup.py develop

Do not use sudo, directory is wrong. please check raisim installation