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: vk::Instance::enumeratePhysicalDevices: ErrorInitializationFailed when initializing sapien.VulkanRenderer() #63

Closed
Wuziyi616 opened this issue Feb 18, 2022 · 3 comments

Comments

@Wuziyi616
Copy link

System:

  • OS version: [WSL2 Ubuntu 18.04]
  • Python version (if applicable): [Python 3.8]
  • SAPIEN version (1.1.1):
  • Environment: [WSL2 of a Windows Desktop]

Describe the bug
When I run hello_world.py, it gives me RuntimeError: vk::Instance::enumeratePhysicalDevices: ErrorInitializationFailed at the line of renderer = sapien.VulkanRenderer()

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

  1. Run hello_world.py

Additional context
I'm new to simulator and robotics, so the question may be stupid. I'm running on a GUI supported Windows WSL2 system (Ubuntu 18.04), where I have successfully installed nvidia driver. At first, when I run the code it gives me RuntimeError: createInstance: No Vulkan extensions found for window surface creation. So I tried apt-get install libvulkan1 mesa-vulkan-drivers vulkan-utils and find /usr/share/vulkan/icd.d/intel_icd.x86_64.json. After I export this to VK_ICD_FILENAMES, I met the above error.

According to #34, we should set VK_ICD_FILENAMES to nvidia_icd.json, where it points to a library called libGLX_nvidia.so.0. However, I cannot find libGLX_nvidia.so.0 in /usr/lib/x86_64-linux-gnu/, where I only find something like libGLX_mesa.so.0, libGLX.so.0. I search the Internet and someone said "WSL2 doesn't support Vulkan yet". However, there is libvulkan.so.1 and libvulkan_intel.so under /usr/lib/x86_64-linux-gnu/. So I'm very confused now, I guess I misunderstand the relationship between Vulkan and nvidia driver?

Since I cannot find libGLX_nvidia.so.0, does that mean I cannot use the renderer of sapien? On the other, I understand that I can run the physical simulation steps of sapien, but if I want to render e.g. RGB-D image, then renderer is necessary. Is my understanding correct? Thanks in advance!

@fbxiang
Copy link
Collaborator

fbxiang commented Feb 18, 2022

I have not tested WSL Vulkan support so I am not sure whether WSL2 can run Vulkan with Nvidia driver.
What I do know is that libGLX_nvidia.so.0 is very essential for running Vulkan on Linux with Nvidia GPU. This library should be installed when you install the Nvidia driver and it provides all the graphics support using the Nvidia GPU (OpenGL and Vulkan).
The simplest solution would be to just use Linux for SAPIEN. Please do let me know if you figure out how to run SAPIEN or any Vulkan application on WSL.

@Wuziyi616
Copy link
Author

Wuziyi616 commented Feb 18, 2022

Thanks for your reply! Yes, since many post said that WSL2 hasn't supported Vulkan I suspect that's not feasible. Will try to figure out if that works or not

EDIT: microsoft/wslg#40 seems that WSLg2 doesn't support Vulkan, and there is no successful solution yet. Maybe we should wait for native support. For now I'll just use the physical simulation part of SAPIEN.

@JackMa-coder
Copy link

I have not tested WSL Vulkan support so I am not sure whether WSL2 can run Vulkan with Nvidia driver. What I do know is that libGLX_nvidia.so.0 is very essential for running Vulkan on Linux with Nvidia GPU. This library should be installed when you install the Nvidia driver and it provides all the graphics support using the Nvidia GPU (OpenGL and Vulkan). The simplest solution would be to just use Linux for SAPIEN. Please do let me know if you figure out how to run SAPIEN or any Vulkan application on WSL.

Due to I need to work between Windows 11 and ubuntu, I try run Vulkan successfully in Ubuntu 20.04 on WSL2 by this method. But I get the same error when running SAPIEN. Could you give me some advices to solve it? thx.

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

3 participants