Driving processing method and device, electronic equipment and readable medium

By generating configuration files with specified priority and configuring them with preset configuration tools, the problem of coexistence of multiple graphics card drivers is solved, and the compatibility and coexistence of multiple drivers and the universality of the operating system is improved.

CN119960840APending Publication Date: 2025-05-09LOONGSON TECH CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411886266.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

How to achieve the coexistence of multi-graphics drivers in electronic devices to avoid conflicts and compatibility issues.

Method used

By determining the target graphics card driver required for the currently configured graphics card, a configuration file with a specified priority is generated, and a configuration operation is performed using the preset configuration tool to control the use of the target graphics card driver for the electronic device.

Benefits of technology

It realizes compatibility and coexistence of multiple graphics card drivers, avoids conflicts, and improves the universality and adaptability of the operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119960840A_ABST
    Figure CN119960840A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a drive processing method and device, electronic equipment and a readable medium, and relates to the technical field of computers, in the method, based on a display card currently configured in the electronic equipment, a target display card drive needing to be used this time is determined. Based on a first configuration file preset for the target graphics card driver, determining a driver storage path of the target graphics card driver; the first configuration file comprises a drive storage path. And then, generating a second configuration file with a specified priority for the target graphics card drive based on the drive storage path. And performing configuration operation according to the second configuration file based on a preset configuration tool so as to control the electronic equipment to use the target graphics card driver. Therefore, under the condition that a plurality of video card drivers exist, conflicts can be avoided to a certain extent, and then compatible coexistence of the plurality of drivers can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a drive processing method, device, electronic device, and readable medium. Background Art

[0002] At present, with the continuous development of computer technology, electronic devices are being used more and more widely. In the process of using electronic devices, in order to ensure the improvement of display effects, the electronic devices may support the configuration of multiple graphics cards. The operation of the graphics card depends on the corresponding graphics card driver. The graphics card drivers of different graphics cards may be different. The graphics card may have both the closed-source driver provided by the graphics card manufacturer and the open-source driver provided by the system.

[0003] In order to ensure that electronic devices can operate normally, how to achieve the coexistence of multiple graphics card drivers has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present invention provide a driver processing method, device, electronic device and readable medium, which can realize the coexistence of multiple graphics card drivers.

[0005] In order to solve the above problems, an embodiment of the present invention discloses a drive processing method, the method comprising:

[0006] Determining a target graphics card driver to be used this time based on a graphics card currently configured in the electronic device;

[0007] Determining a driver storage path of the target graphics card driver based on a first configuration file pre-set for the target graphics card driver; the first configuration file includes the driver storage path;

[0008] Generate a second configuration file of a specified priority for the target graphics card driver based on the driver storage path;

[0009] A configuration operation is performed according to the second configuration file based on a preset configuration tool to control the electronic device to use the target graphics card driver.

[0010] On the other hand, an embodiment of the present invention discloses a drive processing device, the device comprising:

[0011] A first determination module, configured to determine a target graphics card driver to be used this time based on a graphics card currently configured in the electronic device;

[0012] A second determination module is used to determine a driver storage path of the target graphics driver based on a first configuration file pre-set for the target graphics driver; the first configuration file includes the driver storage path;

[0013] A generating module, configured to generate a second configuration file of a specified priority for the target graphics card driver based on the driver storage path;

[0014] A configuration module is used to perform configuration operations according to the second configuration file based on a preset configuration tool to control the electronic device to use the target graphics card driver.

[0015] On the other hand, an embodiment of the present invention discloses an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the aforementioned method.

[0016] The embodiment of the present invention further discloses a machine-readable medium on which instructions are stored. When executed by one or more processors, the processors are enabled to execute the method described above.

[0017] The embodiment of the present invention includes the following advantages: In the driver processing method provided by the embodiment of the present invention, the target graphics card driver to be used this time is determined based on the graphics card currently configured in the electronic device. The driver storage path of the target graphics card driver is determined based on the first configuration file pre-set for the target graphics card driver; the first configuration file includes the driver storage path. Then, a second configuration file of a specified priority is generated for the target graphics card driver based on the driver storage path. Configuration operations are performed according to the second configuration file based on a preset configuration tool to control the electronic device to use the target graphics card driver. In the embodiment of the present invention, by generating a second configuration file of a specified priority for the target graphics card driver to be used this time, and configuring it using a preset configuration tool, the electronic device is controlled to load and use the target graphics card driver to be used this time. In this way, in the case of multiple graphics card drivers, conflicts can be avoided to a certain extent, and the compatible coexistence of multiple drivers can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0019] Figure 1 is a flowchart of a driving processing method provided by an embodiment of the present invention;

[0020] Figure 2 This is a schematic diagram of a startup process provided by an embodiment of the present invention;

[0021] Figure 3 is a block diagram of a drive processing device provided by an embodiment of the present invention;

[0022] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] Reference Figure 1 , shows a flowchart of a driving processing method provided by an embodiment of the present invention, the driving processing method can be applied to electronic devices, such as Figure 1 As shown, the processing method may specifically include the following steps:

[0025] Step 101: Determine a target graphics card driver to be used this time based on the graphics card currently configured in the electronic device.

[0026] Step 102: Determine a driver storage path of the target graphics driver based on a first configuration file pre-set for the target graphics driver; the first configuration file includes the driver storage path.

[0027] Step 103: Generate a second configuration file with a specified priority for the target graphics card driver based on the driver storage path.

[0028] Step 104: Perform configuration operations according to the second configuration file based on a preset configuration tool to control the electronic device to use the target graphics card driver.

[0029] In an embodiment of the present invention, the graphics card currently configured in the electronic device may include a three-dimensional display processor (graphics processing unit, GPU), a two-dimensional GPU, etc. In an application scenario, the driver processing method can be applied to a Linux operating system, and accordingly, the electronic device can be a device installed with a Linux operating system. The currently configured graphics card may include an integrated graphics card and / or a discrete graphics card in the electronic device, and the user may insert a discrete graphics card into the electronic device as needed.

[0030] Since electronic devices may be configured with different graphics cards. The operating system needs to support these different graphics cards. Some graphics card manufacturers directly provide system-level APIs such as libGL.so to implement device drivers, which usually means that they provide their own OpenGL library implementations, which are tightly integrated with the graphics card hardware to ensure optimal performance and full utilization of hardware features. If the Linux system also has the open source Mesa driver installed, conflicts may occur because Mesa also provides its own libGL.so implementation, which implements the OpenGL library in open source form. This problem also exists between private drivers of graphics cards (such as Nvidia, AMD, and Intel) that provide different OpenGL implementations. The conflict is partly due to different drivers using the same OpenGL interface name.

[0031] It may be necessary to provide customized versions of Linux systems for different graphics cards. For example, for Nvidia graphics cards, Linux must disable Mesa drivers and use private drivers. This reduces the versatility of the Linux operating system.

[0032] Therefore, it is necessary to load the correct OpenGL library. For example, for Nvidia graphics cards, it is necessary to load the OpenGL library implemented by its private driver instead of loading the OpenGL library of mesa. One method used in the prior art is to modify the Xorg loader and the Glibc library.

[0033] The driver storage path can be used to indicate the storage directory of the target graphics driver, that is, to indicate the directory where the target graphics driver is located. Specifically, the driver storage path can be the path of the directory where the user state driver of the target graphics driver is located. The first configuration file can be provided by the driver according to the preset file specification, and the first configuration file set for the target graphics driver can record the driver storage path of the target graphics driver. The second configuration file can be a configuration file for use by a preset configuration tool, and the preset configuration tool can be pre-provided by the electronic device. Exemplarily, the preset configuration tool can be a library management tool, for example, an ldconfig dynamic link library configuration tool, which updates the OpenGL dynamic link library. The specified priority can be a priority for indicating that the target graphics driver is configured as a graphics driver to be used preferentially, and exemplarily, the specified priority can be the highest priority. The second configuration file is generated based on the driver storage path of the target display driver, and the file priority of the second configuration file is the specified priority. In this way, it is equivalent to setting the priority for the target graphics driver state required for use this time. Accordingly, the ldconfig tool is used to perform configuration operations according to the second configuration file to configure the electronic device to use the target graphics driver.

[0034] In summary, in the driver processing method provided by the embodiment of the present invention, the target graphics card driver to be used this time is determined based on the graphics card currently configured in the electronic device. Based on the first configuration file pre-set for the target graphics card driver, the driver storage path of the target graphics card driver is determined; the first configuration file includes the driver storage path. Then, a second configuration file of a specified priority is generated for the target graphics card driver based on the driver storage path. Configuration operations are performed according to the second configuration file based on the preset configuration tool to control the electronic device to use the target graphics card driver. In the embodiment of the present invention, by generating a second configuration file of a specified priority for the target graphics card driver to be used this time, and configuring it using the preset configuration tool, the electronic device is controlled to load and use the target graphics card driver to be used this time. In this way, in the case of multiple graphics card drivers, conflicts can be avoided to a certain extent, and the compatible coexistence of multiple drivers can be achieved.

[0035] Optionally, a display driver loading service is pre-set in the electronic device, and the following steps may be included before step 101 in the embodiment of the present invention:

[0036] Step S21: when entering the system startup phase, loading the display driver loading service from the system services stored in the system service directory; the display driver loading service is configured to be started before the display manager of the electronic device;

[0037] Step S22: Start the display driver loading service to execute the driver processing method.

[0038] In the embodiment of the present invention, the display driver loading service may be a pre-set system service, the operating system may provide a variety of system services, and the display driver loading service may be a service written according to preset requirements. The display driver loading service may be represented as GPU Driver Load.service, and the display driver loading service may be stored in a specific directory of the file system, for example, the / etc / systemd / system / directory.

[0039] Furthermore, the Before field of the display driver loading service can be set to a field representing the display manager service. For example, Before=display-manager.service can be set so that the display driver loading service is set to start before the display manager of the electronic device. Among them, display-manager.service represents the display manager service. The display manager can also be called a login manager, which is usually a graphical user interface that replaces the default shell display at the end of the startup process. Similar to the window manager (WM) and desktop environment, the display manager has multiple implementations. Each display manager can usually be customized to a certain extent.

[0040] For the system mechanism of electronic devices, system services in a specific directory can be loaded during the system startup phase, and the startup order of the system services can be determined according to the Before field of the system services. Correspondingly, for the display manager service and the display driver loading service, since the Before field of the display driver loading service is display-manager.service, the display driver loading service can be started first. After the display driver loading service is completed, the display manager service is started. In this way, by utilizing the system mechanism, the operation of modifying the source code of the system library can be omitted, thereby reducing the difficulty of adaptation.

[0041] Specifically, the display driver loading service can be used to implement the processing logic of the driver processing method provided in the embodiment of the present invention. Starting the display driver loading service to execute the driver processing method can specifically be starting the display driver loading service to enter the step of determining the target graphics card driver to be used this time based on the graphics card currently configured in the electronic device and start executing it.

[0042] In an embodiment of the present invention, when entering the system startup link, the display driver loading service is first loaded from the system services stored in the system service directory, and the display driver loading service is set to be started before the display manager of the electronic device. The display driver loading service is started to execute the driver processing method. In this way, the configuration operation according to the second configuration file can be completed before the display manager is started, that is, before the display manager is started, the electronic device is controlled to use the target graphics card driver. In this way, the subsequent display manager can use the target graphics card driver normally, thereby ensuring that the subsequent services are carried out normally.

[0043] Optionally, the step of determining the target graphics card driver to be used this time based on the graphics card currently configured in the electronic device may specifically include:

[0044] Step 1011: Based on the designated device node created for the currently configured graphics card, detect the kernel state driver name of the graphics card driver as the target driver name.

[0045] Step 1012: Detect the preset configuration file in the first designated directory based on the target drive name.

[0046] Step 1013: If no preset configuration file matching the target driver name is detected, the first driver of the target graphics card is determined as the target graphics card driver; the target graphics card is the graphics card corresponding to the target driver name.

[0047] Step 1014: If a preset configuration file matching the target driver name is detected, the matching preset configuration file is determined as the first configuration file, and the second driver of the target graphics card is determined as the target graphics card driver.

[0048] Specifically, in the system startup phase or when the graphics card is plugged in and out, the kernel state driver in the graphics card driver of each currently configured graphics card can be loaded, wherein the kernel state driver can be a kernel direct rendering manager (DirectRendering Manager, DRM) driver, the kernel state driver is used in conjunction with the user state driver, the kernel state driver can be a module responsible for direct interaction with the graphics card hardware, the kernel state driver can be responsible for GPU resource allocation, and the user state driver can apply for GPU-related hardware resources through the kernel state driver. After loading, a device node is created accordingly. The device node can be represented as / dev / dri / card. In the case where there are multiple graphics cards currently configured, / dev / dri / card can be multiple, for example, it can include / dev / dri / card0, / dev / dri / card1, ... In an embodiment of the present invention, the designated device node can be a device node of the main graphics card, for example, the designated device node can be / dev / dri / card0. The kernel state driver name of / dev / dri / card0 in the device node created for the currently configured graphics card can be detected. Specifically, a preset command can be used, for example, the lsmod command to determine the kernel state driver name of / dev / dri / card0. Among them, the kernel-mode driver name of / dev / dri / card0 can represent the kernel-mode driver of the graphics card corresponding to / dev / dri / card0. It should be noted that the implementation method of determining the main graphics card in the currently configured graphics card can be set as needed, and the embodiment of the present invention does not limit this. Exemplarily, when the currently configured graphics card includes an independent graphics card, the independent graphics card can be determined as the main graphics card. When the currently configured graphics card does not include an independent graphics card, the integrated graphics card can be determined as the main graphics card.

[0049] Assuming that the detected kernel-mode driver is named gsgpu, gsgpu can be used as the target driver name. The first designated directory can be used to store a preset configuration file representing the storage directory of the user-mode driver in each display driver. The preset configuration files of the drivers provided by different graphics card manufacturers can be stored in the first designated directory for use, thereby being compatible with the drivers provided by different graphics card manufacturers. Exemplarily, the first designated directory can be represented as / usr / share / gpudriverpath / . The preset configuration file can be a conf file. For any user-mode driver, the name of the preset configuration file can include the kernel-mode driver name of the corresponding kernel-mode driver. Exemplarily, it can be named with the corresponding kernel driver name plus _path.conf. For example, if the kernel driver is gsgpu, the name can be gsgpu_path.conf. Each graphics card driver can provide at least one conf file as a preset configuration file. Accordingly, the conf file records the access path of the directory where the user-mode driver corresponding to the gsgpu kernel driver is located. For example, / usr / lib / loongarch64-linux-gnu / loongson can be recorded. In the case of multiple graphics card drivers, there may be multiple driver files with the same name in the system. These files may be placed in different directories. In an embodiment of the present invention, a preset configuration file is used to record the directory where the user-mode driver is located, so that the system can find the correct driver location.

[0050] Further, the preset configuration files under the first specified directory can be traversed to detect whether there is a preset configuration file matching the target driver name under the first specified directory. Specifically, the target driver name can be matched with the names of the preset configuration files. If the name of the preset configuration file includes the target driver name, the preset configuration file is determined as the preset configuration file matching the target driver name, and it is determined that the preset configuration file matching the target driver name is detected. Exemplarily, when it is detected that gsgpu_path.conf exists under the first specified directory, it can be determined that the preset configuration file matching the target driver name is detected. Accordingly, the graphics card indicated by the target driver name can be used as the target graphics card, and the target graphics card can be the above-mentioned main graphics card. The second driver of the target graphics card is determined as the target graphics card driver. If there is no preset configuration file including the target driver name in the name, it is determined that the preset configuration file matching the target driver name is not detected. Accordingly, the first driver of the target graphics card can be determined as the target graphics card driver. Wherein, when the first driver is an open source driver, the second driver is a closed source driver, and when the first driver is a closed source driver, the second driver is an open source driver. The closed source user state driver can be a user state driver provided by the manufacturer. In the embodiment of the present invention, the target graphics card driver can be determined by detecting the target driver name of the specified device node and matching the preset configuration file in the first specified directory based on the target driver name. In this way, the determination efficiency can be ensured to a certain extent.

[0051] Optionally, in one implementation, the first driver is an open source driver, and the second driver is a closed source driver; the above step of determining the driver storage path of the target graphics driver based on the first configuration file pre-set for the target graphics driver may specifically include: Step 1021, when the target graphics driver is a closed source driver, determining the driver storage path of the target graphics driver based on the first configuration file pre-set for the target graphics driver. Accordingly, in an embodiment of the present invention, it may also include: Step S31, when the target graphics driver is an open source driver, ending the current processing flow to control the electronic device to use the open source driver corresponding to the target graphics card.

[0052] That is to say, in the embodiment of the present invention, if the preset configuration file matching the target driver name is not detected, the current processing flow can be terminated, that is, the steps of determining the driver storage path of the target graphics card driver, generating the second configuration file and performing the configuration operation are not performed. When the preset configuration file matching the target driver name is detected, the above step 102 is entered to start execution. Since the open source driver is provided by the operating system, in the embodiment of the present invention, it is not necessary to perform the setting through step 102 and the processing steps thereafter. In this way, the electronic device can directly load the open source driver corresponding to the target graphics card by default for use, thereby saving configuration resources and not affecting the GPU driver adapted in an open source manner.

[0053] In the embodiment of the present invention, when the currently configured graphics card includes an independent graphics card, that is, when the user inserts an independent graphics card, an open source driver can be used. Accordingly, when the currently configured graphics card includes an independent graphics card, the kernel state driver of the open source driver of the main graphics card can be loaded, and accordingly, the target target driver name can be the driver name of the kernel state driver of the open source driver, and the preset configuration file including the storage path of the open source user state driver of the independent graphics card is not retained in the first specified directory. For example, the preset configuration file including the storage path of the open source user state driver of the independent graphics card in the first specified directory can be deleted before step 1012. In this way, the open source driver of the target graphics card can be determined as the target graphics card driver, and then the processing branch corresponding to step S31 is executed. When the currently configured graphics card does not include an independent graphics card, the integrated graphics card can be determined as the main graphics card and a closed source driver can be used. Accordingly, when the currently configured graphics card does not include an independent graphics card, the kernel state driver of the closed source driver of the main graphics card can be loaded, and accordingly, the target target driver name can be the driver name of the kernel state driver of the closed source driver, and the preset configuration file of the storage path of the closed source user state driver of the independent graphics card is retained in the first specified directory. In this way, the closed-source driver of the target graphics card can be determined as the target graphics card driver, and then the processing branch corresponding to step 102 is executed.

[0054] Optionally, in the embodiment of the present invention, the specified priority may be the highest priority. The step of generating a second configuration file of the specified priority for the target graphics card driver based on the driver storage path may specifically include:

[0055] Step 1031: Determine the designated configuration file as the configuration file with the highest file priority among the configuration files used by the preset configuration tool.

[0056] Step 1032: Write the driver storage path into the specified configuration file to obtain the second configuration file.

[0057] Among them, the configuration file used by the preset configuration tool can be stored in a second specified directory, and the second specified directory can be the GPU dynamic link library path configuration directory / etc / ld.so.conf.d / . The file priority of the configuration file used by the preset configuration tool can be determined by the file name number of the configuration file, where the smaller the number, the higher the file priority can be. For example, in the case where there are configuration files numbered 10, 20, and 30, the configuration file numbered 10 can be used as the designated configuration file. Exemplarily, the designated configuration file can be 10_gpu_path.conf, which is a GPU dynamic link library path configuration file. Accordingly, the driver storage path in the first configuration file can be read and written to the designated configuration file. Exemplarily, the directory path stored in gsgpu_path.conf can be read and written to 10_gpu_path.conf to obtain the second configuration file.

[0058] In an embodiment of the present invention, the configuration file with the highest file priority among the configuration files used by the preset configuration tool is determined as the designated configuration file, and then the driver storage path is written into the designated configuration file to obtain the second configuration file. Since the designated configuration file has the highest priority, the second configuration file finally obtained is the configuration file with the highest priority among the configuration files used by the preset configuration tool. In this way, it can be ensured that the second configuration file is loaded first. And by directly writing the driver storage path into the designated configuration file, the second configuration file with the highest priority can be generated. In this way, by modifying the content of the driver storage path, the priority of the driver can be dynamically changed, and the operation difficulty is relatively low.

[0059] Optionally, before writing the driver storage path into the designated configuration file to obtain the second configuration file, the method may further include: step S41, clearing the current content of the designated configuration file. Accordingly, writing the driver storage path into the designated configuration file to obtain the second configuration file may specifically include: when the designated configuration file is empty, writing the driver storage path into the designated configuration file to obtain the second configuration file.

[0060] In actual application scenarios, other drivers may have been used previously, so the designated configuration file may include the driver storage path corresponding to the target graphics driver used last time. If the driver storage path is directly written to the designated configuration file this time, it will interfere with subsequent operations and cause subsequent loading errors. Therefore, in an embodiment of the present invention, the designated configuration file may be cleared before writing. When performing a write operation, the write operation may be performed specifically when it is detected that the designated configuration file is empty. In this way, the method of rewriting the content of the designated configuration file is equivalent to remapping the specific content of the designated configuration file.

[0061] In the embodiment of the present invention, the operation of clearing the current content of the designated configuration file may be specifically performed before the above step 1013. In this way, it is possible to avoid the situation where the designated configuration file includes a previously written driver storage path, resulting in the first driver of the target graphics card being determined as the target graphics card driver, and the previous graphics card driver is still loaded for use based on the previously written driver storage path included in the designated configuration file, and the first driver corresponding to the current target graphics card is not normally loaded for use.

[0062] In the embodiment of the present invention, by clearing the designated configuration file, interference with subsequent operations caused by historical values ​​in the designated configuration file can be avoided. Accordingly, when the designated configuration file is empty, the drive storage path is written into the designated configuration file to generate a second configuration file, which can ensure the accuracy of the second configuration file to a certain extent.

[0063] Optionally, the step of performing a configuration operation according to the second configuration file based on a preset configuration tool to control the electronic device to use the target graphics card driver may specifically include:

[0064] Step 1041: The preset configuration tool loads files in descending order of priority, so as to load the second configuration file first.

[0065] Step 1042: Link the dynamic link library of the target graphics card driver based on the second configuration file for use by the electronic device.

[0066] Specifically, the target graphics card driver can be implemented based on a dynamic link library. A dynamic link library can also be called a binary link library. It should be noted that a pre-detection can be performed to ensure that the dynamic link library included in the GPU user-mode driver can run independently without relying on the dynamic link library provided by Mesa or GLVND, and that the unique dynamic link library that the dynamic link library included in the GPU user-mode driver relies on can be correctly linked to ensure that it can be used normally later.

[0067] Further, a preset configuration tool can be run, and the preset configuration tool can be used to load the configuration files for use in the second specified directory in order of file priority from high to low. Since the second configuration file has the highest priority, the second configuration file is loaded first. Further, based on the driver storage path in the loaded second configuration file, the dynamic link library of the target graphics card driver can be linked for use by the electronic device this time. In an embodiment of the present invention, ldconfig can be used as a preset configuration tool, and the above steps 1041-1042 can be implemented based on the ld mechanism. In this way, the operation of modifying the source code of the system library can be omitted, thereby reducing the difficulty of adaptation. ldconfig updates the dynamic linker so that the electronic device can correctly find and use the dynamic link library of the target graphics card driver. The file priority can determine the search order. Since the file priority of the second configuration file is the highest, the dynamic link library linked based on the second configuration file is used with the highest priority. In this way, it can be ensured that the electronic device uses the target graphics card driver this time. Exemplarily, when there are binary link libraries with the same name and symbol, for example, multiple GPU drivers provide binary link libraries for use by applications, ldconfig will prioritize linking the binary dynamic link library with the highest priority, that is, linking the dynamic link library of the target graphics driver, thereby ensuring that the electronic device uses the target graphics driver this time.

[0068] It should be noted that after completing the above-mentioned drive processing method, a subsequent startup operation may be performed to complete the system startup process. Figure 2 is a schematic diagram of a startup process provided by an embodiment of the present invention, such as Figure 2As shown, the display driver loading service can be executed first. Specifically, the kernel-mode driver name of / dev / dri / card0 can be detected first as the target driver name, such as gsgpu. Based on the target driver name, the preset configuration file in the / usr / share / gpudriverpath / directory can be detected. Specifically, the GPU driver path configuration directory / usr / share / gpudriverpath / directory shared by the traversal platform can be checked to see if there is a preset configuration file named with the target driver name, such as gsgpu_path.conf, which is provided by the GPU driver. Next, clear the 10_gpu_path.conf file under / etc / ld.so.conf.d / . That is, clear the specified configuration file. If there is a preset configuration file gsgpu_path.conf that matches the target driver name in / usr / share / gpudriverpath, then write the driver storage path of the target graphics driver in gsgpu_path.conf to the specified configuration file 10_gpu_path.conf (for example, the OpenGL dynamic link library configuration file) in the GPU dynamic link library path configuration directory, and use ldconfig to update the dynamic link library so that the electronic device can use the target graphics driver. If it does not exist, directly end the current processing flow and perform subsequent startup operations. After the display driver loading service is finished, you can start the display manager service (display-manager.service), then start Xorg, and finally load liglx.so to complete the system startup process.

[0069] Among them, during the system startup process, the startup of the display-manager.service service marks the beginning of the preparation of the user graphical interface. When starting display-manager.service, the target graphics driver can be called to initialize the graphics session. After the display manager is started, Xorg can be started to initialize the graphics display hardware. Xorg is an implementation of the X Window System, which is a commonly used graphics display server in Linux and UNIX systems. Xorg can be responsible for managing display output, processing keyboard and mouse input, and the window system of client applications. libglx.so is part of the GLX library. GLX is an extension of the Open Graphics Library (OpenGL) on the X Window System. libglx.so enables OpenGL programs to interact with the X Window System. Loading libglx.so ensures that the system can support OpenGL applications.

[0070] At present, some graphics card manufacturers implement device drivers by directly providing system-level APIs such as libGL.so. As a result, Linux's open source drivers cannot coexist with such graphics card drivers in the system. Furthermore, when operating system manufacturers produce system versions, they need to customize versions containing specific API library files for graphics card drivers of different manufacturers, resulting in reduced versatility of the operating system. In an embodiment of the present invention, the coexistence of multiple graphics card drivers can be achieved, so that operating system manufacturers do not need to customize customized versions containing specific API library files for graphics card drivers of different manufacturers, thereby improving the versatility of the operating system. Furthermore, in an embodiment of the present invention, by utilizing the existing system mechanism and ld mechanism, the coexistence of multiple graphics card drivers can be flexibly and conveniently achieved.

[0071] Reference Figure 3 , shows a block diagram of a drive processing device provided by an embodiment of the present invention, the device can be applied to electronic devices, such as Figure 3 As shown, the device may specifically include:

[0072] A first determining module 201 is used to determine a target graphics card driver to be used this time based on a graphics card currently configured in the electronic device;

[0073] A second determination module 202 is used to determine a driver storage path of the target graphics driver based on a first configuration file pre-set for the target graphics driver; the first configuration file includes the driver storage path;

[0074] A generating module 203, configured to generate a second configuration file of a specified priority for the target graphics card driver based on the driver storage path;

[0075] The configuration module 204 is used to perform a configuration operation according to the second configuration file based on a preset configuration tool to control the electronic device to use the target graphics card driver.

[0076] Optionally, the first determining module 201 is specifically configured to:

[0077] Based on the designated device node created for the currently configured graphics card, detecting the kernel state driver name of the graphics card driver as the target driver name;

[0078] Detecting a preset configuration file in a first designated directory based on the target drive name;

[0079] If no preset configuration file matching the target driver name is detected, the first driver of the target graphics card is determined as the target graphics card driver; the target graphics card is the graphics card corresponding to the target driver name;

[0080] If a preset configuration file matching the target driver name is detected, the matching preset configuration file is determined as the first configuration file, and the second driver of the target graphics card is determined as the target graphics card driver.

[0081] Optionally, the first driver is an open source driver, and the second driver is a closed source driver; the second determining module 202 is specifically configured to:

[0082] In the case where the target graphics driver is a closed-source driver, a driver storage path of the target graphics driver is determined based on a first configuration file pre-set for the target graphics driver.

[0083] The device further includes: an ending module, which is used to end the current processing flow when the target graphics card driver is an open source driver, so as to control the electronic device to use the open source driver corresponding to the target graphics card.

[0084] Optionally, the specified priority is the highest priority; the generating module 203 is specifically used for:

[0085] Determine the configuration file with the highest file priority among the configuration files used by the preset configuration tool as the designated configuration file;

[0086] The driver storage path is written into the specified configuration file to obtain the second configuration file.

[0087] Optionally, the device further includes: a clearing module, configured to clear the current content of the specified configuration file before the generating module 203 writes the drive storage path into the specified configuration file to obtain the second configuration file;

[0088] Correspondingly, the generating module 203 is further specifically configured to: when the designated configuration file is empty, write the driver storage path into the designated configuration file to obtain the second configuration file.

[0089] Optionally, the configured module 204 is specifically used for:

[0090] The preset configuration tool loads the files in descending order of priority, so as to load the second configuration file first;

[0091] The dynamic link library of the target graphics card driver is linked based on the second configuration file for use by the electronic device.

[0092] Optionally, a display driver loading service is pre-set in the electronic device, and the device further includes:

[0093] A loading module, used for loading the display driver loading service from the system services stored in the system service directory when entering the system startup link; the display driver loading service is set to be started before the display manager of the electronic device;

[0094] The startup module is used to start the display driver loading service to start the first determination module 201 to start the operation of determining the target graphics card driver to be used this time based on the graphics card currently configured in the electronic device.

[0095] In summary, the driver processing device provided in the embodiment of the present invention determines the target graphics card driver to be used this time based on the graphics card currently configured in the electronic device. Based on the first configuration file pre-set for the target graphics card driver, the driver storage path of the target graphics card driver is determined; the first configuration file includes the driver storage path. Then, a second configuration file of a specified priority is generated for the target graphics card driver based on the driver storage path. Configuration operations are performed according to the second configuration file based on the preset configuration tool to control the electronic device to use the target graphics card driver. In the embodiment of the present invention, by generating a second configuration file of a specified priority for the target graphics card driver to be used this time, and configuring it using the preset configuration tool, the electronic device is controlled to load and use the target graphics card driver to be used this time. In this way, in the case of multiple graphics card drivers, conflicts can be avoided to a certain extent, and the compatible coexistence of multiple drivers can be achieved.

[0096] Reference Figure 4 , is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, the electronic device includes: a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the drive processing method of the aforementioned embodiment.

[0097] An embodiment of the present invention provides a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the drive processing method of the aforementioned embodiment.

[0098] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0099] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0100] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.

[0101] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0102] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0103] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0104] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0105] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0106] The above is a detailed introduction to a drive processing method, a drive processing device, an electronic device and one or more machine-readable media provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a general technician in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A drive processing method, characterized in that: Applied to electronic equipment, the method comprises: Determining a target graphics card driver to be used this time based on a graphics card currently configured in the electronic device; Determining a driver storage path of the target graphics card driver based on a first configuration file pre-set for the target graphics card driver; the first configuration file includes the driver storage path; Generate a second configuration file of a specified priority for the target graphics card driver based on the driver storage path; A configuration operation is performed according to the second configuration file based on a preset configuration tool to control the electronic device to use the target graphics card driver.

2. The method according to claim 1, characterized in that The step of determining a target graphics card driver to be used this time based on a graphics card currently configured in the electronic device includes: Based on the designated device node created for the currently configured graphics card, detecting the kernel state driver name of the graphics card driver as the target driver name; Based on the target driver name, detecting a preset configuration file named with the kernel-mode driver name in the first designated directory; If no preset configuration file named with the kernel-mode driver name is detected, the first driver of the target graphics card is determined as the target graphics card driver; the target graphics card is the graphics card corresponding to the target driver name; If a preset configuration file named with the kernel-mode driver name is detected, the preset configuration file is determined as the first configuration file, and the second driver of the target graphics card is determined as the target graphics card driver.

3. The method according to claim 1, characterized in that The first driver is an open source driver, and the second driver is a closed source driver; and determining the driver storage path of the target graphics driver based on a first configuration file pre-set for the target graphics driver includes: In the case where the target graphics driver is a closed-source driver, determining a driver storage path of the target graphics driver based on a first configuration file pre-set for the target graphics driver; The method further includes: when the target graphics card driver is an open source driver, ending the current processing flow to control the electronic device to use the open source driver corresponding to the target graphics card.

4. The method according to claim 1, characterized in that The specified priority is the highest priority; The step of generating a second configuration file of a specified priority for the target graphics card driver based on the driver storage path includes: Determine the configuration file with the highest file priority among the configuration files used by the preset configuration tool as the designated configuration file; The driver storage path is written into the specified configuration file to obtain the second configuration file.

5. The method according to claim 4, characterized in that Before writing the drive storage path into the designated configuration file to obtain the second configuration file, the method further includes: clearing the current content of the designated configuration file; Correspondingly, the step of writing the driver storage path into the designated configuration file to obtain the second configuration file includes: when the designated configuration file is empty, writing the driver storage path into the designated configuration file to obtain the second configuration file.

6. The method according to claim 4, characterized in that The performing a configuration operation based on a preset configuration tool according to the second configuration file to control the electronic device to use the target graphics card driver includes: The preset configuration tool loads the files in descending order of priority, so as to load the second configuration file first; The dynamic link library of the target graphics card driver is linked based on the second configuration file for use by the electronic device.

7. The method according to any one of claims 1 to 6, characterized in that: The electronic device is pre-set with a display driver loading service, and the method further includes: In the case of entering the system startup phase, loading the display driver loading service from the system services stored in the system service directory; the display driver loading service is configured to be started before the display manager of the electronic device; The display driver loading service is started to execute the driver processing method.

8. A drive processing device, characterized in that: Applied to electronic equipment, the device comprises: A first determination module, configured to determine a target graphics card driver to be used this time based on a graphics card currently configured in the electronic device; A second determination module is used to determine a driver storage path of the target graphics driver based on a first configuration file pre-set for the target graphics driver; the first configuration file includes the driver storage path; A generating module, configured to generate a second configuration file of a specified priority for the target graphics card driver based on the driver storage path; A configuration module is used to perform configuration operations according to the second configuration file based on a preset configuration tool to control the electronic device to use the target graphics card driver.

9. An electronic device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store executable instructions, and the executable instructions enable the processor to execute the method according to any one of claims 1 to 7.

10. One or more machine-readable media, characterized in that Instructions are stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 7.