Skip to content

v0.35.5

Choose a tag to compare

@kolkov kolkov released this 22 Nov 21:11
· 7 commits to main since this release

A PATCH release: adapter hardware identity — the public Adapter.Identity().

Adapter hardware identity (ADR-084)

func (a *Adapter) Identity() gputypes.AdapterIdentity

Each field answers a different question and has its own lifetime, and the doc comment states the promise per identifier:

  • DeviceUUID — the Vulkan 16-byte device UUID: persistent per device, immutable across instances, processes, driver versions and reboots. It is not a serial, and conformance cannot prove uniqueness, so the zero value means "unknown" and callers guard collisions.
  • PCIBusID — the PCI slot locator from VK_EXT_pci_bus_info: persistent while the card stays in its slot, and per slot, so it distinguishes identical cards.
  • AdapterLUID — the session-local Windows LUID: the value Vulkan reports as deviceLUID when valid (equal to the DXGI LUID by the Vulkan spec), and the DXGI LUID itself on DX12 — in both the primary and the legacy enumeration paths. It changes on reboot, driver update, or adapter disable.
  • MetalRegistryID — the instance-local Metal registry ID, not constant across reboots.

AdapterInfo is unchanged: identity is a separate value, and its absence (the zero value) is never an error. DeviceUUID.NVMLString() renders the form NVML uses — on NVIDIA hardware it is exactly nvidia-smi's UUID string, and PCIBusID.NVMLString() is pci.bus_id.

Population: Vulkan queries VkPhysicalDeviceIDProperties and VK_EXT_pci_bus_info (when the device supports it) in one vkGetPhysicalDeviceProperties2 chain; DX12 packs the stored DXGI LUID; Metal reports registryID. GLES, the software backend and the browser report zeros — and so does -tags rust: the wgpu-native binding exposes no identity data, and upstream has no plan to add it.

Verified on hardware

On a real NVIDIA CMP 30HX host, the adapter's DeviceUUID renders exactly the UUID nvidia-smi prints (GPU-288bbc7b-…), PCIBusID matches pci.bus_id (00000000:04:00.0), and the Vulkan deviceLUID equals the DXGI adapter LUID — the equality the Vulkan specification requires. The check ships as a local-only test (WGPU_REQUIRE=identity), documented in the repository.

Also

  • gputypes v0.9.2: the AdapterIdentity carrier — the device UUID, PCI slot locator, LUID and Metal registry ID types with the frozen String()/NVMLString() renderings. This release also brings the ray-query binding types and Limits helpers that gputypes merged since v0.9.1.
  • The per-identifier contract table in the Identity() doc is pinned identical across the three build-variant declaration files by a test.

Full changelog: https://github.com/gogpu/wgpu/blob/main/CHANGELOG.md