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

Unable to use SYCL device in raycasting example #7164

Open
3 tasks done
fabiannagel opened this issue Feb 7, 2025 · 2 comments
Open
3 tasks done

Unable to use SYCL device in raycasting example #7164

fabiannagel opened this issue Feb 7, 2025 · 2 comments
Labels
bug Not a build issue, this is likely a bug.

Comments

@fabiannagel
Copy link

fabiannagel commented Feb 7, 2025

Checklist

Describe the issue

I've been looking into the new SYCL support in v0.19 (using this wheel) and managed to get everything set up to the point where o3d.core.sycl.print_sycl_devices(print_all=True) gives me a green light:

[Open3D INFO] # Open3D SYCL device
[Open3D INFO] - Device("SYCL:0"): [ext_oneapi_level_zero:gpu] Intel(R) UHD Graphics 770
[Open3D INFO] # All SYCL devices
[Open3D INFO] - [opencl:gpu] Intel(R) UHD Graphics 770
[Open3D INFO] - [ext_oneapi_level_zero:gpu] Intel(R) UHD Graphics 770
[Open3D INFO] # Default SYCL selectors
[Open3D INFO] - sycl::default_selector_v    : [ext_oneapi_level_zero:gpu] Intel(R) UHD Graphics 770
[Open3D INFO] - sycl::cpu_selector_v        : N/A
[Open3D INFO] - sycl::gpu_selector_v        : [ext_oneapi_level_zero:gpu] Intel(R) UHD Graphics 770
[Open3D INFO] - sycl::accelerator_selector_v: N/A

Also:

# o3d.core.sycl_demo()
[Open3D INFO] SYCLDemo passed!

# print(o3d.cpu.pybind.core.sycl.is_available())
True

However, I verified that the raycasting example runs on CPU (no GPU load in intel_gpu_top) by default. So I tried explicitly setting the device - which fails. What am I doing wrong here?

Steps to reproduce the bug

import open3d as o3d
import matplotlib.pyplot as plt


for i in range(1000):
    cube = o3d.t.geometry.TriangleMesh.from_legacy(
                                        o3d.geometry.TriangleMesh.create_box())

    device = Device("ext_oneapi_level_zero:gpu")
    # Create scene and add the cube mesh
    scene = o3d.t.geometry.RaycastingScene(device=device)
    scene.add_triangles(cube)

    # Rays are 6D vectors with origin and ray direction.
    # Here we use a helper function to create rays for a pinhole camera.
    rays = scene.create_rays_pinhole(fov_deg=60,
                                     center=[0.5,0.5,0.5],
                                     eye=[-1,-1,-1],
                                     up=[0,0,1],
                                     width_px=3200,
                                     height_px=2400)

    # Compute the ray intersections.
    ans = scene.cast_rays(rays)

    # Visualize the hit distance (depth)
    plt.imshow(ans['t_hit'].numpy())

Error message

RuntimeError: [Open3D Error] (void open3d::t::geometry::RaycastingScene::SYCLImpl::InitializeDevice()) /root/Open3D/cpp/open3d/t/geometry/RaycastingScene.cpp:459: Caught exception creating sycl::device: No device of requested type available. Please check https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.html -1 (PI_ERROR_DEVICE_NOT_FOUND)

Expected behavior

Open3D uses the SYCL:0 device and generates load on the GPU.

Open3D, Python and System information

- Operating system: Ubuntu 24.04
- Python version: Python 3.12.3
- Open3D version: output from python: 0.19.0
- System architecture: amd64
- Is this a remote workstation?: yes
- How did you install Open3D?: Remote wheel via `uv`
@fabiannagel fabiannagel added the bug Not a build issue, this is likely a bug. label Feb 7, 2025
@ssheorey
Copy link
Member

ssheorey commented Feb 12, 2025

Hi @fabiannagel You need a GPU with HW raycasting support for this. I believe it's only the Arc / Xe series GPUs (discrete or integrated) that have this support. I'll update the docs to make this clear.

@fabiannagel
Copy link
Author

Thanks @ssheorey, that makes sense. Is there any info on what operations are supported by the SYCL-backend?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not a build issue, this is likely a bug.
Projects
None yet
Development

No branches or pull requests

2 participants