Search

CN-121996347-A - Video memory migration method and device, electronic equipment and storage medium

CN121996347ACN 121996347 ACN121996347 ACN 121996347ACN-121996347-A

Abstract

The invention relates to the technical field of computers, in particular to a video memory migration method and device, electronic equipment and a storage medium, wherein the method comprises the steps of receiving migration information and vGPU (graphics processing unit) display data of a source host from the source host, wherein the migration information comprises address space description information of the vGPU of the source and a base address of a GPU page table, and the vGPU display data comprises the GPU page table; calculating a physical address of a destination end corresponding to the GPU page table based on the migration information and address space description information of the destination end vGPU; and updating the received physical address corresponding to the GPU page table by using the calculated physical address. The embodiment of the disclosure can effectively improve the flexibility and application range of vGPU migration.

Inventors

  • Request for anonymity

Assignees

  • 摩尔线程智能科技(北京)股份有限公司

Dates

Publication Date
20260508
Application Date
20251120

Claims (12)

  1. 1. The video memory migration method is characterized by being applied to a target terminal host for video memory migration, and comprises the following steps: The method comprises the steps that migration information and vGPU display data of a source host are received from the source host, the migration information comprises address space description information of the source vGPU and a base address of a GPU page table, and the vGPU display data comprises the GPU page table; calculating a physical address of a destination end corresponding to the GPU page table based on the migration information and address space description information of the destination end vGPU; And updating the received physical address corresponding to the GPU page table by using the calculated physical address.
  2. 2. The method according to claim 1, wherein the physical address corresponding to the GPU page table comprises a physical address in a GPU page table item and/or a base address of the GPU page table itself; the calculating the physical address of the destination end corresponding to the GPU page table comprises the following steps: Address conversion is carried out on the base address of the GPU page table to obtain the base address of the target page table; And performing address conversion on the physical address of the page table entry record in the GPU page table to obtain the physical address of the page table entry record in the destination GPU page table.
  3. 3. The method according to claim 1, wherein the calculating the physical address of the destination end corresponding to the GPU page table includes: According to the address space description information of the source terminal vGPU, converting a physical address corresponding to a source terminal GPU page table into a CPU physical address which is kept unchanged before and after migration; and converting the CPU physical address into a GPU physical address corresponding to a destination GPU page table according to the address space description information of the destination vGPU.
  4. 4. The method according to claim 3, wherein the converting the physical address corresponding to the source GPU page table into the CPU physical address that remains unchanged before and after migration according to the address space description information of the source GPU includes: determining a source video memory segment to which a source GPU physical address belongs according to the address space description information of the source vGPU, and acquiring a source segment base address of the video memory segment; Calculating the offset of the source GPU physical address relative to the source segmentation base address; Determining a CPU physical address segmentation base address corresponding to the source side video memory segmentation according to a first mapping relation; And adding the segmentation base address of the CPU physical address and the offset to obtain the CPU physical address.
  5. 5. A method according to claim 3, wherein said converting the CPU physical address into a GPU physical address corresponding to a destination GPU page table according to the address space description information of the destination vGPU comprises: determining a base address of a target terminal video memory segment corresponding to the CPU physical address according to the address space description information of the target terminal vGPU and a second mapping relation; And adding the base address of the target video memory segment and the offset to obtain the target GPU physical address.
  6. 6. The method of claim 1, wherein the address space description information includes base address and size information for one or more memory segments, the addresses within a memory segment being contiguous.
  7. 7. The method of claim 1, wherein the base address of the GPU page table is recorded by the source host machine during virtual machine operation by tracking the creation and destruction operations of the GPU page table by the virtual machine.
  8. 8. The method of claim 7, wherein the source host maintains a list of page table base addresses, wherein the source host adds the base address of a new page table to the list when it is monitored that the virtual machine creates a new GPU page table, and wherein the base address of a destroyed page table is removed from the list when it is monitored that the virtual machine destroys an existing GPU page table.
  9. 9. A video memory migration apparatus, applied to a destination host for video memory migration, the apparatus comprising: The system comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving migration information and vGPU display data of a source host from the source host, the migration information comprises address space description information of the source vGPU and a base address of a GPU page table, and the vGPU display data comprises the GPU page table; The computing module is used for computing the physical address of the destination end corresponding to the GPU page table based on the migration information and the address space description information of the destination end vGPU; And the updating module is used for updating the received physical address corresponding to the GPU page table by using the calculated physical address.
  10. 10. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to carry out the steps of the method according to any one of claims 1 to 8.
  11. 11. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the method according to any of claims 1 to 8.
  12. 12. A computer program product comprising a computer program, or a non-transitory computer readable storage medium carrying a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 8.

Description

Video memory migration method and device, electronic equipment and storage medium Technical Field The disclosure relates to the field of computer technology, and in particular, to a method and device for migrating a video memory, an electronic device and a storage medium. Background In virtualization technology, virtual machine migration requires copying the complete state including GPU display data from a source host to a destination host. The GPU video memory contains a critical page table, and the mapping relation from the GPU virtual address to the physical address is recorded in the page table. After the video migration, the physical address allocated by the destination end for the GPU is often different from that of the source end, so that the page table copied from the source end cannot be used due to the failure of the physical address. To avoid this problem, in the related art, it is generally forced that the physical addresses of the destination end and the source end must be identical, which needs to keep the physical displays of the destination end and the source end completely identical in hardware, that is, rely on specific hardware to keep the addresses unchanged, which severely limits flexibility and versatility of the video memory migration. Disclosure of Invention In view of this, the present disclosure proposes a technical solution for video memory migration. According to one aspect of the present disclosure, a video memory migration method is provided, which is applied to a destination terminal host of video memory migration, and the method includes: The method comprises the steps that migration information and vGPU display data of a source host are received from the source host, the migration information comprises address space description information of the source vGPU and a base address of a GPU page table, and the vGPU display data comprises the GPU page table; calculating a physical address of a destination end corresponding to the GPU page table based on the migration information and address space description information of the destination end vGPU; And updating the received physical address corresponding to the GPU page table by using the calculated physical address. In one possible implementation manner, the physical address corresponding to the GPU page table comprises a physical address in a GPU page table item and/or a base address of the GPU page table; the calculating the physical address of the destination end corresponding to the GPU page table comprises the following steps: Address conversion is carried out on the base address of the GPU page table to obtain the base address of the target page table; And performing address conversion on the physical address of the page table entry record in the GPU page table to obtain the physical address of the page table entry record in the destination GPU page table. In one possible implementation manner, the calculating the physical address of the destination end corresponding to the GPU page table includes: According to the address space description information of the source terminal vGPU, converting a physical address corresponding to a source terminal GPU page table into a CPU physical address which is kept unchanged before and after migration; and converting the CPU physical address into a GPU physical address corresponding to a destination GPU page table according to the address space description information of the destination vGPU. In one possible implementation manner, the converting, according to the address space description information of the source vGPU, the physical address corresponding to the source GPU page table into the CPU physical address that remains unchanged before and after migration includes: Determining a source video memory segment to which the source GPU physical address belongs according to the address space description information of the source vGPU, and acquiring a source segment base address of the video memory segment; Calculating the offset of the source GPU physical address relative to the source segmentation base address; Determining a CPU physical address segmentation base address corresponding to the source side video memory segmentation according to a first mapping relation; And adding the segmentation base address of the CPU physical address and the offset to obtain the CPU physical address. In one possible implementation manner, the converting the CPU physical address into the GPU physical address corresponding to the destination GPU page table according to the address space description information of the destination vGPU includes: determining a base address of a target terminal video memory segment corresponding to the CPU physical address according to the address space description information of the target terminal vGPU and a second mapping relation; And adding the base address of the target video memory segment and the offset to obtain the target GPU physical address. In one possible impleme