1 Commits
Author SHA1 Message Date
geramyloveless dfec592877 HSA runtime: a GPU memory fault is reported, as ROCr reports it
On Linux, ROCr waits on a KFD memory event and reports a GPU page fault
of the process ("Memory access fault by GPU node ... on address ...
Reason: ..."). Here the driver reports it on the queue service the
runtime already polls at 1 kHz per queue. From driver build 256 on, the
transport asks selector 59 for four outputs and gets the fault's
address and reason with status kIOReturnVMError. A kick that gets
kIOReturnVMError fetches the same details.

The fault is said once per connection on stderr, with the agent,
address and reason. It is handed to a registered system event handler
as HSA_AMD_GPU_MEMORY_FAULT_EVENT (hsa_amd_gpu_memory_fault_info_t), and
each queue's error callback gets HSA_STATUS_ERROR_MEMORY_FAULT. The
connection's GPU signals are invalidated, as for any queue error. The
message says that this process's queues stopped and that other programs
keep the GPU, which is now true.

hsa-memory-fault-test injects a fault into the fake transport. Both
queues' callbacks run once from the service poll with
HSA_STATUS_ERROR_MEMORY_FAULT, one event names the agent, address and
reason, and a queue created afterwards reports the fault on its first
kick without repeating the event.
2026-10-06 00:45:42 -07:00