pytorch - 💡(How to fix) Fix torch.xpu.get_device_properties() segfaults on Intel ARC PRO B70 (Battlemage/BMG, device 0xe223) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#179891Fetched 2026-04-11 06:12:09
View on GitHub
Comments
0
Participants
1
Timeline
23
Reactions
0
Participants
Timeline (top)
mentioned ×9subscribed ×8labeled ×5added_to_project_v2 ×1

Error Message

Fatal Python error: Segmentation fault

Current thread 0x00007180c950a080 (most recent call first): File "/path/to/site-packages/torch/xpu/init.py", line 275 in get_device_properties

Fix Action

Workaround

We've monkey-patched torch/xpu/__init__.py to return a synthetic _BMGDeviceProperties object using mem_get_info() for the memory value, bypassing the C-level call entirely.

Code Example

Fatal Python error: Segmentation fault

Current thread 0x00007180c950a080 (most recent call first):
  File "/path/to/site-packages/torch/xpu/__init__.py", line 275 in get_device_properties

---

import torch
print(torch.xpu.is_available())       # True
print(torch.xpu.device_count())       # 2
print(torch.xpu.mem_get_info(0))      # Works
print(torch.xpu.get_device_properties(0))  # SEGFAULT
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

torch.xpu.get_device_properties() causes a segmentation fault (SIGSEGV at null function pointer, ip=0x0000000000000000) on Intel ARC PRO B70 GPUs (Battlemage/BMG architecture, PCI device ID 0xe223).

Other torch.xpu functions work correctly on the same device:

  • torch.xpu.is_available() → True
  • torch.xpu.device_count() → 2
  • torch.xpu.mem_get_info(0) → (34019917824, 34242297856) ✅
  • torch.xpu.get_device_name(0) → segfault ❌ (calls get_device_properties internally)
  • torch.xpu.get_device_properties(0) → segfault ❌

Faulthandler traceback

Fatal Python error: Segmentation fault

Current thread 0x00007180c950a080 (most recent call first):
  File "/path/to/site-packages/torch/xpu/__init__.py", line 275 in get_device_properties

dmesg: python3[PID]: segfault at 0 ip 0000000000000000 sp ... error 14

The null IP strongly suggests a missing function pointer in a vtable — likely the SYCL device info query for BMG's device family is not handled, resulting in a null callback.

Environment

  • GPU: 2x Intel ARC PRO B70 (Battlemage, PCI device 0xe223, 32GB VRAM each)
  • Driver: xe kernel module, kernel 6.17.0-20-generic
  • PyTorch: 2.10.0+xpu
  • Intel compute stack: oneAPI 2025.3, compute-runtime 26.09, IGC 2.30.1
  • OS: Ubuntu 24.04
  • Python: 3.11

Impact

This blocks vLLM (and likely any framework using get_device_properties) from running on Battlemage GPUs. Since get_device_name() also calls get_device_properties() internally, many code paths are affected.

Workaround

We've monkey-patched torch/xpu/__init__.py to return a synthetic _BMGDeviceProperties object using mem_get_info() for the memory value, bypassing the C-level call entirely.

Expected behavior

get_device_properties() should return valid device properties for BMG (Xe2) GPUs, or at minimum raise a Python exception rather than segfaulting.

Reproduction

import torch
print(torch.xpu.is_available())       # True
print(torch.xpu.device_count())       # 2
print(torch.xpu.mem_get_info(0))      # Works
print(torch.xpu.get_device_properties(0))  # SEGFAULT

cc @gujinghui @EikanWang @fengyuan14 @guangyey @intel @chunyuan-w

extent analysis

TL;DR

The most likely fix is to update the PyTorch library to handle the SYCL device info query for BMG's device family, or apply a workaround by monkey-patching torch/xpu/__init__.py to return a synthetic device properties object.

Guidance

  • Verify that the issue is specific to Intel ARC PRO B70 GPUs (Battlemage/BMG architecture) by testing on other devices.
  • Apply the provided monkey-patch workaround to torch/xpu/__init__.py to bypass the C-level call and return a synthetic device properties object.
  • Test the workaround using the provided reproduction code to ensure it resolves the segfault issue.
  • Consider reporting the issue to the PyTorch developers to ensure a proper fix is implemented in a future release.

Example

# Monkey-patch workaround
import torch
class _BMGDeviceProperties:
    def __init__(self, device_index):
        self.device_index = device_index
        self.total_memory = torch.xpu.mem_get_info(device_index)[0]

def get_device_properties(device_index):
    return _BMGDeviceProperties(device_index)

torch.xpu.get_device_properties = get_device_properties

Notes

The provided workaround may not be a permanent solution and may need to be updated or removed once a proper fix is implemented in PyTorch.

Recommendation

Apply the workaround by monkey-patching torch/xpu/__init__.py to return a synthetic device properties object, as this provides a temporary solution to the segfault issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

get_device_properties() should return valid device properties for BMG (Xe2) GPUs, or at minimum raise a Python exception rather than segfaulting.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix torch.xpu.get_device_properties() segfaults on Intel ARC PRO B70 (Battlemage/BMG, device 0xe223) [1 participants]