XNU as a loadable kernel module inside Linux (macOS personality for arm64 Linux)
C
docs: the GPU bridge on a DGX Spark
秋 奈月56f19975cfd5
diff --git a/docs/production.md b/docs/production.mdindex 09bf229..d4fc41b 100644--- a/docs/production.md+++ b/docs/production.md@@ -48,7 +48,10 @@ What the PoC did to get each step running, and what replaces it. Ordered by whatThe DRM bridge: a Mesa Vulkan driver built for Darwin runs in the macOS process; its DRM calls go to an IOKit user client(`kexts/XnuDrm`) and through FKI to the Linux DRM device. Buffer objects are Linux pages mapped straight into the macOS task(same physical memory, no copies). On an Apple Silicon host the Linux DRM device is virtio-gpu with Venus (krunkit:-Venus → MoltenVK → Metal on the host GPU); on a Linux machine with its own GPU it is that GPU's driver.+Venus → MoltenVK → Metal on the host GPU). On a Linux machine with its own GPU there is no virtio-gpu: `xnudrmd` is the+virtio-gpu device itself, serving the same client from virglrenderer's Venus on the machine's Vulkan driver+(`gpu/xnu-drm/xnudrmd_virgl.c`). On a DGX Spark the hosted macOS gets `Virtio-GPU Venus (NVIDIA GB10)`: the compute+test and a Metal compute kernel read back correct results and WindowServer composites through it (not yet measured).### Status of the bridgediff --git a/tools/dgx-spark/README.md b/tools/dgx-spark/README.mdindex 7863418..37f0a43 100644--- a/tools/dgx-spark/README.md+++ b/tools/dgx-spark/README.md@@ -14,5 +14,13 @@ Bare metal: Secure Boot off; `kvm-arm.mode=nvhe mem=112G nokaslr`;`insmod fki.ko carve_base=0x1E00000000 carve_mb=8156 cpu_list=5,6,7,8,9`; NetworkManager off `xnu0`;`/etc/xnulinux.conf`: `GPU=off CPUS=4`.-Open: `iconservicesagent` crashes in lavapipe (disabled with `launchctl disable gui/501/...`); no GPU bridge for-NVIDIA's driver; one boot in three takes the leftover encrypted Data volume for the root device.+- `gpu/`: `build-virglrenderer.sh` installs virglrenderer 1.2.0 with Venus, which `gpu/xnu-drm/xnudrmd` then serves the+ hosted system's Vulkan from (NVIDIA's render node is not virtio-gpu). Written and tested off the machine only+ (`make -C gpu/xnu-drm test-virgl`); not yet run on NVIDIA's driver.++With `GPU=auto` and the Venus driver in `/Library/GPUBundles/XnuCpuMetal.bundle` Metal and WindowServer run on the GB10+(`Virtio-GPU Venus (NVIDIA GB10)`), the Dock with its icons. The counter here runs at 1 GHz: xnu.ko has XNU scale it to+Apple's 24 MHz (user space assumes it).++Open: without a GPU `iconservicesagent` crashes in lavapipe; stopping a run takes minutes; one boot in three takes the+leftover encrypted Data volume for the root device.