RFC: use json serialization of intel_device_info to stub intel gpu platforms
intel_stub_gpu initializes device parameters based on platform or pci-id. This cannot accurately stub information which is queried from the kernel or GuC, eg topology.
intel_stub_gpu is typically used to provide statistical information about compiler optimizations for several platforms using shader-db. Default values for some device info fields does not hinder the effectiveness of this analysis.
However, slight inaccuracies in device info may have indeterminate effects on shader compilation. Using intel_stub_gpu to generate offline compiled shaders for a shader cache may cause crashes. This MR enables precise replication of compiler configuration.
Sample usage:
# on any system, capture the shaders to be offline-compiled
$ MESA_SHADER_CAPTURE_PATH=/tmp/shaders some_program
# on the target system, capture the device configuration
$ intel_dev_info --json > platform_definition.json
# on the offline compile system, capture the compiled shaders for the target
$ INTEL_STUB_GPU_JSON=platform_definition.json MESA_SHADER_CACHE_DIR=/tmp/cache intel_stub_gpu shader-db/run -b /tmp/shaders/*
# shader cache for the target platform available in /tmp/cache