Using 2X B70's is throwing UR_RESULT_ERROR_UNKNOWN error with VLLM
- Dominant language
- C++
- Stars
- 529
- Forks
- 80
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 38
Description
# `torch.xpu.device_count()` fails with 2 Intel B70 GPUs, but each GPU works individually
## Summary
I have 2 Intel Battlemage B70 GPUs passed through to an Ubuntu VM.
- `sycl-ls` sees both GPUs together
- `torch.xpu.device_count()` works with GPU 0 alone
- `torch.xpu.device_count()` works with GPU 1 alone
- `torch.xpu.device_count()` fails when both GPUs are exposed
Single-GPU vLLM works in this setup.
## Environment
- Ubuntu VM on TrueNAS
- 2x Intel Battlemage B70 passed through
- Docker container with vLLM built from GitHub
- PyTorch: `2.10.0+xpu`
- `torch.version.xpu`: `20250301`
## Repro
### GPU 0 only
```bash
export ONEAPI_DEVICE_SELECTOR=level_zero:0
python - <<'PY'
import torch
print(torch.xpu.is_available())
print(torch.xpu.device_count())
PY
```
Output:
```text
True
1
```
### GPU 1 only
```bash
export ONEAPI_DEVICE_SELECTOR=level_zero:1
python - <<'PY'
import torch
print(torch.xpu.is_available())
print(torch.xpu.device_count())
PY
```
Output:
```text
True
1
```
### Both GPUs
```bash
export ONEAPI_DEVICE_SELECTOR=level_zero:0,1
python - <<'PY'
import torch
print(torch.xpu.is_available())
print(torch.xpu.device_count())
PY
```
Output:
```text
RuntimeError: level_zero backend failed with error: 2147483646 (UR_RESULT_ERROR_UNKNOWN)
```
## Additional observation
`sycl-ls` with both GPUs exposed:
```bash
ONEAPI_DEVICE_SELECTOR=level_zero:0,1 sycl-ls
```
shows 2 GPUs correctly.
## Trace
With UR / Level Zero tracing enabled, the failure happens during 2-device context creation.
Relevant part:
```text
zeContextMakeMemoryResident(...)
Error (ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY) in zeContextMakeMemoryResident
urContextCreate(... DeviceCount = 2 ...) -> UR_RESULT_ERROR_UNKNOWN
```
## Expected
With both GPUs exposed, `torch.xpu.device_count()` should return `2`.
## Actual
With both GPUs exposed, `torch.xpu.device_count()` fails with:
```text
RuntimeError: level_zero backend failed with error: 2147483646 (UR_RESULT_ERROR_UNKNOWN)
```
## Notes
- Both GPUs are visible in the VM
- Both GPUs are visible to `sycl-ls`
- Each GPU works individually
- Failure happens only when both are used together
Contributor guide
Assessment
This issue has not been assessed yet.