# GPU Codec Detection

MPV Manager displays detected GPU models and codec families and uses vendor
information to recommend mpv hardware-decoding options. The fallback catalog is
in [gpu.go](../../pkg/platform/gpu.go); it is an estimate of decoder capabilities,
not a guarantee that a particular driver, API or video profile will work.

## Detection Methods

- **Linux:** aggregate GLX, Vulkan and PCI/DRM model information. Try `vainfo`,
  then `vdpauinfo` for codec support; use the model catalog if those probes fail.
  The catalog fallback combines recognized adapters. A successful runtime probe
  describes the adapter selected by that probe, not necessarily every GPU.
- **Windows:** discover names through WMIC with a non-interactive PowerShell/CIM
  fallback. Codec information comes from the model catalog. The current codec
  path returns the first recognized adapter's list; it is not a per-adapter
  Direct3D/DXVA capability query.
- **macOS:** discover models with `system_profiler`; use VideoToolbox hardware
  queries in CGO builds and conservative model-based logic in non-CGO builds.

System probes have time and output bounds. See [architecture](../ARCHITECTURE.md)
for the shared probe and process boundaries.

## GPU Database

`GPUModelEntry` holds explicit model aliases, series aliases, codenames,
architecture labels and mpv codec-family identifiers. The Go tables are the
source of truth; no external CSV or online catalog is loaded at runtime.

Matching normalizes case, whitespace and `(R)`/`(TM)`/`®`/`™` decorations, then
checks model, series, codename and alternate-codename passes. Aliases have token
boundaries: `RX 6800` cannot silently claim `RX 6800M`, and `Vega 6` cannot claim
`Vega 64`. Numeric family prefixes do not imply decoder support; recognized RTX models
are listed explicitly, including laptop variants with the same model token.
Empty codenames never match. A missing or ambiguous match returns `unknown`.

### Known corrections, September 2026

- Radeon 660M/680M include AV1 decode. Add explicit 740M/760M and 860M/880M
  aliases alongside the existing 780M/890M entries.
- RX 6000M/6000S and RX 7000M/7000S have explicit aliases in their chip groups.
  The Navi 24 mobile group (6300M/6450M/6500M/6550M) does not gain AV1 merely
  because other RX 6000 products have it. Desktop-number prefix matches no
  longer silently determine a mobile model's group.
- Intel Alchemist includes explicit A-series mobile and Pro aliases. It is
  separate from Meteor/Arrow Lake: the latter include VP8 decoding.
- Arc 130T/140T identify the Meteor/Arrow media-capability group; 130V/140V
  identify Lunar Lake, including the `Arc Graphics 140V` spelling.
- Battlemage B570/B580 and Pro B50/B60 do **not** claim VVC decoding. Lunar Lake
  and Panther Lake do. B370/B390 map to Panther Lake rather than matching a
  blanket `Arc B` rule. Modern Intel entries include VP8 where documented.
- UHD Graphics 710/730/750/770 have explicit aliases. Generic `Intel Graphics`,
  `Intel Xe Graphics`, `Arc Graphics`, and `Core Ultra 200` remain unknown unless
  a recognized, more specific model or codename is present. The shared branding
  cannot identify the media generation safely.
- NVIDIA RTX 2050 maps to Ampere with AV1 rather than the Turing RTX 20xx
  group. Quadro RTX 3000/4000/5000/6000/8000 map to Turing without AV1; they
  no longer inherit newer GeForce capabilities from a numeric prefix. Other
  existing NVIDIA codec lists are retained. This pass does not claim a complete
  new NVIDIA workstation/mobile inventory.

### Sources and limits

Mappings were checked against these primary sources on 2026-09-05:

- [AMD integrated/discrete codec matrix](https://www.amd.com/en/products/graphics/radeon-for-creators/video-editing.html)
  and [AMD AMF hardware features](https://github.com/GPUOpen-LibrariesAndSDKs/AMF/wiki/GPU-and-APU-HW-Features-and-Support)
  establish the VCN generation/codec distinctions and Ryzen 6000 AV1 support.
- [AMD RX 6800M specifications](https://www.amd.com/en/support/downloads/drivers.html/graphics/radeon-rx/radeon-rx-6000-series/amd-radeon-rx-6800m.html),
  [RX 6450M specifications](https://www.amd.com/en/support/downloads/drivers.html/graphics/radeon-rx/radeon-rx-6000-series/amd-radeon-rx-6450m.html),
  [RX 6550M specifications](https://www.amd.com/en/support/downloads/drivers.html/graphics/radeon-rx/radeon-rx-6000-series/amd-radeon-rx-6550m.html)
  and [RX 7000 mobile announcement](https://www.amd.com/en/newsroom/press-releases/2023-1-4-amd-unveils-suite-of-new-radeon-gpus-to-power-high.html)
  distinguish mobile capability groups. A driver compatibility list alone is
  insufficient evidence of decoder support.
- [Intel processor graphics names](https://www.intel.com/content/www/us/en/support/articles/000007420/processors.html)
  and [Intel media-driver matrix](https://github.com/intel/media-driver/blob/94e1f4bf5ffe027d9b19506bbe9b9fdccbcb73b4/README.md#decodingencoding-features)
  distinguish Alchemist, Meteor/Arrow Lake, Lunar Lake, Battlemage and Panther
  Lake. The matrix also documents OS/build-dependent availability; in particular
  its BMG column has no VVC decode. Do not infer capabilities from the Xe brand.
- [NVIDIA decode matrix](https://developer.nvidia.com/video-encode-decode-support-matrix)
  identifies the Ampere RTX 2050 and Turing Quadro RTX models; consult the
  decode table separately from the encode table.

This correction pass is not a comprehensive audit of every historical or
current SKU. Additional PRO/AI PRO variants and ambiguous-device PCI/native API
resolution remain follow-up work driven by verified specifications and reports.

## Codec Mapping

The catalog returns codec families such as `avc` (H.264), `hevc` (H.265), `vp9`,
`av1`, `vvc` (H.266), `vp8`, `vc1`, and `mpeg2`. A family being present does not
mean every bit depth, chroma format, resolution or profile is hardware decoded.
Decode and encode support are separate. Do not copy encoder features into this
catalog, or infer driver availability solely from silicon capability.

## Hardware Acceleration Options

`GetHWAOptions` and `GetRecommendedHWADecoder` use OS and GPU vendors to offer
mpv backends and fallbacks. Multi-vendor systems use a fallback chain because
mpv may open on a different adapter. `unknown` catalog results do not prevent
users from selecting a hardware-decoding option or letting mpv choose.

## Testing GPU Detection

Run the platform tests and race checks:

```sh
go test ./pkg/platform
go test -race ./pkg/platform
```

`gpu_catalog_test.go` covers explicit mobile/iGPU names, Intel generation
collisions, Unicode branding, NVIDIA model/brand collisions and ambiguous
names. Existing parser/probe tests verify parsing and fallback behavior. These
are software regressions against documented expectations, not physical GPU
qualification. Cross-compilation establishes build compatibility only.

The Windows QA VM exposes a basic display adapter. We cannot use it to qualify
AMD/Intel/NVIDIA hardware detection or decoding. Real-device validation relies
on user reports; the known code corrections are not blocked on access to every
model, and no physical GPU validation is claimed for this pass.

## Troubleshooting and User Reports

For a missing model, incorrect codec list or playback fallback, include:

1. MPV Manager version, OS version, GPU driver version and all displayed GPU
   names, copied exactly (including suffixes such as M/S/T/V).
2. The displayed codec list and the expected difference, with a vendor source
   if available. Include the processor model for an integrated GPU.
3. Adapter hardware/PCI IDs if available. On Windows these are in Device
   Manager → Display adapters → Properties → Details → Hardware Ids. On Linux,
   `lspci -nn` and the relevant `vainfo`/`vdpauinfo` output help identify the
   adapter and distinguish reported capabilities from catalog estimates.
4. For an actual playback problem, mpv version, selected `hwdec` backend, video
   codec/profile/bit depth/chroma and the relevant decoder log excerpt. Review
   logs for private paths before sharing. A software fallback alone does not
   prove the model catalog is wrong.

Convert confirmed reports into exact-name/probe fixtures and update the
associated documented mapping. Avoid broad brand aliases that could assign
newer capabilities to an older or different media engine. Track those cases in
Atlas rather than marking an open-ended hardware inventory permanently done.
