Summary of the invention
In order to solve these potential problems, it is an object of the invention to overcome above-mentioned deficiency existing in prior art, it is provided that one can make virtual machine directly access hardware GPU, and low price, render the high cloud rendering system of performance, server and method.
In order to realize foregoing invention purpose, the technical solution used in the present invention is:
A kind of cloud rendering system, including host and multiple GPU, described host is provided with multiple virtual machine, and each described virtual machine is equipped with a GPU of correspondence and drives;
Described cloud rendering system also includes: MMU, it coupled to each described GPU to drive and each described GPU, couples virtual machine internal memory and host internal memory, when it is configured as any one virtual machine request access GPU, driving one GPU address of distribution to the GPU of this virtual machine, described GPU address is used for accessing this GPU;When the request of any one virtual machine accesses virutal machine memory, to the host memory address that the distribution of this virtual machine is corresponding;
IOMMU, coupled to each described GPU and virutal machine memory, when it is configured as any one GPU request access virutal machine memory, to the host memory address that this GPU distribution is corresponding.
Further, memory address space is set, and described host internal memory is mapped to memory address space, described memory address space is used for the address that reservoir host's machine internal memory is corresponding, and described virtual machine accesses the host internal memory of correspondence by accessing the address in memory address space.
Further, the discontinuous application heap that described IOMMU is additionally operable to store described memory address space is mapped as continuous print application heap, in order to GPU can carry out reading and writing data by DMA technology.
Further, arranging GPU address space, and described GPU is mapped to GPU address space, described GPU address space controls, for storing GPU, the address that depositor is corresponding, and described GPU is driven through described GPU address space and accesses the GPU control depositor of correspondence.
Further, when virtual machine activation any one described, this virtual machine and a GPU are bound by MMU and/or IOMMU, and during binding, this bound GPU can not bind with other virtual machines again.
Present invention simultaneously provides a kind of cloud rendering server, including the cloud rendering system of the present invention, also include cloud service management platform, for the running status of described system is monitored and manages, the user using described system is managed.
The present invention also provides for a kind of cloud rendering intent, comprises the following steps:
S1, virtual machine receive render request, and the GPU that render request is sent to virtual machine drives, and receives rendering data, and rendering data is write internal memory;
S2, virtual machine GPU drive access GPU control depositor, and by render request information write GPU control depositor;
S3, GPU are according to virutal machine memory corresponding to described render request message reference, and the rendering data in the virutal machine memory of described correspondence is processed.
Further, described virtual machine, described GPU all have multiple, and described virtual machine and described GPU one_to_one corresponding, any one when there being multiple render request, in each described virtual machine the plurality of render request of alignment processing respectively.
Further, described rendering data is write internal memory include, MMU couples described virutal machine memory and host internal memory, when virtual machine request accesses virutal machine memory, by the MMU host memory address to this virtual machine distribution correspondence, described rendering data stores according to described host memory address.
Further, described S2 step includes:
S201, the GPU physical address space section of host is mapped to the virtual address space section of host;
S202, utilize the GPU address space that described virtual address space section is mapped in virtual machine by GPA-HVA conversion table.
S203, virtual machine GPU drive and access GPU address space section, and access corresponding GPU according to the address information in described address space section and control depositor.
Further, described S3 step includes:
S301, IOMMU couple described virutal machine memory and GPU, and the discontinuous memory address space that virtual machine uses is mapped as continuous print address space section;
Described continuous print address space section is carried out DMA read-write according to render request information by S302, GPU, obtains and renders required data and complete to render.
Compared with prior art, beneficial effects of the present invention
A kind of cloud rendering system of the present invention, makes multiple virtual machine independently can both directly access GPU, the NvidiaVGPU framework being generally adopted in compared to existing technology by configuring MMU and IOMMU, and the system price of the present invention is cheap, render performance height.
Detailed description of the invention
Below in conjunction with detailed description of the invention, the present invention is described in further detail.But this should not being interpreted as, the scope of the above-mentioned theme of the present invention is only limitted to below example, and all technology realized based on present invention belong to the scope of the present invention.
Being a kind of cloud rendering system module frame chart of the present invention shown in Fig. 1, including host and multiple GPU, described host is provided with multiple virtual machine, and each described virtual machine is equipped with a GPU of correspondence and drives;
Described cloud rendering system also includes: MMU (MemoryManagementUnit memory management unit), it coupled to each described GPU to drive and each described GPU, couples virtual machine internal memory and host internal memory, when it is configured as any one virtual machine request access GPU, driving one GPU address of distribution to the GPU of this virtual machine, described GPU address is used for accessing this GPU;When the request of any one virtual machine accesses virutal machine memory, to the host memory address that the distribution of this virtual machine is corresponding;
IOMMU (Input/OutputMemoryManagementUnit input/output memory management unit), it coupled to each described GPU and virutal machine memory, when it is configured as any one GPU request access virutal machine memory, to the host memory address that this GPU distribution is corresponding.
The host of the present invention is expressed as creating the physical server entity of virtual machine, and operate in the virtual machine on this host and can share the resource of physical server, for the present invention, the physical server of the present invention is physically provided with multiple virtual machine, namely can be described as host.
nullWhen running in host due to virtual machine,By host as a common process,Therefore virtual machine for the access of physical memory and physics GPU time need to carry out address conversion,The present invention utilizes MMU technology,Make virtual machine when accessing internal memory,By MMU technology, its reference address is converted to the physical address of correspondence,Thus,When making virtual machine access internal memory or GPU,All the access mode with physical machine is identical,Need when GPU processes render request to access the rendering data in internal memory,The GPU data that can directly access in internal memory are made by IOMMU,Therefore when carrying out data and processing,Data processing method is also identical with physical machine individual processing mode,This is equivalent to as an independent main frame, virtual machine is carried out Rendering operations,Its rendering efficiency、Render performance to be also just as good as with real unique host.
Adopting the solution of the present invention to carry out cloud and render, a host runs multiple virtual machine process, and when there being multiple different rendering task, each virtual machine and the GPU corresponding with this virtual machine can both process these tasks independently, simultaneously.Such as when virtual machine 1 and GPU1 one rendering task of collaborative process, host have received another render request, now virtual machine 2 and GPU2 process second rendering task according to the solution of the present invention, the like, multiple GPU that multiple virtual machines of operation are corresponding with the plurality of virtual machine on a host can process multiple render request simultaneously, scheme compared to existing technology, the rendering capability of the present invention is higher, rendering efficiency is higher.
Arranging memory address space, and described host internal memory is mapped to memory address space, described memory address space is used for the address that reservoir host's machine internal memory is corresponding, and described virtual machine accesses the host internal memory of correspondence by accessing the address in memory address space.
In the present invention, carry out address mapping by arranging memory address space, facilitate MMU that interior depositing is managed, when there being multiple virtual machine to read internal memory simultaneously, orderly carry out internal storage access according to corresponding the arranging of memory address space, improve rendering efficiency.
The discontinuous application heap that described IOMMU is additionally operable to store described memory address space is mapped as continuous print application heap, in order to GPU can carry out reading and writing data by DMA (DirectionalMemoryAccess direct memory access) technology.
The region of memory used due to virtual machine is usually discontinuous space, for this discontinuous space, traditional internal storage data read mode is to assist to control GPU by CPU to read the content of corresponding address section, this mode needs additionally to dispatch cpu resource, not only produce the wasting of resources, also reduce GPU treatment effeciency, and by IOMMU technology, this discrete region of memory can be mapped as continuous print address space section, so, GPU just directly can read rendering data from internal memory and render, and further increases rendering efficiency.
Arranging GPU address space, and described GPU is mapped to GPU address space, described GPU address space controls, for storing GPU, the address that depositor is corresponding, and described GPU is driven through described GPU address space and accesses the GPU control depositor of correspondence.
Concrete, it it is the cloud rendering system internal module block diagram of one specific embodiment of the present invention shown in Fig. 2, virtual machine V1 is identical with virtual machine VN framework, virutal machine memory first accesses, when accessing internal memory, the memory address space being positioned at address space, memory address space provides the host internal memory corresponding with this virutal machine memory address, then carries out the read-write operation of data;The GPU driving of virtual machine first passes through GPU address space and obtains mapping the GPU control register address being located at GPU address space when accessing GPU, controls depositor by GPU, then controls GPU and render.
When virtual machine activation any one described, this virtual machine and a GPU are bound by MMU and/or IOMMU, and during binding, this bound GPU can not bind with other virtual machines again.
As previously mentioned, when virtual machine runs in host, by host as a common process, when virtual machine activation, a GPU not used by other virtual machines will be distributed to this virtual machine to bind, the address mapping relation between virtual machine and GPU is set up while binding, and when having multiple virtual machine activation and running at synchronization, one GPU of each virtual machine corresponding independent binding, the internal memory of each virtual machine is mapped to the zones of different of address space, each GPU is also mapped to GPU address space, therefore, when information later is mutual, each virtual machine can be simultaneously independent process render request, directly realize information transmission and information storage according to the mapping relations of their correspondence.
The present invention carries out bindings when when virtual machine activation, in actual applications, can bind when virtual machine creating, can also bind when virtual machine activation, can actively bind, can also be passive set up when receiving certain order is bound, and binding time can be determined according to practical situation, or sets up at other times.
Present invention simultaneously provides a kind of cloud rendering server, including the cloud rendering system of the present invention, also include cloud service management platform, for the running status of described system is monitored and manages, the user using described system is managed.
A specific embodiment as the present invention, when virtual machine creating, virtual machine has been bound by cloud service management platform with GPU, and MMU, IOMMU have been also carried out the configuration of mapping relations, virtual machine is enable directly to have access to physical memory and physical equipment, when, after virtual machine with certain GPU binding, the virtual machine that this GPU is bound with it is exclusive to be used, until this virtual machine is destroyed or GPU resource is released, just can again bind this GPU.
Described cloud service management platform uses existing plateform system, such as openstack, AmazonWebService, Ali's cloud etc., does not repeat them here.
It is a kind of cloud rendering intent flow chart of the present invention shown in Fig. 3, comprises the following steps:
S1, virtual machine receive render request, and the GPU that render request is sent to virtual machine drives, and receives rendering data, and rendering data is write internal memory;
Virtual machine is when carrying out information processing, it is process according to the handling process of physical machine, each virtual machine is both provided with GPU driver, for driving GPU to work, rendering data is write internal memory, after carrying out memory address space mapping indeed through MMU, data have been written in the physical memory of host, and the resource that virtual machine uses is all the host physical resource accessed by MMU, IOMMU mapping mode.
S2, virtual machine GPU drive access GPU control depositor, and by render request information write GPU control depositor;
S3, GPU are according to virutal machine memory corresponding to described render request message reference, and the rendering data in the virutal machine memory of described correspondence is processed.
In a detailed description of the invention, described virtual machine, described GPU all have multiple, and described virtual machine and described GPU one_to_one corresponding, any one when there being multiple render request, in each described virtual machine the plurality of render request of alignment processing respectively.
Described rendering data is write internal memory include, MMU couples described virutal machine memory and host internal memory, when virtual machine request accesses virutal machine memory, by the MMU host memory address to this virtual machine distribution correspondence, described rendering data stores according to described host memory address.
In a specific embodiment, this coupled relation of MMU just has been set up when virtual machine creating, when rendering data writes internal memory, MMU is directly by host virtual machine address (HVA, HostVirtualAddress) be converted to host physical address (HPA), make rendering data be written to host internal memory.
Described S2 step includes:
S201, the GPU physical address space section of host is mapped to the virtual address space section of host;
S202, utilize the GPU address space that described virtual address space section is mapped in virtual machine by GPA-HVA conversion table.
S203, virtual machine GPU drive and access GPU address space section, and access corresponding GPU according to the address information in described address space section and control depositor.
Described S3 step includes:
S301, IOMMU couple described virutal machine memory and GPU, and the discontinuous memory address space that virtual machine uses is mapped as continuous print address space section;
Described continuous print address space section is carried out DMA read-write according to render request information by S302, GPU, obtains and renders required data and complete to render.
GPU is when carrying out DMA, what access is continuous print AddressBus (address bus), but in virtual machine continuous print physical address (GPA, GuestPhysicalAddress) corresponding host physical address (HPA) is actually not continuous print, it is thus desirable to the AddressBus that GPU uses is mapped as continuous HPA by IOMMU, then carry out DMA.