A CPU mapping of the GPU's BARs in a client process is a store path the
driver cannot route through the kernel: a store through it to an
unplugged GPU panics the Mac. The driver now logs each one it hands out,
Linux-file mappings (VRAM-resident buffers, KFD doorbell and MMIO pages)
and raw BAR leases, with the client ID its open is logged under, to
measure which clients map what before deciding what to change in the
client ABI.
vk-copy-bench --alloc times allocating, mapping, touching and freeing
host-memory buffers, for the cost of the page-table writes behind them.
Host to VRAM (what display frames cross PCIe as), VRAM to host and VRAM
to VRAM, on the transfer queue (SDMA; RADV offers it with
RADV_EXPERIMENTAL=transfer_queue) and the compute queue (a compute
shader copy), timed by GPU timestamps. make vk-copy-bench builds it
against the Vulkan loader; run it with VK_DRIVER_FILES naming the RADV
ICD. Every failing call is reported; nothing is measured in its place.
When the mode it was given fails, Quake3e retries r_mode 3 by itself.
With --quake3 mlg-run now stays the game's parent, passes its output
through on a pseudo-terminal (line by line, as to a terminal), forwards
SIGINT, SIGTERM and SIGHUP, and on Quake3e's "falling back on r_mode"
stops the game and exits 1 saying so. The game's exit status is mlg-run's
otherwise. test-mlg-run checks the line it watches for.
Before the plan, mlg-run prints what the program's frames will be
scanned out with: the output's connector, CRTC and mode, the primary and
overlay planes that CRTC can use (in use or free, and how many XRGB8888
modifiers each lists; the file asks for universal planes to see the
primary one), the monitor's EDID identity, and the macOS display matched
to it with its vendor, model, serial and bounds. All read-only queries.
With --quake3, --basepath DIR and --basegame NAME become fs_basepath and
fs_basegame, which Quake3e reads at start. mlg-run first checks that
DIR/NAME (baseq3 without --basegame) holds .pk3 files and stops with what
is missing otherwise; both are refused without --quake3. OpenArena 0.8.8,
free data kept outside the repository, runs as --basegame baseoa (its game
VM and maps load in a Quake3e dedicated server from this pin).
test-mlg-run covers the settings and the refusals.
tools/mlg-run runs a program so that it renders with RADV and the GPU
scans its frames out on the monitor the driver's display output drives,
whatever the program would pick: VK_DRIVER_FILES and VK_ICD_FILENAMES
name only RADV's ICD, SDL_VULKAN_LIBRARY the Khronos loader,
MLG_WSI_OUTPUT the output's connector (asked of the driver; --output
checks it) and MLG_WSI_MODE the mode, and SDL keeps full screen in a
window on its own screen. --quake3 adds Quake3e's renderer, vsync, mode
and window placement on the monitor's macOS display (CGDisplayBounds of
the display drmMlgConnectorDisplay finds). A missing ICD, loader, driver
or output is an error naming it; --dry-run prints the plan.
test-mlg-run checks the plan (plan.c): the environment, the Quake3e
settings full screen and windowed, with and without a macOS display, and
the refusals.
Runs the unmodified upstream Linux amdgpu and amdkfd drivers on Apple
Silicon Macs inside a DriverKit system extension, for AMD GPUs attached
over Thunderbolt. The Linux sources come from a pinned submodule and are
compiled against linuxu, a userspace implementation of the Linux kernel
APIs they use. Includes the HSA runtime, the host installer app, the
setup and firmware fetch scripts, and the offline test suite.