sycl: on the xe driver without --stream-experts, --pcie-frac defaults to 0 (and an explicit value gets a warning)

An Arc Pro B70 (xe) page-faults when a kernel reads ordinary pageable host memory (devcoredump: ccs0, FaultType 0,
faulted address in the CPU's mmap range, then Timedout job and device lost). Without --stream-experts the experts
outside the VRAM cache sit in a pageable arena that the PCIe share hands to the GPU. The default share is 0 there
(the CPU computes those misses) with a one-line warning naming --stream-experts, as setup configures it. An explicit
--pcie-frac is kept and warned about. i915 (Arc Alchemist), CUDA and HIP are unchanged.
strata::intel_gpu_driver() reads the driver from sysfs; verify.cpp's i915 test uses it.
The mirror table (host-mirror pointers for the device plan) is filled only from pinned USM aliases under
--stream-experts, so it cannot hand out pageable pointers.
This commit is contained in:
Niko1221 committed 2026-10-07 02:52:41 +02:00
1 parent b56d6e3a78
commit 73e01fa54d
3 files changed
+45 -13

No files matched your search

+25
View File
@@ -90,3 +90,28 @@ inline void host_free_polled(void* p, sycl::queue& q) {
sycl::free(p, q);
}
} // namespace strata
// The kernel driver of the Intel GPU ("xe", "i915", or "" when unknown), from sysfs. The driver decides what the GPU
// may read: an Arc A750 (i915) reads ordinary host memory a kernel is handed; an Arc Pro B70 (xe) page-faults on it
// (ccs0, FaultType 0, address in the CPU's mmap range) and the card times the job out.
#include <filesystem>
#include <fstream>
#include <string>
namespace strata {
inline const std::string& intel_gpu_driver() {
static const std::string drv = [] {
std::error_code ec;
for (const auto& e : std::filesystem::directory_iterator("/sys/class/drm", ec)) {
const std::string n = e.path().filename().string();
if (n.rfind("card", 0) != 0 || n.find('-') != std::string::npos) continue;
std::ifstream vf(e.path() / "device" / "vendor");
std::string vendor;
if (!(vf >> vendor) || vendor != "0x8086") continue;
const auto d = std::filesystem::read_symlink(e.path() / "device" / "driver", ec);
if (!ec) return d.filename().string();
}
return std::string();
}();
return drv;
}
} // namespace strata
+1 -13
View File
@@ -147,19 +147,7 @@ bool one_token_self_commit() {
}
// True when the GPU runs under the i915 kernel driver (Arc Alchemist: A310-A770), read from sysfs.
bool intel_i915_gpu() {
static const bool v = [] {
std::error_code ec;
for (const auto& e : std::filesystem::directory_iterator("/sys/class/drm", ec)) {
const std::string n = e.path().filename().string();
if (n.rfind("card", 0) != 0 || n.find('-') != std::string::npos) continue;
const auto drv = std::filesystem::read_symlink(e.path() / "device" / "driver", ec);
if (!ec && drv.filename() == "i915") return true;
}
return false;
}();
return v;
}
bool intel_i915_gpu() { return strata::intel_gpu_driver() == "i915"; }
// How long the host waits for a layer's doorbell before it gives the window up (#267). 20 s by default; the first
// window of a run on a card that JIT-compiles its kernels (no AOT: an Arc A750 needs FP64 emulation) can take longer
+19
View File
@@ -2480,6 +2480,7 @@ int main(int argc, char **argv) try {
// link (the copy kernel, since 0.1.14), so on a slower link it must shrink or the window waits for it. The
// real H2D bandwidth is probed once; from 20 GB/s up (x16 PCIe 4/5) the measured default stays. The canonical
// pack's 0.2 was never measured against the link, so it is left alone. `--calibrate` measures it outright.
const bool pcie_explicit = o.pcie_frac >= 0.0;
if (o.pcie_frac < 0.0) {
const double base = native_pack ? 0.55 : 0.2;
std::string bursts;
@@ -2495,6 +2496,24 @@ int main(int argc, char **argv) try {
std::fprintf(stderr, "strata generate: PCIe probe failed -> pcie_frac default %.2f\n", base);
}
}
// SYCL port, Arc on the xe driver (Arc Pro B60/B65/B70, B580): the GPU page-faults when a kernel reads ordinary
// (pageable) host memory, and the card times the job out (seen on a B70: Timedout job, Fault response -EINVAL,
// faulted address in the CPU's mmap range). Without --stream-experts the experts outside the VRAM cache stay in a
// pageable arena that the PCIe share (--pcie-frac) hands to the GPU. Recommend, never force: the default share
// becomes 0 (the CPU computes those misses) and an explicit --pcie-frac is kept with a warning.
if (strata::intel_gpu_driver() == "xe" && !o.stream_experts) {
if (!pcie_explicit) {
o.pcie_frac = 0.0;
std::fprintf(stderr, "strata generate: xe driver without --stream-experts: the GPU faults on pageable host "
"memory, so --pcie-frac defaults to 0 here (the CPU computes the experts outside VRAM). "
"Use --stream-experts, as setup configures it, to let the GPU read a pinned mirror\n");
} else if (o.pcie_frac > 0.0) {
std::fprintf(stderr, "strata generate: WARNING: --pcie-frac %.2f on the xe driver without --stream-experts "
"makes the GPU read pageable host memory; that page-faulted and hung an Arc Pro B70 "
"(Timedout job, device lost). Use --stream-experts, as setup configures it, or "
"--pcie-frac 0\n", o.pcie_frac);
}
}
// the canonical Q2_0 pack's CPU kernels are AVX-512 only; a native pack runs on AVX2 CPUs as well
if (!native_pack) strata::kernels::cpu::cpu_require_expert_support();
else if (!strata::kernels::cpu::cpu_avx512_ok())