Parameter adjustment method, device and system

By creating a parameter tuning message on the host side and adjusting GPU parameters using the target interrupt register, the problems of error-prone and high cost in GPU parameter tuning in the prior art are solved, and efficient and low-cost parameter tuning is achieved.

CN119902806BActive Publication Date: 2026-01-09MOORE THREADS TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411975960.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2026-01-09
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

Existing technologies for adjusting GPU operating parameters are prone to errors, have high development and maintenance costs, and cannot be directly adjusted on the host side due to security policy restrictions.

Method used

By creating a parameter tuning message on the host side and writing it to the shared memory of the target device, and using the target interrupt register to send an interrupt signal to the system management module, the GPU parameters can be adjusted, reducing the dependence on the host kernel driver.

Benefits of technology

This minimizes the dependency of the host kernel driver on the parameter tuning process, improves the debuggability of the program code, reduces development and maintenance costs, and increases development speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902806B_ABST
    Figure CN119902806B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a parameter adjustment method, device and system. The method comprises: if a host detects a parameter adjustment operation for a target device, creating a parameter adjustment message for at least one running parameter of the target device according to the parameter adjustment operation, the parameter adjustment operation comprising an input operation and / or an adjustment operation for the running parameter; writing the parameter adjustment message into a shared memory in the target device; writing a setting value into a target interrupt register of the target device, so that the target device sends an interrupt signal to a system management module of the target device when detecting that the target interrupt register is written with the setting value, and the system management module acquires the parameter adjustment message from the shared memory in response to the interrupt signal and performs parameter adjustment for the target device based on the parameter adjustment message. The entire parameter adjustment process minimizes the dependence on the kernel driver of the host, achieves high debugability of the program code for parameter adjustment, low development and maintenance costs, and also improves the development speed of the program code.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a parameter adjustment method, device and system. BACKGROUND

[0002] A graphics processing unit (GPU) is a microprocessor specially used for image and graphics related operation on personal computers, workstations, game consoles and some mobile devices (such as tablet computers, smart phones, etc.). The acquisition and adjustment of a large number of running parameters of the GPU is a complex and delicate operation process. However, due to the security policy of the GPU, in order to avoid malicious or unintentional non-safe operation, the GPU cannot be directly adjusted on the host side. In the related art, the way of adjusting the running parameters of the GPU has the problems of being easy to make mistakes, high development and maintenance costs, etc. SUMMARY

[0003] Therefore, the present disclosure provides a parameter adjustment method, device and system.

[0004] According to an aspect of the present disclosure, a parameter adjustment method applied to a host is provided, and the method comprises the following steps.

[0005] In a case where a parameter adjustment operation for a target device is detected, a parameter adjustment message is created according to the parameter adjustment operation, and the parameter adjustment message comprises at least one running parameter for the target device, and the parameter adjustment operation comprises an input operation and / or an adjustment operation for the running parameter.

[0006] The parameter adjustment message is written into a shared memory in the target device.

[0007] A setting value is written into a target interrupt register of the target device, so that the target device sends an interrupt signal to a system management module of the target device in a case where the target interrupt register is written with the setting value, so that the system management module acquires the parameter adjustment message from the shared memory in response to the interrupt signal, and performs parameter adjustment for the target device based on the parameter adjustment message.

[0008] In a possible implementation manner, the method further comprises the following steps.

[0009] Device files of PCIE devices connected to the host are acquired.

[0010] Memory mapping is performed according to file handles corresponding to the device files of the PCIE devices, so as to map storage spaces of the PCIE devices to corresponding virtual address spaces.

[0011] The PCIE devices include at least one GPU, the storage space of each GPU includes at least one BAR space, the target device is one or more of the at least one GPU, and the shared memory is located in a BAR space of a GPU serving as the target device.

[0012] In a possible implementation, the method further includes:

[0013] obtaining address information of the storage space of each PCIE device connected to the host;

[0014] creating a device file of each PCIE device according to the address information of the storage space of each PCIE device.

[0015] In a possible implementation, the parameter adjustment message includes an IPC message.

[0016] According to another aspect of the present disclosure, a parameter adjustment apparatus is provided, which is applied to a host and includes a parameter adjustment module configured to:

[0017] In a case where a parameter adjustment operation for a target device is detected, a parameter adjustment message is created according to the parameter adjustment operation, the parameter adjustment message including at least one running parameter for the target device, and the parameter adjustment operation including an input operation and / or an adjustment operation for the running parameter;

[0018] writing the parameter adjustment message into a shared memory in the target device;

[0019] writing a setting value into a target interrupt register of the target device, so that the target device sends an interrupt signal to a system management module of the target device in a case where the target interrupt register is written with the setting value, so that the system management module acquires the parameter adjustment message from the shared memory in response to the interrupt signal and performs parameter adjustment for the target device based on the parameter adjustment message.

[0020] In a possible implementation, the parameter adjustment module is further configured to obtain device files of each PCIE device connected to the host, and to perform memory mapping according to file handles corresponding to the device files of each PCIE device, so as to map the storage space of each PCIE device to a corresponding virtual address space.

[0021] The PCIE devices include at least one GPU, the storage space of each GPU includes at least one BAR space, the target device is one or more of the at least one GPU, and the shared memory is located in a BAR space of a GPU serving as the target device.

[0022] In a possible implementation, the apparatus further comprises a PCIE driver,

[0023] The PCIE driver is configured to acquire address information of a storage space of each PCIE device connected to the host, and create a device file of each PCIE device according to the address information of the storage space of each PCIE device.

[0024] In a possible implementation, the parameter adjustment message comprises an IPC message.

[0025] According to another aspect of the present disclosure, a parameter adjustment method applied to a device is provided, and the method comprises:

[0026] In the case of a received interrupt signal, a parameter adjustment message is read from a shared memory of the device;

[0027] Based on at least one parameter in the parameter adjustment message, a parameter adjustment is performed on the device;

[0028] The parameter adjustment message is written into the shared memory by a host controlling the device.

[0029] In a possible implementation, the method further comprises:

[0030] The target interrupt register in the device is monitored, and in the case of detecting that the target interrupt register is written with a set value, the interrupt signal is generated.

[0031] In a possible implementation, the device is one or more of PCIE devices connected to the host.

[0032] The PCIE device comprises at least one GPU, the storage space of each GPU comprises at least one BAR space, and in the case of the device being one or more of the at least one GPU, the shared memory is located in one BAR space of the GPU.

[0033] In a possible implementation, the parameter adjustment message comprises an IPC message.

[0034] According to another aspect of the present disclosure, a parameter adjustment apparatus applied to a device is provided, and the apparatus comprises a system management module, a shared memory and a target interrupt register.

[0035] The system management module is configured to, in the case of a received interrupt signal, read a parameter adjustment message from the shared memory, and based on at least one running parameter in the parameter adjustment message, perform a parameter adjustment on the target device.

[0036] The parameter adjustment message is written into the shared memory by a host that controls the device.

[0037] In a possible implementation, the apparatus further includes:

[0038] a monitoring module configured to monitor the target interrupt register and send an interrupt signal to a system management module of the device if it is detected that the target interrupt register is written with a set value.

[0039] In a possible implementation, the device is one or more of PCIE devices connected to the host.

[0040] The PCIE device includes at least one GPU, and the storage space of each GPU includes at least one BAR space. If the device is one or more of the at least one GPU, the shared memory is located in a BAR space of the GPU.

[0041] In a possible implementation, the parameter adjustment message includes an IPC message.

[0042] According to another aspect of the present disclosure, there is provided a running parameter adjustment system including a parameter adjustment module, a system management module, a shared memory and a target interrupt register, the parameter adjustment module being applied to a host, the system management module, the shared memory and the target interrupt register being applied to a target device,

[0043] The parameter adjustment module is configured to create a parameter adjustment message according to a parameter adjustment operation for the target device if the parameter adjustment operation is detected, and write the parameter adjustment message into a shared memory in the target device. Then, a set value is written into a target interrupt register of the target device, so that the target device sends an interrupt signal to a system management module of the target device if it is detected that the target interrupt register is written with the set value. The parameter adjustment message includes at least one running parameter for the target device. The parameter adjustment operation includes an input operation and / or an adjustment operation for the running parameter.

[0044] The system management module is configured to read the parameter adjustment message from the shared memory if the received interrupt signal is detected, and perform a parameter adjustment for the target device based on at least one parameter in the parameter adjustment message.

[0045] According to another aspect of the present disclosure, there is provided a running parameter adjustment apparatus including a processor and a memory for storing processor-executable instructions. The processor is configured to implement the above method when executing the instructions stored in the memory.

[0046] According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method described above.

[0047] According to another aspect of the present disclosure, there is provided a computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, the processor in the electronic device performs the method described above.

[0048] The parameter adjustment method, device and system provided by the embodiments of the present disclosure minimize the dependence of the entire parameter adjustment process on the kernel driver of the host, achieve high debugability of the program code for parameter adjustment, low development and maintenance cost, and can also improve the development speed of the program code.

[0049] Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0050] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present disclosure and serve to explain the principles of the present disclosure.

[0051] Figure 1 A schematic diagram of running parameter adjustment in the related art is shown.

[0052] Figure 2 A block diagram of a parameter adjustment device according to an embodiment of the present disclosure is shown.

[0053] Figure 3 A block diagram of a running parameter adjustment system according to an embodiment of the present disclosure is shown.

[0054] Figure 4 A schematic diagram of running parameter adjustment according to an embodiment of the present disclosure is shown.

[0055] Figure 5 A flowchart of a running parameter adjustment system method according to an embodiment of the present disclosure is shown.

[0056] Figure 6 A flowchart of a running parameter adjustment system method according to an embodiment of the present disclosure is shown.

[0057] Figure 7 A block diagram of a device 1900 for running parameter adjustment according to an exemplary embodiment is shown. DETAILED DESCRIPTION

[0058] Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in different drawings represent the same or similar elements. Although various aspects of embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless specifically noted.

[0059] The term "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any implementation described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other implementations.

[0060] In addition, for the purpose of convenience and brevity, detailed descriptions of well-known functions and structures incorporated in the disclosure will be omitted. It will be appreciated that those skilled in the art will be able to devise various modes of implementing the disclosure without the benefits of these particulars. In some instances, well-known methods, structures, materials, and techniques have not been described in detail in order to avoid obscuring the point of the disclosure.

[0061] In the related art, the adjustment of the running parameters of the GPU is implemented by using the host, and the adjustment process is as shown in Figure 1 The parameter adjustment tool of the application layer running in the host initiates a parameter adjustment request to the host through an ioctl (I / O Control) system interface (which is an interface for communication between a device driver and a user space program in an operating system). The kernel driver of the host assembles an IPC (Inner-Process Communication) message after receiving the parameter adjustment request and initiates IPC communication to the GPU. The system management module (SMU) on the GPU adjusts the components and modules in the GPU according to the running parameters in the received IPC message. However, the method in the related art has the following problems. Figure 1 The method in the related art needs the kernel driver of the host to implement the parameter adjustment process, and the program code for parameter adjustment runs in the kernel driver, which limits the entire parameter adjustment process to the kernel driver. The abnormality of the kernel driver code will cause the entire device to be dead or hung, and the parameter adjustment cannot be performed. Moreover, the code runs in the kernel driver, which is very inconvenient for debugging and has a high cost.

[0062] To solve the above problems, the embodiments of the present disclosure provide a parameter adjustment method, device, and system, which minimize the dependence of the entire parameter adjustment process on the kernel driver of the host, have high debugability of the program code for parameter adjustment, low development and maintenance cost, and can improve the development speed of the program code.

[0063] The embodiments of the present disclosure provide a running parameter adjustment system, which includes parameter adjustment devices respectively applied to a host 100 and devices 200 (the devices 200 include target devices whose running parameters need to be adjusted). As shown in Figure 2As shown, the parameter adjustment device in the host 100 comprises a parameter adjustment module 11. The parameter adjustment device in the device 200 comprises a shared memory 21, a target interrupt register 22 and a system management module 23.

[0064] The parameter adjustment module 11 is configured to, in the case of detecting a parameter adjustment operation for a target device, create a parameter adjustment message according to the parameter adjustment operation, and write the parameter adjustment message into the shared memory 21 in the target device; and then write a setting value into the target interrupt register 22 of the target device, so that the target device sends an interrupt signal to the system management module 23 in the case of detecting that the target interrupt register 22 is written with the setting value, and the parameter adjustment message comprises at least one running parameter for the target device. The parameter adjustment operation comprises an input operation and / or an adjustment operation for a running parameter.

[0065] The system management module 23 is configured to, in the case of receiving an interrupt signal, read a parameter adjustment message from the shared memory 21; and perform parameter adjustment for the target device based on at least one parameter in the parameter adjustment message.

[0066] In this embodiment, the parameter adjustment module 11 can be set as a parameter adjustment tool, which is in the form of a software program and runs in the host 100 in an application layer, and can provide an interface for a user to input and / or adjust a running parameter and select a target device, and the parameter adjustment tool generates a parameter adjustment operation for a target device based on a detected input operation and / or adjustment operation for the interface. Since the parameter adjustment tool runs in the host 100 but not in the kernel driver of the host 100, a developer can adjust the code of the parameter adjustment tool as needed, and the debugging of the parameter adjustment tool is very convenient, so that the development and maintenance cost of the parameter adjustment tool is reduced, and the development and maintenance cost of the device subordinate to the host such as a GPU is also reduced. Moreover, since the parameter adjustment tool runs in the host 100 but not in the kernel driver of the host 100, the parameter adjustment message is directly written into the shared memory in the parameter adjustment process without passing through the kernel driver, so that the entire parameter adjustment process is no longer limited by the kernel driver, and the dependence of the parameter adjustment on the kernel driver of the host is minimized.

[0067] In this embodiment, after obtaining the parameter tuning message, the system management module 23 parses the parameter tuning message according to the preset data structure definition of the parameter tuning message to obtain the specific operating parameters. Then, based on the specific parameter adjustment conditions targeted by the operating parameters, it initiates parameter tuning actions on the target device's graphics card, etc., so that the graphics card can tune the corresponding modules and devices in the target device based on the operating parameters in the parameter tuning message. The data structure definition of the parameter tuning message can be pre-set, indicating the specific meaning of parameters at different positions in the entire parameter tuning message, and / or the specific meaning indicated by parameters with different identifiers, simplifying the parameter tuning message parsing process.

[0068] In this embodiment, since the parameter tuning module 11 needs to write the parameter tuning message into the shared memory of the target device, the parameter tuning module 11 needs to obtain the access capability of the shared memory of each device 200 in advance. The following describes how the device implements this capability.

[0069] like Figure 3 As shown, the parameter adjustment device in host 100 also includes a PCIe driver (PCI Express driver, also known as a PCIe driver) 12. Device 200 is a PCIe device, meaning that device 200 and host 100 transmit data based on the PCIe (Peripheral Component Interconnect-Epress) protocol. The PCIe driver 12 is used to obtain the address information of the storage space of each PCIe device connected to host 100 before the parameter adjustment module 11 initializes and performs parameter adjustment; and to create a device file (File Handle) for each PCIe device based on the address information of its storage space. The PCIe device includes at least one GPU, and the storage space of each GPU includes at least one BAR (Base Address Register) space. The GPU's address information can be the starting address and length of the BAR space. The target device is one or more of the at least one GPU, and the shared memory 21 is located in one BAR space of the GPU that is the target device.

[0070] Then, after the PCIE driver 12 creates the device files of the PCIE devices, the tuning module 11 can obtain the device files of the PCIE devices connected to the host 100, and perform memory mapping (mmap) on the file handles corresponding to the device files of the PCIE devices to map the storage spaces of the PCIE devices to the corresponding virtual address spaces. Taking the PICE devices as GPUs as an example, after the PCIE driver 12 creates the device files based on the address information of the BAR spaces of the GPUs, the tuning tool (i.e., the tuning module 11) can open the device files of the GPUs when initializing, and then map each BAR space of each GPU to the process space of the tuning tool based on the mmap method, so as to obtain the ability to access the BAR spaces of the GPUs.

[0071] In some embodiments, when the PCIE driver 12 detects that the PCIE devices connected to the host 100 change, the PCIE driver 12 can update the device files according to the change, such as deleting the device files of the PCIE devices that no longer exist, creating the device files of the newly added PCIE devices, updating the device files of the PCIE devices according to the change in the address information of the storage spaces of the PCIE devices, and the like. Moreover, after determining that the update of the device files is completed, the PCIE driver 12 can notify the tuning module 11 of the update, so that the tuning module 11 can update the memory mapping of the device files based on the update of the device files, to ensure that the tuning is performed accurately.

[0072] In some embodiments, when the device 200 is a GPU, the target interrupt register 22 can be arranged in a BAR space of the device 200. The shared memory 21 and the target interrupt register in the same device 200 can be arranged in the same BAR space or different BAR spaces, which is not limited in the present disclosure.

[0073] In the present embodiment, in order to ensure the smooth tuning, after the tuning module 11 writes the tuning message into the shared memory of the target device, the tuning module 11 also needs to notify the system management module 23 of the target device that the tuning needs to be performed. In one possible implementation, as shown in FIG. 8, the parameter adjustment apparatus in the device 200 further includes a monitoring module 24. After the tuning module 11 writes the tuning message into the shared memory of the target device, the tuning module 11 can write a setting value into the target interrupt register 22 of the target device. So that the monitoring module 24 in the target device sends an interrupt signal to the system management module 23 of the target device when detecting that the target interrupt register 22 is written with the setting value. In this way, the system management module 23 can be simply, directly and accurately notified to perform the running parameter adjustment of the target device. Figure 3 the tuning module 11 writes the tuning message into the shared memory of the target device, the tuning module 11 can write a setting value into the target interrupt register 22 of the target device. So that the monitoring module 24 in the target device sends an interrupt signal to the system management module 23 of the target device when detecting that the target interrupt register 22 is written with the setting value. In this way, the system management module 23 can be simply, directly and accurately notified to perform the running parameter adjustment of the target device.

[0074] In this embodiment, the monitoring module 24 can be implemented by hardware and / or software in each device 200, and this disclosure does not limit it.

[0075] In some embodiments, the parameter tuning message can be an IPC message. That is, the parameter tuning message can be a message based on IPC communication. The operating parameters carried in the parameter tuning message correspond to the target device. Different target devices may have different types of operating parameters, etc., and this disclosure does not impose any restrictions on this.

[0076] For example, such as Figure 4 As shown, suppose a user needs to adjust the frequency of a GPU from 1.5GHz to 1.1GHz. The parameter tuning tool (i.e., the parameter tuning module 11) can create an IPC message based on the detected latest frequency "1.1GHz" input by the user and the selected target GPU (i.e., the target device), and send this IPC message, which carries at least the operating parameter "1.1GHz", to the shared memory 21 of each target GPU. Then, it writes the setting value to the target interrupt register 22 of each target GPU. For each GPU, the monitoring module 24 continuously monitors the target interrupt register 22, and when it detects that the target interrupt register 22 has been written with the setting value, it sends an interrupt signal to the system management module 23 of the device. After receiving the interrupt signal, the system management module 23 reads the IPC message from the shared memory 21, and then adjusts its own frequency from the original 1.5GHz to 1.1GHz indicated by the IPC message.

[0077] like Figure 5 As shown in the embodiments of this disclosure, a parameter adjustment method is also provided, which is applied to the host 100 described above. The method includes:

[0078] Step S401: If a parameter adjustment operation for the target device is detected, a parameter adjustment message is created according to the parameter adjustment operation. The parameter adjustment message includes at least one operating parameter for the target device. The parameter adjustment operation includes an input operation and / or an adjustment operation for the operating parameter.

[0079] Step S401: Write the parameter tuning message into the shared memory within the target device;

[0080] Step S401, write a set value into a target interrupt register of the target device, so that the target device sends an interrupt signal to a system management module of the target device in a case where the target interrupt register is written with the set value, so that the system management module acquires the parameter adjustment message from the shared memory in response to the interrupt signal, and performs parameter adjustment for the target device based on the parameter adjustment message.

[0081] In a possible implementation, the method can further include:

[0082] Obtaining device files of each PCIE device connected to the host; and performing memory mapping according to a file handle corresponding to each device file of each PCIE device, to map a storage space of each PCIE device to a corresponding virtual address space.

[0083] The PCIE device includes at least one GPU, the storage space of each GPU includes at least one BAR space, the target device is one or more of the at least one GPU, and the shared memory is located in a BAR space of a GPU serving as the target device.

[0084] In a possible implementation, the method can further include: controlling a PCIE driver of the host to obtain address information of a storage space of each PCIE device connected to the host; and creating a device file of each PCIE device according to the address information of the storage space of each PCIE device.

[0085] In a possible implementation, the parameter adjustment message includes an IPC message.

[0086] As Figure 6 shown, the embodiments of the present disclosure further provide a parameter adjustment method, which is applied to the device 200, and the method includes:

[0087] Step S501, in a case where an interrupt signal is received, read a parameter adjustment message from a shared memory of the device;

[0088] Step S501, based on at least one parameter in the parameter adjustment message, perform parameter adjustment for the device;

[0089] The parameter adjustment message is written into the shared memory by a host controlling the device.

[0090] In a possible implementation, the device is one or more of PCIE devices connected to the host.

[0091] The PCIE device includes at least one GPU, the storage space of each GPU includes at least one BAR space, and the shared memory is located in one BAR space of one or more GPUs in the at least one GPU.

[0092] In a possible implementation, the method further includes:

[0093] Monitoring a target interrupt register in the device, and sending an interrupt signal to a system management module of the device when detecting that the target interrupt register is written with a set value.

[0094] In a possible implementation, the parameter adjustment message includes an IPC message.

[0095] In some embodiments, the apparatus and system provided by the embodiments of the present disclosure have functions or include modules that can be used to perform the methods described in the above method embodiments. The specific implementation, advantages of the methods, apparatuses and systems can be mutually referred to. For brevity, they will not be described here.

[0096] It should be noted that although the above embodiments are introduced as examples, the parameter adjustment method, apparatus and system are not limited to the above. Those skilled in the art can understand that the user can flexibly set each module and step according to personal preferences and / or actual application scenarios, as long as the technical solutions of the present disclosure are met.

[0097] The embodiments of the present disclosure also propose a computer readable storage medium having computer program instructions stored thereon, the computer program instructions being executed by a processor to implement the above method. The computer readable storage medium can be a volatile or non-volatile computer readable storage medium.

[0098] The embodiments of the present disclosure also propose a parameter adjustment apparatus, including a processor, a memory for storing processor executable instructions, and wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0099] The embodiments of the present disclosure also provide a computer program product, including computer readable code or a non-volatile computer readable storage medium carrying computer readable code, when the computer readable code is run in the processor of an electronic device, the processor in the electronic device executes the above method.

[0100] Figure 7 is a block diagram of an apparatus 1900 for running parameter adjustment according to an exemplary embodiment. For example, the apparatus 1900 can be provided as a server or a terminal device. For details, refer to Figure 7The apparatus 1900 includes a processing assembly 1922, which is further comprised of one or more processors, and memory resources represented by the memory 1932 for storing instructions, such as an application program, executable by the processing assembly 1922. The application program stored in the memory 1932 can include one or more than one module each corresponding to a set of instructions. Further, the processing assembly 1922 is configured to execute the instructions to perform the above-described methods.

[0101] The apparatus 1900 can further include a power supply assembly 1926 configured to perform power management of the apparatus 1900, a wired or wireless network interface 1950 configured to connect the apparatus 1900 to a network, and an input output interface 1958 (I / O interface). The apparatus 1900 can operate based on an operating system stored in the memory 1932, such as Windows Server TM , MacOS X TM , Unix TM , Linux TM , FreeBSD TM or the like.

[0102] In exemplary embodiments, there is also provided a non-transitory computer readable storage medium, such as the memory 1932 including computer program instructions executable by the processing assembly 1922 of the apparatus 1900 to perform the above-described methods.

[0103] The present disclosure can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present disclosure.

[0104] Computer readable storage media can be tangible storage media which can retain and store instructions for use by an instruction execution device. Computer readable storage media can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer readable storage media include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched-tape, a

[0105] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0106] Computer readable program instructions for carrying out operations of the present disclosure can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state setting data, or source or object code, in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0107] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0108] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, 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 means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or nonvolatile memory, or a suitable combination of the different types of computer readable storage media. The computer readable storage medium can also be a computer readable storage medium encoded in a machine-readable or used language that includes any type of markers that the computer can read (including any type of codes, electrical, optical or other signals) that specify instructions that the computer can follow or reference.

[0109] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0110] The flow diagrams and the block diagrams in the drawings are presented to illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logic functions. In some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and

[0111] Embodiments of the present disclosure have been described above, and the description is intended to be illustrative of the embodiments and not restrictive. Many modifications and variations of the described embodiments are possible and are within the scope of the disclosure. The selection of terms is intended to best describe the principles of the embodiments, practical application, or technical improvements in the art, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A parameter adjustment method, characterized in that, Applied to a host, the method includes: Upon detecting a parameter adjustment operation for a target device, a parameter adjustment message is created based on the parameter adjustment operation. The parameter adjustment message includes at least one operating parameter for the target device, and the parameter adjustment operation includes an input operation and / or an adjustment operation for the operating parameter. Write the parameter tuning message into the shared memory within the target device; A set value is written into the target interrupt register of the target device, so that when the target device detects that the set value has been written into the target interrupt register, it sends an interrupt signal to the system management module of the target device, so that the system management module responds to the interrupt signal, retrieves the parameter tuning message from the shared memory, and performs parameter adjustment for the target device based on the parameter tuning message; The host is connected to a PCIe device, the PCIe device includes at least one GPU, and the target device is one or more of the at least one GPU.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the device files for each PCIe device connected to the host; Memory mapping is performed based on the file handles corresponding to the device files of each PCIe device, mapping the storage space of each PCIe device to the corresponding virtual address space. The storage space of each GPU includes at least one BAR space, and the shared memory is located in one BAR space of the GPU that is the target device.

3. The method according to claim 2, characterized in that, The method further includes: Obtain the address information of the storage space of each PCIe device connected to the host; Based on the address information of the storage space of each PCIe device, a device file is created for each PCIe device.

4. The method according to claim 1, characterized in that, Parameter tuning messages include IPC messages.

5. A device for adjusting operating parameters, characterized in that, Applied to a host computer, the device includes: a parameter tuning module, used for: Upon detecting a parameter adjustment operation for a target device, a parameter adjustment message is created based on the parameter adjustment operation. The parameter adjustment message includes at least one operating parameter for the target device, and the parameter adjustment operation includes an input operation and / or an adjustment operation for the operating parameter. Write the parameter tuning message into the shared memory within the target device; A set value is written into the target interrupt register of the target device, so that when the target device detects that the set value has been written into the target interrupt register, it sends an interrupt signal to the system management module of the target device, so that the system management module responds to the interrupt signal, retrieves the parameter tuning message from the shared memory, and performs parameter adjustment for the target device based on the parameter tuning message; The host is connected to a PCIe device, the PCIe device includes at least one GPU, and the target device is one or more of the at least one GPU.

6. The apparatus according to claim 5, characterized in that, The parameter tuning module is also used to obtain the device files of each PCIe device connected to the host; and to perform memory mapping according to the file handles corresponding to the device files of each PCIe device, mapping the storage space of each PCIe device to the corresponding virtual address space. The storage space of each GPU includes at least one BAR space, and the shared memory is located in one BAR space of the GPU that is the target device.

7. The apparatus according to claim 6, characterized in that, The device also includes a PCIe driver. The PCIe driver is used to obtain the address information of the storage space of each PCIe device connected to the host; and to create a device file for each PCIe device based on the address information of the storage space of each PCIe device.

8. The apparatus according to claim 5, characterized in that, Parameter tuning messages include IPC messages.

9. A parameter adjustment method, characterized in that, Applied to a device, the method includes: Upon receiving an interrupt signal, the parameter tuning message is read from the shared memory of the device; Based on at least one parameter in the parameter adjustment message, parameter adjustments are made for the device; The parameter tuning message is written by the host of the device into the shared memory. The host is connected to a PCIe device, which includes at least one GPU. The device is one or more of the at least one GPU. The method further includes: The target interrupt register within the device is monitored, and an interrupt signal is generated when a set value is detected being written to the target interrupt register.

10. A parameter adjustment device, characterized in that, Applied to a device, the apparatus includes: a system management module, shared memory, and a target interrupt register; The system management module is configured to read a parameter tuning message from the shared memory in the event of an interrupt signal, and to adjust the parameters of the device based on at least one operating parameter in the parameter tuning message. The parameter tuning message is written by the host of the device into the shared memory. The host is connected to a PCIe device, which includes at least one GPU. The device is one or more of the at least one GPU. The device further includes: The monitoring module is used to monitor the target interrupt register and send an interrupt signal to the system management module of the device when it detects that a set value has been written to the target interrupt register.

11. A system for adjusting operating parameters, characterized in that, It includes a parameter tuning module, a system management module, shared memory, and a target interrupt register. The parameter tuning module is used by the host, while the system management module, shared memory, and target interrupt register are used by the target device. The parameter tuning module is configured to, upon detecting a parameter adjustment operation for the target device, create a parameter tuning message based on the parameter adjustment operation and write the parameter tuning message into the shared memory within the target device; then, write a set value into the target interrupt register of the target device, so that when the target interrupt register is detected to have the set value written to it, the target device sends an interrupt signal to the system management module of the target device. The parameter tuning message includes at least one operating parameter for the target device, and the parameter adjustment operation includes an input operation and / or an adjustment operation for the operating parameter. The system management module is configured to read a parameter tuning message from the shared memory in the event of an interrupt signal, and to adjust the parameters of the target device based on at least one parameter in the parameter tuning message. The host is connected to a PCIe device, the PCIe device includes at least one GPU, and the target device is one or more of the at least one GPU.

12. A parameter adjustment device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to, when executing instructions stored in the memory, implement the method of any one of claims 1 to 4, or implement the method of claim 9.

13. A non-volatile computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method of any one of claims 1 to 4, or the method of claim 9.

Citation Information

Patent Citations

  • Virtual machine memory sharing method and system and computer equipment

    CN119179551A