Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: GPU PhysX can only be enabled once before any other code involving PhysX #157

Open
erwincoumans opened this issue May 10, 2024 · 2 comments

Comments

@erwincoumans
Copy link

erwincoumans commented May 10, 2024

System:

Describe the bug

RuntimeError                              Traceback (most recent call last)
[<ipython-input-6-e701a4c4bdd2>](https://localhost:8080/#) in <cell line: 8>()
      6 import time
      7 num_envs = 2048 # you can go up to 4096 on better GPUs
----> 8 env = gym.make("PickCube-v1", num_envs=num_envs)
      9 env.unwrapped.print_sim_details()
     10 obs, _ = env.reset(seed=0)

5 frames
[/usr/local/lib/python3.10/dist-packages/sapien/physx/__init__.py](https://localhost:8080/#) in enable_gpu()
     46         ctypes.CDLL(str(dll), ctypes.RTLD_LOCAL)
     47 
---> 48     _enable_gpu()

RuntimeError: GPU PhysX can only be enabled once before any other code involving PhysX

To Reproduce
Steps to reproduce the behavior (use pastebin for code):

  1. open https://colab.research.google.com/github/haosulab/ManiSkill/blob/main/examples/tutorials/1_quickstart.ipynb#scrollTo=VHxJTaQA-cPq
  2. run all cells

Cell 6 1.2 GPU (State-only) reports the error, even after restarting the run-time.

@erwincoumans
Copy link
Author

image

@StoneT2000
Copy link
Member

StoneT2000 commented May 23, 2024

Sorry I just saw this, this issue should probably go to the ManiSkill repo but I will take a look here. Does this bug still exist? There have been some updates since 2 weeks ago. I just tried running the notebook code again, running the setup code section and then just 1.2 + 1.3 and it is ok

Note that there is a bug with colab where GPU memory doesn't get released if you create environments via python code in the cell. It works fine otherwise if you are calling scripts like the example PPO code there (since the process closes completely), hence why the notebook mentions having to restart session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants