SimplerEnv icon indicating copy to clipboard operation
SimplerEnv copied to clipboard

RuntimeError: vk::PhysicalDevice::createDeviceUnique: ErrorExtensionNotPresent

Open Jianing2002 opened this issue 11 months ago • 19 comments

Hello,  I encountered an error while running the code from your repository. The error message is as follows:  RuntimeError: vk::PhysicalDevice::createDeviceUnique: ErrorExtensionNotPresent  The error occurs after running 10 episodes on all policies. The error is triggered at the following line in the code:  self._renderer = sapien.SapienRenderer(**renderer_kwargs)  I have checked the following: GPU driver is up-to-date. Vulkan configuration files are present. All dependencies are correctly installed.  However, the issue persists. Based on similar issues reported in other projects, it seems this might be related to the Vulkan renderer configuration. Could you please provide some guidance on how to resolve this error? Any help would be greatly appreciated. Thank you!

Jianing2002 avatar Feb 18 '25 07:02 Jianing2002

Try DISPLAY="" CUDA_VISIBLE_DEVICES=0 python {script}?

xuanlinli17 avatar Feb 19 '25 06:02 xuanlinli17

Try DISPLAY="" CUDA_VISIBLE_DEVICES=0 python {script}?

Thank you for your reply. Actually, I am using CUDA0 and still have this issue

Jianing2002 avatar Feb 20 '25 07:02 Jianing2002

Try DISPLAY="" CUDA_VISIBLE_DEVICES=0 python {script}?

CUDA_VISIBLE_DEVICES=0 works for me. But why other gpus cannot work?

Liang-ZX avatar Feb 25 '25 09:02 Liang-ZX

If you have DISPLAY="" all gpus should work? It's a legacy issue of sapien2.x

xuanlinli17 avatar Mar 10 '25 00:03 xuanlinli17

Same problem here, I checked the vulkan and nvidia driver, both are ok, after setting " export VK_ICD_FILENAMES="" export VK_LAYER_PATH="" export MESA_NO_ACCEL=1 export SVULKAN2_DISABLE=1 export DISPLAY="" export SAPIEN_RENDERER=cpu export PYOPENGL_PLATFORM=egl " this problem still appears and seems to try display with renderer, how to figure this out?

KevinGuo07 avatar Mar 12 '25 11:03 KevinGuo07

I also meet this RuntimeError: vk::PhysicalDevice::createDeviceUnique: ErrorExtensionNotPresent after eval,

it is same with you . The error occurs after running 10 episodes on all policies

LukeLIN-web avatar Apr 11 '25 21:04 LukeLIN-web

If you have DISPLAY="" all gpus should work? It's a legacy issue of sapien2.x

When I use L4,
DISPLAY="" does not work for me . CUDA_VISIBLE_DEVICES=0 does not work for me as well .

When I use A6000. I don't need DISPLAY="" or CUDA_VISIBLE_DEVICES=0 . I don't meet this problem,.

When I use H100. DISPLAY="" does not work for me . CUDA_VISIBLE_DEVICES=0 does not work for me as well .

Chatgpt told me the problem might be Vulkan context / device maxmium 11.

  1. Properly close the environment after each episode At the end of every run_maniskill2_eval_single_episode call, manually close the environment by adding:
    model.visualize_epoch(predicted_actions, images, save_path=action_path)

    env.close()  # <- Add this line to release Vulkan resources
    return success == "success"

Put this line at the very end of run_maniskill2_eval_single_episode (after saving the video).

I tried this , but cannot work.

  1. Build the environment once and reuse it across episodes (use reset() instead of rebuilding) A more advanced solution is:

Build the environment once at the beginning.

Then use reset() to switch between different obj_episode_ids instead of rebuilding the environment every time.

This way, you avoid creating and destroying Vulkan devices repeatedly, saving a lot of resources.

However, your current setup (where each obj_episode_id may have different initialization options) naturally builds a new environment every time. So for now, this is a more advanced solution you might consider later.

  1. Reduce Vulkan/GLFW requirements (disable ray tracing) If you have enable_raytracing=True set when building the environment, try setting it to False to reduce dependency on Vulkan extensions. Ray tracing requires special Vulkan extensions that may not be fully available on servers (especially headless servers with no physical display).

You can disable it with:

--enable-raytracing False This will reduce Vulkan extension requirements and may avoid issues like ErrorExtensionNotPresent.

But bridge.sh doesn't have raytracing, so it doesn't work.

I still have not found how to fix it in H100.

LukeLIN-web avatar Apr 26 '25 03:04 LukeLIN-web

Solved it by following this doc

chinhsuanwu avatar Apr 29 '25 22:04 chinhsuanwu

Solved it by following this doc

Thank you , could you point out which commands are the solution?
My A6000 is ubuntu22.04, it shows E: Unable to locate package vulkan-utils, but don't have RuntimeError: vk::PhysicalDevice::createDeviceUnique: ErrorExtensionNotPresent Maybe this solution ? https://github.com/haosulab/SAPIEN/issues/115

LukeLIN-web avatar Apr 30 '25 01:04 LukeLIN-web

use vulkan-tools instead

chinhsuanwu avatar Apr 30 '25 02:04 chinhsuanwu

use vulkan-tools instead

I installed this and in H100 and it seems make my simpler env totally broken. It hang when create env env = build_maniskill2_env( env_name, **additional_env_build_kwargs, **kwargs, )

And it seems broken some infra function, my libero enviroment also hang

    eval_libero()
  File "/home/user1/anaconda3/envs/vlaoft/lib/python3.10/site-packages/draccus/argparsing.py", line 203, in wrapper_inner
    response = fn(cfg, *args, **kwargs)
    total_episodes, total_successes = run_task(
    success, replay_images, step = run_episode(
    obs, reward, done, info = env.step(action.tolist())  
    return self.env.step(action)
    obs, reward, done, info = super().step(action)
  File "/home/user1/anaconda3/envs/vlaoft/lib/python3.10/site-packages/robosuite/environments/base.py", line 395, in step
    self._update_observables()
  File "/home/user1/anaconda3/envs/vlaoft/lib/python3.10/site-packages/robosuite/environments/base.py", line 324, in _update_observables
    observable.update(timestep=self.model_timestep, obs_cache=self._obs_cache, force=force)
  File "/home/user1/anaconda3/envs/vlaoft/lib/python3.10/site-packages/robosuite/utils/observables.py", line 234, in update
    obs = np.array(self._filter(self._corrupter(self._sensor(obs_cache))))
  File "/home/user1/anaconda3/envs/vlaoft/lib/python3.10/site-packages/robosuite/environments/robot_env.py", line 404, in camera_rgb
    img = self.sim.render(
  File "/home/user1/anaconda3/envs/vlaoft/lib/python3.10/site-packages/robosuite/utils/binding_utils.py", line 1131, in render
    return self._render_context_offscreen.read_pixels(width, height, depth=depth, segmentation=segmentation)
  File "/home/user1/anaconda3/envs/vlaoft/lib/python3.10/site-packages/robosuite/utils/binding_utils.py", line 171, in read_pixels
    mujoco.mjr_readPixels(rgb=rgb_img, depth=depth_img, viewport=viewport, con=self.con)

LukeLIN-web avatar May 01 '25 21:05 LukeLIN-web

This problem randomly occurs to me. Sometime it works sometimes it does not.

Boltzmachine avatar Jun 04 '25 18:06 Boltzmachine

Hello,  I encountered an error while running the code from your repository. The error message is as follows:  RuntimeError: vk::PhysicalDevice::createDeviceUnique: ErrorExtensionNotPresent  The error occurs after running 10 episodes on all policies. The error is triggered at the following line in the code:  self._renderer = sapien.SapienRenderer(**renderer_kwargs)  I have checked the following: GPU driver is up-to-date. Vulkan configuration files are present. All dependencies are correctly installed.  However, the issue persists. Based on similar issues reported in other projects, it seems this might be related to the Vulkan renderer configuration. Could you please provide some guidance on how to resolve this error? Any help would be greatly appreciated. Thank you!

Check if you have libegl1 install, based on this post, rendering is actually supported by EGL, not GLX. For me I was having this error in Docker container, and I solved it by

apt install libegl1

Taokt avatar Jun 05 '25 16:06 Taokt

Hi, I met the same issue on A100 SXM 80G, btw I have installed libegl1, and I can get messege using vulkaninfo normally, I have tried the above method, but they all didn't work for me:(

HaomingSong avatar Jul 23 '25 14:07 HaomingSong

This error does not appear on other environments but appears only on move_near_variant_agg. And for this env, it occurs only after some episodes.

Boltzmachine avatar Aug 07 '25 20:08 Boltzmachine

I solved my problem by setting the following:

os.environ['DISPLAY'] = '' 
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
os.environ["VK_ICD_FILENAMES"] = '/usr/share/vulkan/icd.d/nvidia_icd.json'

The file itself, you can check here. I needed to create it myself

KopanevPavel avatar Sep 04 '25 09:09 KopanevPavel