OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — C++ API referencev12.0

optris::sdk::GpuInfo

The GPU the SDK would use, or the reason there is not one.

Process-wide and answerable with no camera attached, because that is the question an About box asks. The SDK keeps one shared GPU context for every camera, so there is exactly one answer here however many cameras are open.

Public attributes

compiled_with_gpu

bool compiled_with_gpu = false

Whether this build has GPU support compiled in at all.

Always true since the OTC_GPU build option was removed. It used to be false for a build configured with -DOTC_GPU=OFF, where every camera ran on the CPU pipeline and no adapter was ever looked for. There is no such configuration any more, so there is no longer a way for this to read false.

Kept rather than removed: it is published on the C ABI, and in the C#, Python and Rust bindings, where dropping it would change optris_sdk_gpu_info's layout and move every field after it. Whether a field that can only answer one thing should stay on a public surface is a separate decision from deleting a build flag, so it was not taken here.

Ask available instead. That is the question nearly every caller of this actually meant: whether a usable adapter was found on this machine, which still varies.

available

bool available = false

Whether a usable adapter was found. A software-only adapter counts as unusable and says so in unavailable_reason.

api

std::string api

"D3D12", "Vulkan", ... Empty when unavailable.

adapter

std::string adapter

The adapter's name. Empty when unavailable.

vendor

std::string vendor

The vendor's name, derived from vendor_id. Empty for a PCI vendor id the SDK does not have a name for, and empty when unavailable.

Derived here rather than asked of the driver. The obvious source, WGPUAdapterInfo::vendor, is wrong: wgpu-native fills from wgpu's driver field -- so on D3D12 it held the display driver's version ("32.0.16.1692" was measured on an NVIDIA RTX 2000 Ada) and on Vulkan the driver's name, which is not always the vendor's. On no backend was it the vendor. The PCI id beside it was right all along, so the name comes off that.

The driver's own strings are not lost; see driver_name and driver_version.

vendor_id

std::uint32_t vendor_id = 0

PCI vendor id, or zero.

device_id

std::uint32_t device_id = 0

PCI device id, or zero.

driver_name

std::string driver_name

The driver's own name, where it reports one. Empty otherwise.

Reported separately from the version because the backends report one, the other, or both: a Vulkan driver names itself ("radv", "NVIDIA"), and D3D12 reports a version and no name at all.

driver_version

std::string driver_version

The driver's version, where it reports one. Empty otherwise.

The first thing a support engineer asks for, which is why it is kept rather than discarded now that it no longer occupies vendor. Free-form: "32.0.16.1692" on D3D12, whatever a Vulkan driver puts in VkPhysicalDeviceDriverProperties::driverInfo.

is_software

bool is_software = false

A software rasteriser rather than real hardware.

unavailable_reason

std::string unavailable_reason

Why there is no GPU, when there is not. Empty when available. This is the text that used to exist only as an error-level log line at startup: "No suitable GPU adapter found", "Only a software GPU adapter is available; using the CPU pipeline instead", "Adapter request failed", "Device request failed".