Method for setting a main output graphics card by a VGA arbiter module

By scanning and sorting graphics card devices in the VGA Arbiter module and selecting the primary output graphics card according to preset priority rules, the restart problem caused by an unsuitable primary output graphics card in the existing technology is solved, achieving seamless switching and improved system continuity.

CN122507408APending Publication Date: 2026-08-04KYLIN CORP
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
KYLIN CORP
Filing Date
2026-03-20
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

In existing technologies, the primary output graphics card set by the VGA Arbiter module may not be the most suitable one. This means that when switching to a suitable primary output graphics card, it is necessary to restart Xorg and the desktop environment for the changes to take effect, which lacks flexibility and configurability.

Method used

The system scans to obtain the identification information of all graphics card devices, sorts them according to preset priority rules, and designates the highest priority graphics card device as the main output graphics card of the VGA Arbiter module. It parses the startup parameters to determine and designate the main output graphics card, thus avoiding the process of restarting Xorg and the desktop environment.

Benefits of technology

It enables the automatic selection of the appropriate primary output graphics card based on preset priority rules without restarting Xorg and the desktop environment, improving the continuity and availability of system operation, and enhancing flexibility and practicality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122507408A_ABST
    Figure CN122507408A_ABST
Patent Text Reader

Abstract

The application discloses a method for setting a main output graphics card of a VGA Arbiter module, comprising the following steps: scanning and acquiring identification information of all graphics card devices in a system; sorting the graphics card devices in the system according to a preset priority rule, and specifying a graphics card device with the highest priority as the main output graphics card of the VGA Arbiter module. The application selects a suitable graphics card as the main output according to the preset priority rule, and does not need subsequent manual switching, thus avoiding the process of restarting Xorg and a desktop environment from the root, and improving the continuity and availability of system operation. The priority rule can be flexibly configured according to different scenes, and the flexibility is better than that of directly setting the first VGA device scanned by the VGA Arbiter module as the main output graphics card.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graphics card device management technology, and more specifically to a method for setting the main output graphics card in a VGA Arbiter module. Background Technology

[0002] The VGA Arbiter is a core mechanism in the Linux kernel used to manage resource allocation for multiple VGA devices. In multi-GPU systems, the VGA Arbiter coordinates access to I / O ports and memory regions by different GPUs, avoiding resource conflicts and ensuring stable system operation. With the development of multi-GPU technology, the VGA Arbiter plays an important role in hybrid graphics architectures, power management, and virtualization scenarios.

[0003] Currently, the VGA Arbiter module uses a simple selection mechanism when setting the primary output graphics card. Specifically, during the initialization phase, the module scans for VGA devices in the system and directly sets the first VGA device detected as the primary output graphics card (see [link]). Figure 1 Alternatively, a VGA device can be specified as the primary output graphics card via the startup parameters of the VGA Arbiter module. While this mechanism is simple to implement, it lacks flexibility and configurability. In scenarios with multiple graphics cards deployed together, the first device scanned may not be the most powerful or suitable graphics card for primary output, resulting in the system not fully utilizing hardware resources. Although the primary output graphics card can be switched via the sys file system after entering the system, a restart of Xorg and the desktop environment is required for the change to take effect.

[0004] Chinese patent CN119987883A discloses a method for switching between multiple graphics cards on a domestic platform. This solution obtains the user-set target graphics card configuration information through the UEFI configuration interface, determines whether it matches the default graphics card configuration information, and if they do not match, restarts the platform to complete the graphics card switching. While this solution provides a user interface for graphics card switching, the switching process requires a system restart, which is cumbersome and affects system availability.

[0005] International patent WO2022048098A1 discloses a game rendering method and system based on multiple graphics cards. This solution identifies multiple physical graphics cards on a physical host, determines the rendering task, and divides it into multiple rendering parts, which are then rendered by the target physical graphics card. This solution primarily addresses the problem of multi-graphics card rendering task allocation, but does not involve the setting and management of the primary output graphics card. Summary of the Invention

[0006] The technical problem to be solved by this invention is to provide a method for setting the primary output graphics card in a VGA Arbiter module, which addresses the above-mentioned problems in the prior art. This invention aims to solve the problem that the primary output graphics card set by the VGA Arbiter module may not be the most suitable graphics card device, and that it is necessary to restart Xorg and the desktop environment for the switch to a suitable primary output graphics card to take effect. This invention allows for the selection of a suitable graphics card device, thereby avoiding the need to restart Xorg and the desktop environment.

[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for configuring the primary output graphics card using a VGA Arbiter module includes the following steps: S1, scan to obtain the identification information of all graphics card devices in the system; S2 sorts the graphics card devices in the system according to a preset priority rule and designates the graphics card device with the highest priority as the main output graphics card of the VGA Arbiter module.

[0008] Optionally, before specifying the highest priority graphics card device as the main output graphics card of the VGA Arbiter module, the startup parameters of the VGA Arbiter module are parsed to determine whether a main output graphics card is specified and whether the specified main output graphics card is the graphics card device in the current system. If so, the process jumps to step S3; otherwise, the highest priority graphics card device is specified as the main output graphics card of the VGA Arbiter module. S3 sets the primary output graphics card specified in the startup parameters to the primary output graphics card of the VGA Arbiter module.

[0009] Optionally, parsing the startup parameters of the VGA Arbiter module includes: obtaining the graphics card identification information of the specified main output graphics card from the startup parameters; determining that the specified main output graphics card is a graphics card device in the current system includes comparing the identification information of all graphics card devices in the system obtained in step S1 with the graphics card identification information of the specified main output graphics card obtained from the startup parameters.

[0010] Optionally, the startup parameters specify the primary output graphics card by using the PCI bus location information of the target graphics card or the device driver name.

[0011] Optionally, the preset priority rules include: sorting all the graphics card devices obtained in step 1 according to the priority order of commercial graphics cards, domestic discrete graphics cards, integrated graphics cards, and graphics cards without rendering functions.

[0012] Optionally, the method is executed immediately after the VGA Arbiter module begins loading.

[0013] Optionally, the method is applied to a Linux system with a multi-GPU hybrid deployment.

[0014] Furthermore, the present invention also provides a system for setting the main output graphics card of a VGA Arbiter module, including a microprocessor and a memory interconnected thereto, wherein the microprocessor is programmed or configured to execute the method of setting the main output graphics card of the VGA Arbiter module.

[0015] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute, via a processor, a method for setting the main output graphics card by the VGAArbiter module.

[0016] In addition, the present invention also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute a method for setting the main output graphics card by the VGA Arbiter module via a processor.

[0017] Compared with the prior art, the present invention has the following main advantages: This invention selects a suitable graphics card as the primary output based on a preset priority rule, eliminating the need for manual switching and fundamentally avoiding the process of restarting Xorg and the desktop environment. This improves the continuity and availability of system operation. The priority rule can be flexibly configured according to different scenarios, offering greater flexibility compared to simply setting the first VGA device scanned by the VGA Arbiter module as the primary output graphics card. Attached Figure Description

[0018] Figure 1 A flowchart illustrating the process of setting up the main output graphics card for a VGA Arbiter module in the existing technology.

[0019] Figure 2 This is a schematic diagram of the execution flow of the method in an embodiment of the present invention. Detailed Implementation

[0020] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.

[0021] As disclosed in this invention, unless the context clearly indicates otherwise, words such as "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. The terms "first," "second," and similar terms used in this invention disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, words such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connected" or "linked" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

[0022] To facilitate understanding, the relevant technical terms and technical background that may be involved in this application will be introduced first.

[0023] Kernel Mode Setting (KMS): Kernel Mode Setting (KMS) is the core mechanism of modern Linux graphics card drivers, which can manage the initialization and control of display hardware.

[0024] Xserver: Xserver is the core display server of the X Window System. It is responsible for managing graphics hardware and input devices, handling graphics requests from client applications, and enabling interaction between the user interface and the underlying system.

[0025] Xorg: Xorg is the specific implementation of X Server in the X Window System. That is, Xorg is an open-source implementation maintained by the X.Org Foundation. As the cornerstone of the Linux graphics system, it provides users with a flexible and customizable graphics environment through a client-server architecture and rich extension functions.

[0026] Primary output graphics card: In a multi-GPU Linux graphical system, this is the graphics card that hosts the primary desktop. For example, in a multi-GPU scenario, each graphics card is connected to a monitor, and the system is set to extended mode. The primary output graphics card determines the desktop environment, including the Start Menu, My Computer icon, etc., which are displayed on the monitor connected to the primary output graphics card. The other monitor then serves as the extended desktop.

[0027] The VGA Arbiter is a core mechanism in the Linux kernel used to manage resource allocation for multiple VGA devices. Through hardware support, dynamic locking mechanisms, and tight integration with kernel modules, it achieves efficient management of resources for multiple VGA devices. It plays a crucial role in multi-GPU systems, ensuring system stability and performance.

[0028] Its implementation mechanism can be summarized as follows: Resource Coordination and Conflict Avoidance: The core task of the VGA Arbiter is to coordinate access to I / O ports and memory regions by multiple VGA devices. Traditional VGA devices reserve fixed address ranges on the PCI bus (such as the "hard-decoded" addresses of the ISA era), which can easily lead to conflicts when multiple devices coexist. The arbiter ensures orderly access by different devices by dynamically managing these resources.

[0029] Device Identification and Initialization: When the module loads, the VGA Arbiter scans all PCI devices, identifies VGA-compatible devices (such as GPUs), and includes them in the arbitration management. Devices can explicitly declare whether they require arbitrator intervention through the vga_set_legacy_decoding() interface.

[0030] Integration with DRM driver: VGA Arbiter works in conjunction with the DRM (Direct Rendering Manager) driver. DRM is responsible for specific GPU operations (such as rendering and display output), while VGA Arbiter handles resource allocation and switching between multiple devices, forming a complete multi-GPU management framework.

[0031] Its applications in multi-GPU scenarios are as follows: Hybrid graphics architecture support: In systems where integrated GPUs (iGPUs) and discrete GPUs (dGPUs) coexist, VGAArbiter works in conjunction with the vga_switcheroo mechanism.

[0032] Power Management and Performance Optimization: VGA Arbiter achieves energy savings by dynamically adjusting the device's power state (such as ACPI state). For example, when the system load is low, the discrete GPU can be turned off to reduce power consumption; when high-performance graphics processing is required, it is quickly woken up and resources are allocated.

[0033] Virtualization and Passthrough Technologies: In a virtualized environment, VGA Arbiter supports GPU passthrough technologies (such as VFIO), allowing virtual machines to directly access the physical GPU. Resource locking is managed through an arbiter, ensuring isolation and efficiency of GPU access between virtual machines.

[0034] In multi-GPU scenarios, Xorg works closely with VGA Arbiter to ensure stable system operation: During the initialization phase of device identification and registration VGA Arbiter Device Scanning: When the kernel module is loaded, VGA Arbiter scans all devices via the PCI bus to identify VGA-compatible devices (such as GPUs). Identified devices are then included in the arbitration management system, and their status (such as decoded I / O and memory regions) can be viewed through the ` / sys / kernel / debug / vga_Arbiter / switch` interface.

[0035] Xorg's DRM driver initialization: When Xorg starts, its DRM (Direct Rendering Manager) driver module scans PCI devices, identifies VGA-compatible devices, and registers the devices with VGAArbiter through the vga_set_legacy_decoding() interface. This step ensures that Xorg is aware of all available GPU resources in the system.

[0036] Runtime resource management phase GPU switching triggering and execution: In multi-GPU systems, users or the system may need to switch GPUs based on performance requirements. Xorg triggers the VGA Arbiter's action by writing to the / sys / kernel / debug / vga_Arbiter / switch interface. Write ON instruction: Enable the target GPU and make it the currently active graphics output device.

[0037] Write OFF instruction: Turn off the target GPU and release its resources.

[0038] Power management and performance optimization during operation Dynamic Power Management: The VGA Arbiter works in conjunction with Xorg to enable dynamic power management for the GPU. In low-load scenarios: Xorg can request the VGA Arbiter to shut down the dedicated GPU, reducing system power consumption.

[0039] High-load scenarios: Xorg requests the activation of a dedicated GPU and coordinates resource allocation through the VGA Arbiter to ensure high-performance graphics processing.

[0040] Display mode settings: Xorg sets the display mode (such as resolution and refresh rate) through the KMS (Kernel Mode Setting) function driven by DRM. During this process, the VGA Arbiter coordinates the output configuration of multiple GPUs to ensure the correct transmission of display signals.

[0041] Virtualization and pass-through scenarios In a virtualized environment, VGA Arbiter supports GPU passthrough technologies (such as VFIO), allowing virtual machines to directly access the physical GPU. Xorg manages the locking and releasing of GPU resources through VGA Arbiter, ensuring GPU access isolation and efficiency between virtual machines.

[0042] In summary, the interaction between VGA Arbiter and Xorg spans multiple stages, including GPU initialization, switching, resource locking, power management, and virtualization support. This close interaction ensures stable and efficient graphics display in multi-GPU systems.

[0043] The present invention, a method for setting the primary output graphics card using a VGA Arbiter module, emphasizes the VGA Arbiter module mechanism. The VGA Arbiter module manages the primary output graphics card; switching the primary output graphics card is not a graphics card switch, nor is it a switch of the VGA signal source.

[0044] like Figure 2 As shown, the method for configuring the main output graphics card using the VGA Arbiter module in this embodiment includes the following steps: S1, scan to obtain the identification information of all graphics card devices in the system; S2 sorts the graphics card devices in the system according to a preset priority rule and designates the graphics card device with the highest priority as the main output graphics card of the VGA Arbiter module.

[0045] The method for setting the primary output graphics card in the VGA Arbiter module of this embodiment selects a suitable graphics card as the primary output according to a preset priority rule, eliminating the need for subsequent manual switching. This fundamentally avoids the process of restarting Xorg and the desktop environment, improving the continuity and availability of system operation. The priority rule can be flexibly configured according to different scenarios, offering greater flexibility compared to simply setting the first VGA device scanned by the VGA Arbiter module as the primary output graphics card.

[0046] Furthermore, in this embodiment, before specifying the graphics card device with the highest priority as the main output graphics card of the VGA Arbiter module, the method further includes parsing the startup parameters of the VGA Arbiter module, determining whether there is a specified main output graphics card, and whether the specified main output graphics card is the graphics card device in the current system. If yes, the method jumps to step S3; otherwise, the method continues to specify the graphics card device with the highest priority as the main output graphics card of the VGA Arbiter module. S3 sets the primary output graphics card specified in the startup parameters to the primary output graphics card of the VGA Arbiter module.

[0047] Corresponding to the previous section, two configuration methods are provided for the VGA Arbiter module: specifying the main output graphics card in the startup parameters and selecting the main output graphics card based on priority. This not only meets the user's need for customized configuration, but also provides a fallback mechanism for automatic selection by the system, enhancing the practicality and robustness of the solution.

[0048] In this embodiment, parsing the startup parameters of the VGA Arbiter module includes: obtaining the graphics card identification information of the specified primary output graphics card from the startup parameters; determining whether the specified primary output graphics card is a graphics card device in the current system includes comparing the identification information of all graphics card devices in the system obtained in step S1 with the graphics card identification information of the specified primary output graphics card obtained from the startup parameters. The graphics card identification information can be the PCI bus location, the name of the graphics card physical interface, the name of the graphics card device driver, or even a manufacturer / model identifier, as long as the identification information points to only one graphics card device in the system.

[0049] In one specific embodiment, the preset priority rule includes sorting all graphics card devices obtained in step 1 according to the priority order of commercial graphics cards, domestic discrete graphics cards, integrated graphics cards, and graphics cards without rendering capabilities. Commercial graphics cards typically have stronger graphics processing capabilities and better driver support, therefore having the highest priority; domestic discrete graphics cards, as independently controllable graphics card products, play an important role in domestic application scenarios, thus having the next highest priority; integrated graphics cards have low power consumption but relatively weak performance, thus having a lower priority; graphics cards without rendering capabilities only support basic VGA text mode, thus having the lowest priority. This priority rule ensures that the system can automatically select the graphics card with the best performance as the main output device without user intervention. It is conceivable that other priority rules can also be set in other embodiments, such as directly sorting the graphics card devices in the system from high to low performance scores.

[0050] The method for setting the primary output graphics card in the VGA Arbiter module of this embodiment is executed immediately after the VGA Arbiter module starts loading. It takes effect without restarting Xorg and the desktop environment. Compared to existing technologies that require restarting the graphics system, this improves user experience and system availability, and reduces operational steps and system downtime.

[0051] In this embodiment, the method is applied to a Linux system with a multi-GPU hybrid deployment.

[0052] In addition, this embodiment also provides a system for setting the main output graphics card of a VGA Arbiter module, including a microprocessor and a memory interconnected, wherein the microprocessor is programmed or configured to execute a method for setting the main output graphics card of a VGA Arbiter module.

[0053] In addition, this embodiment also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute a method for setting the main output graphics card via a VGA Arbiter module through a processor.

[0054] In addition, this embodiment also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute a method for setting the main output graphics card via a VGA Arbiter module through a processor.

[0055] Those skilled in the art will understand that the technical solutions provided by the embodiments of this application may be in the form of a method, system, or computer program product. Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create an implementation for the process. Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0056] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A method for setting a master output graphics card by a VGA arbiter module, characterized in that, Includes the following steps: S1, scan to obtain the identification information of all graphics card devices in the system; S2 sorts the graphics card devices in the system according to a preset priority rule and designates the graphics card device with the highest priority as the main output graphics card of the VGA Arbiter module.

2. The method of claim 1, wherein the VGA Arbiter module sets the primary output graphics card, and wherein the VGA Arbiter module is further configured to: Before specifying the highest priority graphics card device as the main output graphics card of the VGA Arbiter module, the process includes parsing the startup parameters of the VGAArbiter module, determining whether a main output graphics card is specified, and whether the specified main output graphics card is the graphics card device in the current system. If so, the process jumps to step S3; otherwise, it continues to specify the highest priority graphics card device as the main output graphics card of the VGAArbiter module. S3 sets the primary output graphics card specified in the startup parameters to the primary output graphics card of the VGA Arbiter module.

3. The method of claim 2, wherein the VGA Arbiter module sets the primary output graphics card, and wherein the VGA Arbiter module is further configured to: Parsing the startup parameters of the VGA Arbiter module includes: obtaining the graphics card identification information of the specified main output graphics card from the startup parameters; determining that the specified main output graphics card is a graphics card device in the current system includes comparing the identification information of all graphics card devices in the system obtained in step S1 with the graphics card identification information of the specified main output graphics card obtained from the startup parameters.

4. The method of claim 2, wherein the VGA Arbiter module sets the primary output graphics card, and wherein the VGA Arbiter module is further configured to: The startup parameters specify the primary output graphics card by using the PCI bus location information of the target graphics card or the device driver name.

5. The method of claim 1, wherein the VGA Arbiter module sets the primary output graphics card, and wherein the VGA Arbiter module is further configured to: The preset priority rules include: sorting all graphics card devices obtained in step 1 according to the priority order of commercial graphics cards, domestic discrete graphics cards, integrated graphics cards, and graphics cards without rendering functions.

6. The method of setting a primary output graphics card of the VGA Arbiter module according to claim 1, wherein, The method is executed immediately after the VGA Arbiter module begins loading.

7. The method of setting a primary output graphics card of a VGA Arbiter module according to any one of claims 1 to 6, wherein, The method is applied to Linux systems with multi-GPU hybrid deployments.

8. A system for setting a master output of a video graphics array (VGA) arbiter module, comprising a microprocessor and a memory interconnected, wherein, The microprocessor is programmed or configured to perform the method of setting the main output graphics card by the VGAArbiter module as described in any one of claims 1 to 7.

9. A computer-readable storage medium having stored therein a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the method for setting the main output graphics card using the VGA Arbiter module as described in any one of claims 1 to 7.

10. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the method for setting the main output graphics card using the VGA Arbiter module as described in any one of claims 1 to 7.