Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

zeInit segfaults when ZE_AFFINITY_MASK selects no existing device (26.27.39122.11)

Aperta
#1,030 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
backend

Direzione di ricerca

Start by reading the issue’s linked code in shared/source/execution_environment/execution_environment.cpp and level_zero/core/source/driver/driver.cpp, along with the referenced unit test in shared/test/unit_test/execution_environment/execution_environment_tests.cpp. Reproduce with ZE_AFFINITY_MASK=99 and the supplied zeInit program. Done means initialization returns without a segfault when the mask selects no existing device, with a regression test covering that case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

zeInit segfaults inside the GPU driver when ZE_AFFINITY_MASK names only a device index that does not exist, instead of returning with no devices. chipStar tracking issue: https://github.com/CHIP-SPV/chipStar/issues/2038

GPU hardware: Intel Arc B570 (Battlemage, PCI 8086:e20c) plus the host's integrated GPU.

Driver version: compute-runtime 26.27.39122.11 (libze_intel_gpu.so.1.15.39122), IGC 2.38.2, gmmlib 22.10.0, Level Zero loader 1.28.2. Installed from the release .deb packages of https://github.com/intel/compute-runtime/releases/tag/26.27.39122.11.

Linux distribution: Ubuntu 24.04.2 LTS, kernel 6.17.0-14-generic, xe driver, boot parameters ro quiet splash.

Actual behavior: SIGSEGV (exit 139) inside libze_intel_gpu.so.1 during zeInit:

#0  ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#1  ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#2  ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#3  __pthread_once_slow () at ./nptl/pthread_once.c:116
#4  ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#5  std::call_once<zeInit::{lambda()#1}> ... from /usr/local/lib/libze_loader.so.1
#7  zeInit () from /usr/local/lib/libze_loader.so.1

Expected behavior: zeInit returns (successfully with zero devices, or with an error such as ZE_RESULT_ERROR_UNINITIALIZED) and the application can report that no device is available. compute-runtime ignores an out of range mask entry (https://github.com/intel/compute-runtime/blob/26.27.39122.11/shared/source/execution_environment/execution_environment.cpp#L236), its unit test expects an empty device mapping for such a mask (https://github.com/intel/compute-runtime/blob/26.27.39122.11/shared/test/unit_test/execution_environment/execution_environment_tests.cpp#L650), and driver initialization has a no device error path (https://github.com/intel/compute-runtime/blob/26.27.39122.11/level_zero/core/source/driver/driver.cpp#L25).

Reproduction rate: every run.

Steps to reproduce:

// zeinit.c: gcc zeinit.c -lze_loader -o zeinit
#include <level_zero/ze_api.h>
#include <stdio.h>
int main(void) {
  ze_result_t r = zeInit(0);
  printf("zeInit -> 0x%x\n", r);
  uint32_t n = 0;
  if (r == ZE_RESULT_SUCCESS) { r = zeDriverGet(&n, NULL); printf("zeDriverGet -> 0x%x drivers=%u\n", r, n); }
  return 0;
}
$ ./zeinit
zeInit -> 0x0
zeDriverGet -> 0x0 drivers=2
$ ZE_AFFINITY_MASK=0 ./zeinit
zeInit -> 0x0
zeDriverGet -> 0x0 drivers=1
$ ZE_AFFINITY_MASK=99 ./zeinit
Segmentation fault (core dumped)

Is this a regression: not known.

This issue was generated using AI

Lingua principale
C++
Stelle
1.5k
Fork
304
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di intel/compute-runtime

Tutte le issue di intel/compute-runtime

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.