Top | ![]() |
![]() |
![]() |
![]() |
gpointer | detection-device | Read |
LdmGPUType | gpu-type | Read |
gpointer | manager | Read / Write / Construct Only |
gpointer | primary-device | Read |
gpointer | secondary-device | Read |
This object is used to query an LdmManager for the system GPU configuration and topology. Using the LdmGPUConfig allows end-users to query exactly what kind of configuration is present, and determine the primary vs secondary GPUs, presence of Optimus/Hybrid GPUs, etc.
C example:
1 2 3 |
LdmManager *manager = ldm_manager_new(LDM_MANAGER_FLAGS_NONE); LdmGPUConfig *gpu = ldm_gpu_config_new(manager); g_message("This system has %d GPUs", ldm_gpu_config_count(gpu)); |
LdmGPUConfig *
ldm_gpu_config_new (LdmManager *manager
);
Construct a GPU configuration from the LdmManager to determine the exact GPU topology.
guint
ldm_gpu_config_count (LdmGPUConfig *config
);
Determine the number of GPUs present on the system
LdmGPUType
ldm_gpu_config_get_gpu_type (LdmGPUConfig *config
);
Get the type for this GPU Configuration to determine exactly what kind of device set we're dealing with.
gboolean ldm_gpu_config_has_type (LdmGPUConfig *config
,LdmGPUType mask
);
Test whether this GPU config has the given type(s) by testing the mask against our known types.
C example:
1 2 3 |
if (ldm_gpu_config_has_type(gpu, LDM_GPU_TYPE_OPTIMUS)) { g_message("System is using an Optimus configuration"); } |
LdmDevice *
ldm_gpu_config_get_primary_device (LdmGPUConfig *config
);
Get the device that this LdmGPUConfig has determined to be the primary active GPU. This should be the baseline for driver detection in all *non hybrid* detection cases.
LdmDevice *
ldm_gpu_config_get_secondary_device (LdmGPUConfig *config
);
Get the device that this LdmGPUConfig has determined to be the secondary GPU. This is only useful in hybrid GPU setups, and is always the discrete GPU (dGPU).
When the “gpu-type” is LDM_GPU_TYPE_OPTIMUS, the secondary device is always the NVIDIA dGPU, and driver detection should be performed against this device only.
LdmDevice *
ldm_gpu_config_get_detection_device (LdmGPUConfig *config
);
Get the device that this LdmGPUConfig has determined to be the best candidate for driver detection.
For any hybrid GPU configuration, this will be the secondary GPU (discrete GPU). For all other cases, this will be the primary GPU (i.e. the one used to boot the system)
GPtrArray *
ldm_gpu_config_get_providers (LdmGPUConfig *config
);
Get the LdmProvider sbest suited for this particular GPU Configuration. This is a quick wrapper around various internal functions to make it quick and painless to learn the correct GPU driver expected for the graphical drivers.
The internal “manager” is responsible for sorting the returned list.
A GPU configuration can only have one active state at the time of detection as far as LDM is concerned. It is in most cases a simple configuration, i.e. not hybrid or composite. Beyond that, we tag to refine the state.
Hybrid refers to *both* AMD and NVIDIA hybrid GPU approaches, and simply indicates we discovered a hybrid GPU configuration.
Composite indicates we're dealing with Crossfire or SLI systems.
A GPU configuration may have one or more state applied, i.e. it may be a hybrid GPU system but we can further refine this by tagging it as an Optimus system too.
“detection-device”
property“detection-device” gpointer
GPU device that should be used for driver detection
[transfer none]
Flags: Read
“gpu-type”
property“gpu-type” LdmGPUType
The composite type for this GPU Configuration
Flags: Read
“manager”
property“manager” gpointer
Parent device for this device instance
[transfer none]
Flags: Read / Write / Construct Only
“primary-device”
property“primary-device” gpointer
Primary device in this configuration
[transfer none]
Flags: Read
“secondary-device”
property“secondary-device” gpointer
Secondary device in this configuration
[transfer none]
Flags: Read