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

Errror while trying to draw visualization using open3d after running sapien render #186

Closed
j-thapa opened this issue Dec 19, 2024 · 5 comments

Comments

@j-thapa
Copy link

j-thapa commented Dec 19, 2024

after i initiate sapien ; in the same script if i try to draw visualization using open3D i get following error:

libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
[Open3D WARNING] GLFW Error: GLX: Failed to create context: GLXBadFBConfig
[Open3D WARNING] Failed to create window
[Open3D WARNING] [DrawGeometries] Failed creating OpenGL window.
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 15 (X_QueryTree)
Resource id in failed request: 0x2c00026
Serial number of failed request: 1518

@fbxiang
Copy link
Collaborator

fbxiang commented Dec 20, 2024

It is very surprising that SAPIEN would have any effect on open3d since SAPIEN does not use OpenGL at all. And there is certainly no way to cause /usr/lib/dri/swrast_dri.so to go missing. Can you first verify this problem does not occur with open3d alone and is not caused some other libraries and provide a minimal example?
For example, does import sapien enough to cause the issue, or you need to create a scene or create a viewer?

@j-thapa
Copy link
Author

j-thapa commented Jan 7, 2025

Sorry for the late response; I wasn't working on this due to holidays and other commitments.

I did some minor checks, and even importing sapien causes this issue. If I import sapien or use code like from sapien.utils import Viewer, I get the error. If I don't use these commands, the Open3D viewer runs fine. Here is the demo code I used:

import sapien as sapien
from sapien.utils import Viewer
import numpy as np
import open3d as o3d

def main():
    # Replace this with your actual 3D points
    points_world = np.random.rand(100, 3)  # Example: 100 random points in 3D space

    # Create an Open3D PointCloud object
    point_cloud = o3d.geometry.PointCloud()

    # Assign the points to the PointCloud object
    point_cloud.points = o3d.utility.Vector3dVector(points_world)

    # Optionally, add colors to the point cloud (e.g., random colors)
    colors = np.random.rand(points_world.shape[0], 3)
    point_cloud.colors = o3d.utility.Vector3dVector(colors)

    # Visualize the point cloud
    o3d.visualization.draw_geometries([point_cloud], window_name="3D Point Cloud")

if __name__ == "__main__":
    main()

@fbxiang
Copy link
Collaborator

fbxiang commented Jan 7, 2025

Do you see any warnings from SAPIEN. For example, warnings about a broken driver installation where SAPIEN tries to workaround? One possibility is that your GPU graphics driver is not installed properly and SAPIEN tries to workaround this by providing missing EGL and Vulkan files when imported. And these files may interfere with open3d.

For example, one possibility is that previously open3d is using the CPU to render, but since SAPIEN provides these GPU files, open3d now thinks it is fine to use the GPU and uses a incorrectly configured GPU.

@fbxiang
Copy link
Collaborator

fbxiang commented Jan 7, 2025

Also, your issue seems quite rare for a desktop environment. Are you using some special desktop setup such as x-forwarding, VNC, remote desktop, or docker?

@j-thapa
Copy link
Author

j-thapa commented Jan 7, 2025

yes, I am using forwarding to run ubuntu remotely on windows; maybe that's why am facing such issue.

I also find out that if I import open3d at first I don't get the error. So, its working fine for me now.

Thanks for the quick responses.

@j-thapa j-thapa changed the title Errror while trying to drae visualization using open3d after running sapien render Errror while trying to draw visualization using open3d after running sapien render Jan 7, 2025
@j-thapa j-thapa closed this as completed Jan 7, 2025
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