Improbable-AI / walk-these-ways

Sim-to-real RL training and deployment tools for the Unitree Go1 robot.
https://gmargo11.github.io/walk-these-ways/
Other
488 stars 129 forks source link

Importing module 'gym_38' RuntimeError: The following operation failed in the TorchScript interpreter. Traceback of TorchScript (most recent call last): RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch) #60

Closed tula-liuxin closed 6 months ago

tula-liuxin commented 6 months ago

Hi, thank you for this amazing work, but I come across this error:

(walk-these-ways) leo@leo-pc:~/walk-these-ways$ python scripts/test.py Importing module 'gym_38' (/home/leo/isaacgym/python/isaacgym/_bindings/linux-x86_64/gym_38.so) Setting GYM_USD_PLUG_INFO_PATH to /home/leo/isaacgym/python/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json PyTorch version 1.10.0+cu113 Device count 1 /home/leo/isaacgym/python/isaacgym/_bindings/src/gymtorch Using /home/leo/.cache/torch_extensions/py38_cu113 as PyTorch extensions root... Creating extension directory /home/leo/.cache/torch_extensions/py38_cu113/gymtorch... Emitting ninja build file /home/leo/.cache/torch_extensions/py38_cu113/gymtorch/build.ninja... Building extension module gymtorch... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/2] c++ -MMD -MF gymtorch.o.d -DTORCH_EXTENSION_NAME=gymtorch -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/leo/miniforge3/envs/walk-these-ways/lib/python3.8/site-packages/torch/include -isystem /home/leo/miniforge3/envs/walk-these-ways/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/leo/miniforge3/envs/walk-these-ways/lib/python3.8/site-packages/torch/include/TH -isystem /home/leo/miniforge3/envs/walk-these-ways/lib/python3.8/site-packages/torch/include/THC -isystem /home/leo/miniforge3/envs/walk-these-ways/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -DTORCH_MAJOR=1 -DTORCH_MINOR=10 -c /home/leo/isaacgym/python/isaacgym/_bindings/src/gymtorch/gymtorch.cpp -o gymtorch.o [2/2] c++ gymtorch.o -shared -L/home/leo/miniforge3/envs/walk-these-ways/lib/python3.8/site-packages/torch/lib -lc10 -ltorch_cpu -ltorch -ltorch_python -o gymtorch.so Loading extension module gymtorch... [Warning] [carb.gym.plugin] useGpuPipeline is set, forcing GPU PhysX Not connected to PVD +++ Using GPU PhysX Physics Engine: PhysX Physics Device: cuda:0 GPU Pipeline: enabled Traceback (most recent call last): File "scripts/test.py", line 206, in run_env(render=True, headless=False) File "scripts/test.py", line 188, in run_env env = VelocityTrackingEasyEnv(sim_device='cuda:0', headless=False, cfg=Cfg) File "/home/leo/walk-these-ways/go1_gym/envs/go1/velocity_tracking/init.py", line 19, in init super().init(cfg, sim_params, physics_engine, sim_device, headless, eval_cfg, initial_dynamics_dict) File "/home/leo/walk-these-ways/go1_gym/envs/base/legged_robot.py", line 44, in init super().init(self.cfg, sim_params, physics_engine, sim_device, headless, self.eval_cfg) File "/home/leo/walk-these-ways/go1_gym/envs/base/base_task.py", line 71, in init self.create_sim() File "/home/leo/walk-these-ways/go1_gym/envs/base/legged_robot.py", line 515, in create_sim self._create_envs() File "/home/leo/walk-these-ways/go1_gym/envs/base/legged_robot.py", line 1555, in _create_envs pos[0:1] += torch_rand_float(-self.cfg.terrain.x_init_range, self.cfg.terrain.x_init_range, (1, 1), RuntimeError: The following operation failed in the TorchScript interpreter. Traceback of TorchScript (most recent call last): RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch)

================================================================================= Other information: ubuntu 20.04 Nvidia driver: nvidia-driver-525-server GPU: 4060 Ti 16GB python=3.8 ( I successfully run isaac gym, and pip install -e . this repo as well)

The former prequisites have been successfully configured, like: Installation Install pytorch 1.10 with cuda-11.3: pip3 install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html Install Isaac Gym Download and install Isaac Gym Preview 4 from https://developer.nvidia.com/isaac-gym

unzip the file via:

tar -xf IsaacGym_Preview_4_Package.tar.gz now install the python package

cd isaacgym/python && pip install -e . Verify the installation by try running an example

python examples/1080_balls_of_solitude.py For troubleshooting check docs isaacgym/docs/index.html

I guess what you mentioned here is to pip install -e . under walk-these-ways (I.e. this repo): https://github.com/Improbable-AI/walk-these-ways?tab=readme-ov-file#install-the-go1_gym-package

==========================================================================================

tula-liuxin commented 6 months ago

I reinstalled the ubuntu20.04, and try antoher nvidia driver (nvidia-deriver-525), and finally succeeded. Kind of weird to me, but this project is awesome tho.