Video memory allocation device, computer equipment, computer readable storage medium and computer program product
By considering the access distance between the memory address range and the GPU core in the GPU chip when allocating memory, the performance difference problem under the multi-Die design is solved, the system performance is improved and the impact on other virtual machines is reduced.
Patent Information
- Application Number
- CN202511935630.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-31
AI Technical Summary
In multi-die GPU chips, there are performance differences in the path from the GPU computing core to the memory chip on different dies, resulting in poor performance in virtualization scenarios and affecting the operation of other virtual machines.
When allocating video memory to a virtual GPU, the access distance between the video memory address range and the GPU core should be considered. The video memory address range that meets the distance condition should be allocated as much as possible to optimize performance and reduce the impact on other virtual machines.
It improved system performance, reduced the impact on other virtual machines, and achieved more efficient video memory allocation.
Smart Images

Figure CN121767159A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and more particularly to a video memory allocation device, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] A graphics processing unit (GPU), also known as a graphics processor, display core, visual processor, or display chip, is a microprocessor specifically designed to perform image and graphics-related calculations on personal computers, workstations, game consoles, and some mobile devices (such as tablets and smartphones).
[0003] GPUs reduce the reliance of graphics cards on CPUs (Central Processing Units) and perform some of the tasks that were originally handled by the CPU, especially in 3D graphics processing. The core technologies used by GPUs include hardware T&L (geometry transformation and lighting processing), cubic environment material mapping and vertex blending, texture compression and bump mapping, dual-texture four-pixel 256-bit rendering engines, and more.
[0004] As chip performance requirements continue to rise, and chip design and manufacturing capabilities continue to improve, the traditional method of enhancing performance on a single chip by shrinking the process is gradually approaching its limits. Furthermore, when the chip area becomes too large, the yield rate during manufacturing decreases, leading to increased manufacturing costs. Therefore, Multi-Die technology has emerged. This technology breaks down a large chip design into multiple smaller dies, each of which communicates with and collaborates with the others.
[0005] It should be noted that the above introduction to the technical background is only for the purpose of providing a clear and complete explanation of the technical solutions of this application and facilitating understanding by those skilled in the art. It should not be assumed that these technical solutions are known to those skilled in the art simply because they have been described in the background section of this application. Summary of the Invention
[0006] The inventors discovered that in GPU chips, video memory is composed of multiple memory chips. In a multi-die design, the pathways from the GPU computing cores (GPU cores, GPU processors, or GPUs) on different dies to the memory chips differ, resulting in performance variations. In virtualization scenarios, prolonged use of longer pathways not only prevents optimal performance but also negatively impacts the operation of other virtual machines.
[0007] To address the aforementioned technical problems, embodiments of this application provide a video memory allocation device, a computer device, a computer-readable storage medium, and a computer program product. When the host allocates video memory for a virtual GPU (vGPU), in addition to considering whether the video memory is free, it also considers the access distance (also known as the path) between the video memory address segment and the GPU core, allocating video memory address segments whose access distance from the GPU core meets the distance condition as much as possible. Thus, the aforementioned technical problems are solved, system performance is improved, and the impact on other virtual machines is reduced.
[0008] According to one aspect of the embodiments of this application, a video memory allocation method is provided, applied to a host computer, the method comprising:
[0009] The host obtains the access distance between the video memory address range and the graphics processing unit (GPU) core;
[0010] The host allocates a video memory address range to the virtual GPU (vGPU) based on the access distance, provided that the access distance between the virtual GPU and the GPU core meets the distance condition.
[0011] According to another aspect of the embodiments of this application, a video memory allocation method is provided, applied to a virtual machine, the method comprising:
[0012] The virtual machine obtains the access distance between the video memory address range allocated by the host for the vGPU and the GPU core allocated for the vGPU.
[0013] The virtual machine allocates video memory resources to the applications within it based on the access distance.
[0014] According to another aspect of the embodiments of this application, a video memory allocation method is provided, applied to a GPU, the method comprising:
[0015] The GPU reports the access distance between the video memory address range and the GPU core to the host, so that the host can allocate a video memory address range to the virtual GPU (vGPU) based on the access distance, provided that the access distance between the vGPU and the GPU core meets the distance requirement.
[0016] According to one aspect of the embodiments of this application, a video memory allocation device is provided, applied to a host computer, the device comprising:
[0017] The first acquisition unit acquires the access distance between the video memory address segment and the graphics processing unit (GPU) core;
[0018] The first allocation unit allocates a video memory address segment to the virtual GPU (vGPU) based on the access distance, provided that the access distance between the vGPU and the GPU core meets the distance condition.
[0019] According to another aspect of the embodiments of this application, a video memory allocation device is provided, applied to a virtual machine, the device comprising:
[0020] The second acquisition unit acquires the access distance between the video memory address segment allocated by the host for the vGPU and the GPU core allocated for the vGPU.
[0021] The second allocation unit allocates video memory resources to applications in the virtual machine based on the access distance information.
[0022] According to another aspect of the embodiments of this application, a video memory allocation device is provided, applied to a GPU, the device comprising:
[0023] The reporting unit reports the access distance between the video memory address segment and the GPU core to the host, so that the host can allocate a video memory address segment to the virtual GPU (vGPU) based on the access distance that meets the distance condition between the virtual GPU and the GPU core.
[0024] According to another aspect of the embodiments of this application, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the methods described in the foregoing embodiments.
[0025] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the methods described in the foregoing embodiments.
[0026] According to another aspect of the embodiments of this application, a computer program product is provided, the computer program product storing a computer program, which, when executed by a processor, implements the method described in the foregoing embodiments.
[0027] The beneficial effects of this application embodiment are as follows: According to this application embodiment, when the host allocates video memory for the virtual GPU (vGPU), in addition to considering whether the video memory is free, it also considers the access distance (Distance, also known as the path) between the video memory address segment and the GPU core, and allocates video memory address segments whose access distance with the GPU core meets the distance condition as much as possible. Thus, the above-mentioned technical problems are solved, the system performance is improved, and the impact on other virtual machines is reduced.
[0028] Specific embodiments of this application are disclosed in detail with reference to the following description and accompanying drawings, indicating how the principles of this application can be adopted. It should be understood that the embodiments of this application are not limited in scope. Within the scope of the appended claims, embodiments of this application include many changes, modifications, and equivalents.
[0029] Features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, combined with features in other embodiments, or substituted for features in other embodiments.
[0030] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, whole, step, or component, but does not exclude the presence or addition of one or more other features, wholes, steps, or components. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0032] Figure 1 This is a schematic diagram of a video memory allocation method according to an embodiment of this application;
[0033] Figure 2 This is another schematic diagram of the video memory allocation method according to an embodiment of this application;
[0034] Figure 3 This is yet another schematic diagram of the video memory allocation method according to an embodiment of this application;
[0035] Figure 4 This is a schematic diagram illustrating information interaction between the GPU, the host, and the virtual machine according to the method described in the embodiments of this application.
[0036] Figure 5 This is a schematic diagram of a video memory allocation device according to an embodiment of this application;
[0037] Figure 6 This is another schematic diagram of the video memory allocation device according to an embodiment of this application;
[0038] Figure 7 This is another schematic diagram of the video memory allocation device according to an embodiment of this application. Detailed Implementation
[0039] Referring to the accompanying drawings, the foregoing and other features of this application will become apparent from the following description. Specific embodiments of this application are specifically disclosed in the description and drawings, illustrating partial implementations in which the principles of this application may be employed. It should be understood that this application is not limited to the described embodiments; rather, it includes all modifications, variations, and equivalents falling within the scope of the appended claims.
[0040] In the embodiments of this application, the terms "first," "second," etc., are used to distinguish different elements by name, but do not indicate the spatial arrangement or chronological order of these elements, and these elements should not be limited by these terms. The term "and / or" includes any one or more of the terms listed in association and all combinations thereof. The terms "comprising," "including," "having," etc., refer to the presence of the stated features, elements, components, or assemblies, but do not exclude the presence or addition of one or more other features, elements, components, or assemblies.
[0041] In the embodiments of this application, the singular forms "a," "the," etc., including the plural forms, should be broadly understood as "a kind" or "a class" rather than limited to the meaning of "an." Furthermore, the term "the" should be understood to include both the singular and plural forms, unless the context explicitly indicates otherwise. Additionally, the term "according to" should be understood as "at least partially based on…," and the term "based on" should be understood as "at least partially based on…," unless the context explicitly indicates otherwise.
[0042] Various embodiments of this application will now be described with reference to the accompanying drawings. These embodiments are merely exemplary and are not intended to limit the scope of this application.
[0043] First aspect of the embodiments
[0044] This application provides a method for allocating video memory.
[0045] Figure 1 This is a schematic diagram of a video memory allocation method according to an embodiment of this application, and is described from the host side.
[0046] like Figure 1 As shown, the video memory allocation method includes:
[0047] 110: The distance between the host's memory address range and the graphics processing unit (GPU) core;
[0048] 120: The host allocates a video memory address range to the virtual GPU (vGPU) based on the above access distance, provided that the access distance between the virtual GPU and the GPU core meets the distance condition.
[0049] It is worth noting that the above appendix Figure 1 The embodiments of this application have only been illustrated schematically, and the application is not limited thereto. For example, the execution order between various operations can be appropriately adjusted, and other operations can be added or some operations can be removed. Those skilled in the art can make appropriate modifications based on the above description, and are not limited to the above-described embodiments. Figure 1 The records.
[0050] In this embodiment of the application, the GPU is a multi-die GPU, with each die having at least one GPU core. The GPU has multiple GPU cores. Since the video memory in the GPU chip is composed of multiple video memory chips, under the multi-die design, the path (distance) from the GPU core to the video memory chip will be different on different dies.
[0051] According to the embodiments of this application, when the host allocates video memory to the vGPU, in addition to considering whether the video memory is free, it also considers the access distance (also known as the path) between the video memory address segment and the GPU core, and allocates video memory address segments whose access distance to the GPU core meets the distance condition as much as possible. As a result, the system performance is improved and the impact on other virtual machines is reduced.
[0052] In the above implementation, the access distance from each GPU core to a certain memory address segment will vary depending on the die where the GPU core is located. The GPU provides the access distance between the memory address segment and the GPU core to the host. Thus, the host can determine the access distance between the memory address segment and the GPU core, identify which memory address segments have a small access distance to a certain GPU core, and which memory address segments have a large access distance to a certain GPU core, and then allocate memory address segments to vGPU that meet the distance conditions for access to the GPU core.
[0053] In the above embodiment, during operation 110, the GPU can report the access distance to the host through the IPC (Inter-Process Communication) interface. This application is not limited to this, and the GPU can also report the access distance to the host through other means.
[0054] In the above embodiment, in operation 120, the host allocates a video memory address segment to the vGPU that meets the distance condition between the access distance and the GPU core according to the access distance. This may include: the host allocates at least one GPU core to the vGPU, searches for the free video memory address segment with the smallest access distance for each GPU core according to the above access distance, and allocates the video memory address segment with the smallest access distance corresponding to each GPU core to each GPU core.
[0055] For example, when the host creates a vGPU, it first allocates a GPU core to the vGPU. All commands of the vGPU (commands issued by the application in the vGPU) are executed on this GPU core. After obtaining the access distance between the video memory address segment and the GPU core through the above operation 110, the host finds the free video memory address segment with the smallest access distance corresponding to the above-allocated GPU core and allocates it to the GPU core.
[0056] In the above embodiment, if the available video memory address segment with the shortest access distance to the GPU core is insufficient, that is, the video memory address segment cannot satisfy the GPU core, the host can sequentially search for available video memory address segments in ascending order of access distance and allocate the found available video memory address segments to the GPU core.
[0057] In the above embodiments, the host can also send the access distance between the video memory address range allocated to the vGPU and the GPU core allocated to the vGPU to the virtual machine, so that the virtual machine can allocate video memory resources to the applications in the virtual machine accordingly.
[0058] The specific implementation methods for virtual machines and GPUs will be described in the following examples.
[0059] Figure 2 This is another schematic diagram of the video memory allocation method according to an embodiment of this application, described from the perspective of the virtual machine. Content identical to that in the previous embodiments will not be repeated.
[0060] like Figure 2 As shown, the video memory allocation method includes:
[0061] 210: The virtual machine obtains the access distance between the video memory address range allocated by the host for the vGPU and the GPU core allocated for the vGPU;
[0062] 220: The virtual machine allocates video memory resources to the applications in the virtual machine based on the access distance information mentioned above.
[0063] It is worth noting that the above appendix Figure 2 The embodiments of this application have only been illustrated schematically, and the application is not limited thereto. For example, the execution order between various operations can be appropriately adjusted, and other operations can be added or some operations can be removed. Those skilled in the art can make appropriate modifications based on the above description, and are not limited to the above-described embodiments. Figure 2 The records.
[0064] In the above embodiments, there are no restrictions on how the virtual machine obtains the access distance. For example, when the host creates a vGPU, it reports the access distance between the video memory address range allocated to the vGPU and the GPU core allocated to the vGPU to the virtual machine, for example, to the GPU driver within the virtual machine.
[0065] In the above embodiments, the access distance between the video memory address segment allocated to the vGPU and the GPU core allocated to the vGPU may be the same or different.
[0066] When the memory address range allocated to the vGPU is different from the access distance between the GPU core allocated to the vGPU, the driver in the virtual machine will prioritize allocating memory resources to the memory address range corresponding to the memory address range whose access distance meets the distance condition when allocating memory resources to the application in the virtual machine.
[0067] When the memory address range allocated to the vGPU is the same as the access distance between the GPU core allocated to the vGPU, the driver in the virtual machine can allocate memory resources to the application in the virtual machine according to a predetermined strategy, such as sequential allocation, random allocation, etc.
[0068] The specific implementation of the GPU will be described in the following examples.
[0069] Figure 3 This is another schematic diagram of the video memory allocation method according to an embodiment of this application, illustrated from the GPU side. Content identical to that in the previous embodiments will not be repeated.
[0070] like Figure 3 As shown, the video memory allocation method includes:
[0071] 310: The GPU reports the access distance between the video memory address range and the GPU core to the host so that the host can allocate video memory address ranges that meet the distance conditions between the virtual GPU (vGPU) and the GPU core based on the access distance.
[0072] It is worth noting that the above appendix Figure 3 The embodiments of this application have only been illustrated schematically, and the application is not limited thereto. For example, the execution order between various operations can be appropriately adjusted, and other operations can be added or some operations can be removed. Those skilled in the art can make appropriate modifications based on the above description, and are not limited to the above-described embodiments. Figure 3 The records.
[0073] In the above embodiments, the GPU can report the access distance between memory address segments and GPU cores to the host-side driver via the IPC interface. The host-side driver can then parse this access distance to determine which memory address segments meet the distance criteria, such as which cache address segments have a small access distance to a particular GPU core and which memory address segments have a large access distance. The access distance from each GPU core to a given memory address segment will vary depending on the die where the GPU core is located.
[0074] Figure 4 This is a schematic diagram illustrating information interaction between the GPU, the host, and the virtual machine according to the method described in the embodiments of this application. Figure 4In the example, the distance condition is set to the minimum distance. This application is not limited to this, and the distance condition can also be other conditions set as needed.
[0075] like Figure 4 As shown, the information interaction process includes:
[0076] S1: The GPU reports the access distance between the video memory address range and the GPU core to the host through the IPC interface;
[0077] S2: The host determines the access distance between the video memory address segment and the GPU core based on the above access distance;
[0078] S3: The host allocates the shortest free video memory address segment to the GPU core assigned to the vGPU;
[0079] S4: The host reports the access distance between the memory address range allocated to the vGPU and the GPU core to the virtual machine;
[0080] S5: The driver in the virtual machine allocates video memory resources to the application in the virtual machine according to the above access distance, giving priority to the video memory resources corresponding to the video memory address segment with the smaller distance.
[0081] It is worth noting that the above appendix Figure 4 The embodiments of this application have only been illustrated schematically, and the application is not limited thereto. For example, the execution order between various operations can be appropriately adjusted, and other operations can be added or some operations can be removed. Those skilled in the art can make appropriate modifications based on the above description, and are not limited to the above-described embodiments. Figure 4 The records.
[0082] The above embodiments are merely illustrative examples of embodiments of this application, but this application is not limited thereto, and appropriate modifications can be made based on the above embodiments. For example, the above embodiments can be used alone, or one or more of the above embodiments can be combined.
[0083] According to the embodiments of this application, when the host allocates video memory for the vGPU, in addition to considering whether the video memory is free, it also considers the access distance between the video memory address segment and the GPU core, and allocates video memory address segments whose access distance to the GPU core meets the distance condition as much as possible. As a result, the system performance is improved and the impact on other virtual machines is reduced.
[0084] Second aspect of the embodiments
[0085] This application provides a video memory allocation device. In this application embodiment, the principle by which this video memory allocation device solves the problem is the same as the video memory allocation method of the first aspect embodiment; the similarities will not be repeated.
[0086] Figure 5 This is a schematic diagram of a video memory allocation device 500 according to an embodiment of this application, applied to a host computer, corresponding to... Figure 1 The method of the illustrated embodiment. As... Figure 5 As shown, the video memory allocation device 500 includes:
[0087] The first acquisition unit 510 acquires the access distance between the video memory address segment and the GPU core.
[0088] The first allocation unit 520 allocates a video memory address segment to the vGPU based on the aforementioned access distance, provided that the access distance between the vGPU and the GPU core meets the distance condition.
[0089] In some embodiments, the first allocation unit 520 allocates a video memory address segment whose access distance to the GPU core meets the distance condition based on the aforementioned access distance, including:
[0090] Allocate at least one GPU core to the aforementioned vGPU;
[0091] Based on the above access distance, each GPU core searches for the free memory address segment with the shortest distance.
[0092] Allocate the free memory address range with the shortest access distance to each GPU core to each GPU core.
[0093] In the above embodiment, if the free video memory address segment with the smallest access distance to the GPU core cannot satisfy the GPU core, that is, if the free video memory address segment with the smallest access distance to the GPU core is insufficient, then the free video memory address segments are allocated to the GPU core in ascending order of access distance.
[0094] In some embodiments, such as Figure 5 As shown, the device 500 also includes:
[0095] The sending unit 530 sends the access distance between the video memory address segment allocated to the vGPU and the GPU core allocated to the vGPU to the virtual machine.
[0096] For details on virtual machine and GPU processing, please refer to the following examples.
[0097] Figure 6 This is a schematic diagram of a video memory allocation device 600 according to an embodiment of this application, applied to a virtual machine, corresponding to... Figure 2The method of the illustrated embodiment. As... Figure 6 As shown, the video memory allocation device 600 includes:
[0098] The second acquisition unit 610 acquires the access distance between the video memory address segment allocated by the host for the vGPU and the GPU core allocated for the vGPU.
[0099] The second allocation unit 620 allocates video memory resources to applications in the virtual machine based on the aforementioned access distance.
[0100] In the above embodiments, the allocation unit 620 allocates video memory resources to the application in the virtual machine according to the access distance, including:
[0101] When the access distance from the vGPU's memory address range to each GPU core is the same, the second allocation unit 620 allocates memory resources to the application in the virtual machine according to a predetermined strategy.
[0102] When the access distance between the vGPU memory address range and each GPU core is different, the second allocation unit 620 prioritizes allocating memory resources corresponding to memory address ranges that meet the distance conditions to the application in the virtual machine.
[0103] For details on GPU processing, please refer to the examples below.
[0104] Figure 7 This is a schematic diagram of a video memory allocation device 700 according to an embodiment of this application, applied to a GPU, corresponding to... Figure 3 The method of the illustrated embodiment. As... Figure 7 As shown, the video memory allocation device 700 includes:
[0105] The reporting unit 710 reports the access distance between the video memory address segment and the GPU core to the host, so that the host can allocate a video memory address segment to the vGPU that meets the distance condition between the access distance and the GPU core.
[0106] The above embodiments are merely illustrative examples of embodiments of this application, but this application is not limited thereto, and appropriate modifications can be made based on the above embodiments. For example, the above embodiments can be used alone, or one or more of the above embodiments can be combined.
[0107] It is worth noting that the above description only covers the components or modules relevant to this application, but this application is not limited thereto. The video memory allocation apparatus 500-700 in the embodiments of this application may also include other components or modules, and for details regarding these components or modules, please refer to related technologies.
[0108] In addition, for the sake of simplicity, Figures 5 to 7 The diagram only exemplifies the connection relationships or signal flow between various components or modules; however, those skilled in the art should understand that various related technologies, such as bus connections, can be employed. The aforementioned components or modules can be implemented using hardware facilities such as processors, memory, transmitters, and receivers; this application does not impose any limitations on this.
[0109] According to the embodiments of this application, when the host allocates video memory for the vGPU, in addition to considering whether the video memory is free, it also considers the access distance between the video memory address segment and the GPU core, and allocates video memory address segments whose access distance to the GPU core meets the distance condition as much as possible. As a result, the system performance is improved and the impact on other virtual machines is reduced.
[0110] Embodiments of this application also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the methods in the embodiments of the first aspect.
[0111] Embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the methods in the embodiments of the first aspect.
[0112] Embodiments of this application also provide a computer program product, the computer program product including a computer program that, when executed by a processor, implements any of the methods in the embodiments of the first aspect.
[0113] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0114] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, produce a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0116] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0117] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A device for allocating video memory, applied to a host, characterized in that, The device comprises: A first obtaining unit obtains an access distance between a graphics memory address segment and a GPU core; A first allocating unit allocates, according to the access distance, a graphics memory address segment that satisfies a distance condition with respect to the access distance between the graphics memory address segment and the GPU core to a vGPU.
2. The apparatus of claim 1, wherein, The first allocating unit allocates, according to the access distance, a graphics memory address segment that satisfies a distance condition with respect to the access distance between the graphics memory address segment and the GPU core to a vGPU, comprising: allocating at least one GPU core to the vGPU; finding, according to the access distance, an idle graphics memory address segment with the smallest distance for each GPU core; allocating, to each GPU core, the idle graphics memory address segment with the smallest distance corresponding to the GPU core.
3. The device of claim 2, wherein, in a case where the idle graphics memory address segment with the smallest distance with respect to the access distance between the graphics memory address segment and the GPU core cannot satisfy the GPU core, the first allocating unit allocates, to the GPU core, an idle graphics memory address segment in an order from small to large with respect to the access distance. The device further comprises:
4. The device according to any of claims 1-3, characterized in that A sending unit sends, to a virtual machine, a graphics memory address segment of a graphics memory allocated to the vGPU and an access distance between the graphics memory address segment and a GPU core allocated to the vGPU. The device comprises:
5. A device for allocating a display memory, applied to a virtual machine, characterized in that, A second obtaining unit obtains an access distance between a graphics memory address segment of a graphics memory allocated to a vGPU by a host and a GPU core allocated to the vGPU; A second allocating unit allocates, according to the access distance, a graphics memory resource to an application in a virtual machine. The second allocating unit allocates, according to the access distance, a graphics memory resource to an application in a virtual machine, comprising:
6. The apparatus of claim 5, wherein, in a case where the access distances between the graphics memory address segment of the vGPU and each GPU core are the same, the second allocating unit allocates, according to a predetermined strategy, a graphics memory resource to an application in a virtual machine; in a case where the access distances between the graphics memory address segment of the vGPU and each GPU core are different, the second allocating unit preferentially allocates, to an application in a virtual machine, a graphics memory resource corresponding to a graphics memory address segment that satisfies a distance condition with respect to the access distance. The device comprises:
7. A device for allocating a display memory, applied to a GPU, characterized in that, A reporting unit reports, to a host, an access distance between a graphics memory address segment and a GPU core, so that the host allocates, according to the access distance, a graphics memory address segment that satisfies a distance condition with respect to the access distance between the graphics memory address segment and the GPU core to a vGPU. The processor implements the following method when executing the computer program:
8. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, obtaining an access distance between a graphics memory address segment and a GPU core; and allocating, according to the access distance, a graphics memory address segment that satisfies a distance condition with respect to the access distance between the graphics memory address segment and the GPU core to a vGPU; and / or, obtaining an access distance between a graphics memory address segment of a graphics memory allocated to a vGPU by a host and a GPU core allocated to the vGPU; and allocating, according to the access distance, a graphics memory resource to an application in a virtual machine; and / or, reporting, to the host, an access distance between a GPU core and a memory address segment of the GPU, so that the host allocates, to the vGPU, a memory address segment of the GPU whose access distance to the GPU core satisfies a distance condition.
9. A computer readable storage medium storing a computer program, characterized in that, The computer program, when executed by a processor, implements the following method: obtaining an access distance between a GPU core and a memory address segment of the GPU; and allocating, to the vGPU, a memory address segment of the GPU whose access distance to the GPU core satisfies a distance condition according to the access distance; and / or obtaining an access distance between a GPU core and a memory address segment of the GPU allocated by the host to the vGPU; and allocating, to an application in the virtual machine, a memory resource of the GPU according to the access distance; and / or reporting, to the host, an access distance between a GPU core and a memory address segment of the GPU, so that the host allocates, to the vGPU, a memory address segment of the GPU whose access distance to the GPU core satisfies a distance condition.
10. A computer program product storing a computer program, characterized in that, The computer program, when executed by a processor, implements the following method: obtaining an access distance between a GPU core and a memory address segment of the GPU; and allocating, to the vGPU, a memory address segment of the GPU whose access distance to the GPU core satisfies a distance condition according to the access distance; and / or obtaining an access distance between a GPU core and a memory address segment of the GPU allocated by the host to the vGPU; and allocating, to an application in the virtual machine, a memory resource of the GPU according to the access distance; and / or reporting, to the host, an access distance between a GPU core and a memory address segment of the GPU, so that the host allocates, to the vGPU, a memory address segment of the GPU whose access distance to the GPU core satisfies a distance condition.