Unable to use SYCL device in raycasting example
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [x] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [x] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [x] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).
### Describe the issue
I've been looking into the new SYCL support in v0.19 (using [this wheel](https://github.com/isl-org/Open3D/releases/download/v0.19.0/open3d_xpu-0.19.0-cp312-cp312-manylinux_2_35_x86_64.whl)) 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
```python
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
```markdown
- 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`
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.