Open yj-Tang opened 1 year ago
I had the same problem for Cartpole, i was able to solve it by adding this settings in isaacgymenvs.make, can you try to see if by doing so it works?
import gym
import isaacgym
import isaacgymenvs
import torch
envs = isaacgymenvs.make(
seed=0,
task="Cartpole",
num_envs=2000,
sim_device="cuda:0",
rl_device="cuda:0",
graphics_device_id=0,
headless=False,
multi_gpu=False,
virtual_screen_capture=False,
force_render=False
)
envs.is_vector_env = True
envs.reset()
for _ in range(100):
envs.render()
envs.step( torch.rand((2000,)+envs.action_space.shape, device="cuda:0")
)
I had the same problem for Cartpole, i was able to solve it by adding this settings in isaacgymenvs.make, can you try to see if by doing so it works?
import gym import isaacgym import isaacgymenvs import torch envs = isaacgymenvs.make( seed=0, task="Cartpole", num_envs=2000, sim_device="cuda:0", rl_device="cuda:0", graphics_device_id=0, headless=False, multi_gpu=False, virtual_screen_capture=False, force_render=False ) envs.is_vector_env = True envs.reset() for _ in range(100): envs.render() envs.step( torch.rand((2000,)+envs.action_space.shape, device="cuda:0") )
It works for me as well! Thank you for the reply! ^ ^
Error raised when running the example code. --"[card.gym.plugin] Error creating viewer: Sim->Graphics is nullptr" , as shown in the picture![MicrosoftTeams-image](https://user-images.githubusercontent.com/29531753/195559580-ce934af5-8088-4027-8ffc-d9081987dff6.png)