CN109101283A - Control method, device and the electronic equipment of GPU equipment - Google Patents

Control method, device and the electronic equipment of GPU equipment Download PDF

Info

Publication number
CN109101283A
CN109101283A CN201810783072.6A CN201810783072A CN109101283A CN 109101283 A CN109101283 A CN 109101283A CN 201810783072 A CN201810783072 A CN 201810783072A CN 109101283 A CN109101283 A CN 109101283A
Authority
CN
China
Prior art keywords
operating system
gpu
equipment
gpu equipment
driving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810783072.6A
Other languages
Chinese (zh)
Inventor
刘博�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yuanxin Science and Technology Co Ltd
Original Assignee
Beijing Yuanxin Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yuanxin Science and Technology Co Ltd filed Critical Beijing Yuanxin Science and Technology Co Ltd
Priority to CN201810783072.6A priority Critical patent/CN109101283A/en
Publication of CN109101283A publication Critical patent/CN109101283A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • G06F9/441Multiboot arrangements, i.e. selecting an operating system to be loaded
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the present application provides control method, device and the electronic equipment of a kind of GPU equipment.This method comprises: the graphics processor GPU equipment that the first operating system controls is switched to off-line mode when detecting the switching request between the first operating system and the second operating system;The handover operation between the first operating system and the second operating system is executed according to switching request;The GPU equipment of off-line mode is provided to the second operating system, so that GPU equipment is controlled by the second operating system.The application realizes the purpose of the coordinated control GPU equipment between different operating system, switching at runtime of the GPU equipment between different operating system is achieved the purpose that, eliminate the time cost because carrying out simulation consumption to GPU equipment, different operating system calls the delay issue of GPU equipment caused by solving simultaneously because of simulation process, it reduces resource waste, improves the utilization rate to GPU equipment.

Description

Control method, device and the electronic equipment of GPU equipment
Technical field
This application involves the control technology fields of GPU equipment, specifically, this application involves a kind of controls of GPU equipment Method, apparatus and electronic equipment.
Background technique
With the development of multi-system equipment, same hardware resource is solved, such as GPU equipment, is processed by multiple system operatios For more and more important technical problem.The relevant technologies generally use virtualization technology to handle GPU equipment, i.e., by master The GPU equipment simulated is supplied to other operating systems and used, to realize that terminal is set by running simulation software in operating system Standby operation of the multiple systems to a GPU equipment.But this mode of operation presence by simulation completion multisystem to GPU Following technological deficiency: one, operating system loses GPU acceleration effect to easily postponing in the operation of GPU;Two, consumption calculate and Storage resource;Three, it cannot achieve the switching at runtime between different operating system.
Summary of the invention
This application provides control method, device and the electronic equipments of a kind of GPU equipment, ask for solving above-mentioned technology Topic.
In a first aspect, providing a kind of control method of GPU equipment, it is applied to include the first operating system and the second operation The terminal device of system, this method comprises:
When detecting the switching request between the first operating system and the second operating system, by the figure of the first operating system control Shape processor GPU equipment is switched to off-line mode;
The handover operation between the first operating system and the second operating system is executed according to switching request;
The GPU equipment of off-line mode is provided to the second operating system, so that GPU equipment is controlled by the second operating system.
Second aspect provides a kind of control device of GPU equipment, is applied to include the first operating system and the second operation The terminal device of system, the device include:
Offline drive module, when for detecting the switching request between the first operating system and the second operating system, by The graphics processor GPU equipment of one operating system control is switched to off-line mode;
System switching module, the switching for being executed between the first operating system and the second operating system according to switching request are grasped Make;
Control switching module, for the GPU equipment of off-line mode to be provided to the second operating system so that GPU equipment by The control of second operating system.
The third aspect provides a kind of electronic equipment, which includes: one or more processors;Memory;One A or multiple application programs, wherein one or more application programs are stored in memory and are configured as by one or more Processor executes, and one or more programs are configured to: executing the control method of GPU equipment.
Fourth aspect provides a kind of computer readable storage medium, is stored thereon with computer program, which is located Manage the control method that GPU equipment is realized when device executes.
Technical solution provided by the embodiments of the present application has the benefit that the application passes through to GPU equipment off-line mould The switching of formula realizes the purpose of the coordinated control GPU equipment between different operating system, i.e., proposes the GPU equipment of off-line mode Each operating system is supplied to realize the processing that each operating system controls GPU equipment, has reached GPU equipment in different operation system The purpose of switching at runtime between system eliminates the time cost because carrying out simulation consumption to GPU equipment, while solving because of simulation Different operating system caused by process calls the delay issue of GPU equipment, reduces resource waste, improves to GPU equipment Utilization rate.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, institute in being described below to the embodiment of the present application Attached drawing to be used is needed to be briefly described.
Fig. 1 is a kind of flow diagram of the control method of GPU equipment provided by the embodiments of the present application;
Fig. 2 is the flow diagram of each operating system one embodiment of starting provided by the embodiments of the present application;
Fig. 3 is a kind of structural schematic diagram of the control device of GPU equipment provided by the embodiments of the present application;
Fig. 4 is the structural schematic diagram of the control device of another kind GPU equipment provided by the embodiments of the present application;
Fig. 5 is a kind of structural representation of the electronic equipment of the control device using GPU equipment provided by the embodiments of the present application Figure.
Specific embodiment
Embodiments herein is described below in detail, the example of embodiment is shown in the accompanying drawings, wherein identical from beginning to end Or similar label indicates same or similar element or element with the same or similar functions.It is retouched below with reference to attached drawing The embodiment stated is exemplary, and is only used for explaining the application, and cannot be construed to the limitation to the application.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singular " one " used herein, "one" It may also comprise plural form with "the".It is to be further understood that wording " comprising " used in the description of the present application is Refer to existing characteristics, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition it is one or more other Feature, integer, step, operation, element, component and/or their group.It should be understood that when we claim element to be " connected " or " coupling Connect " to another element when, it can be directly connected or coupled to other elements, or there may also be intermediary elements.In addition, this In " connection " or " coupling " that uses may include being wirelessly connected or wireless coupling.Wording "and/or" used herein includes one A or more associated whole for listing item or any cell and all combination.
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party Formula is described in further detail.
The technical term being related in the application is introduced as follows:
Graphics processor (English Graphics Processing Unit, abbreviation GPU) also known as shows core, at vision Device, display chip are managed, is one kind specially in PC, work station, game machine and some mobile devices (such as tablet computer, intelligence Can mobile phone etc.) on image operation work microprocessor.
Hypervisor is a kind of intermediate software layer operated between physical server and operating system, is allowed multiple All physical equipments in operating system and application access server including disk and memory.Hypervisors is not only assisted The access of these hardware resources is adjusted, also applies protection between each virtual machine simultaneously.When server is started and carried out When Hypervisor, it can load the operating system of all virtual-machine clients, while it is appropriate to distribute to each virtual machine Memory, CPU, network and disk.
In the same hardware device of operation multisystem, in order to realize that each operating system to the calling of GPU equipment, works as terminal When equipment is started and carried out Hypervisor, need to distribute GPU equipment to each operating system.In the related technology, general way It is to simulate true GPU equipment, the GPU equipment that simulation obtains is allocated, realizes that multisystem calls GPU equipment Purpose.However this mode, not only simulation process needs to consume calculating and the memory source of terminal device, and can be calling The operating system for simulating obtained GPU equipment brings calling delay issue, to lose GPU acceleration effect.Meanwhile GPU equipment Switching at runtime can not be carried out between each operating system.
Control method, device, electronic equipment and the computer readable storage medium of GPU equipment provided by the present application, it is intended to Solve the technical problem as above of the prior art.
How the technical solution of the application and the technical solution of the application are solved with specifically embodiment below above-mentioned Technical problem is described in detail.These specific embodiments can be combined with each other below, for the same or similar concept Or process may repeat no more in certain embodiments.Below in conjunction with attached drawing, embodiments herein is described.
Embodiment one
The embodiment of the present application provides a kind of control method of GPU equipment, is applied to include the first operating system and second The terminal device of operating system, as shown in Figure 1, this method comprises:
S101, when detecting the switching request between the first operating system and the second operating system, by the first operating system control The graphics processor GPU equipment of system is switched to off-line mode.
Specifically, currently the system of control GPU equipment is the first operating system, to realize that the control of the second operating system should The purpose of GPU equipment, the first operating system send switching request to micro-kernel and pass through when micro-kernel receives the switching request First operating system is switched to off-line mode to the control of GPU equipment by Hypervisor, that is, releases the first operating system to GPU The control of equipment provides preparation to distribute GPU equipment to the second operating system.
Specifically, the first operating system and the second operating system are all the operating system of virtual-machine client, such as win7 system The operating system of the hardware devices such as system, vista system.
S102, the handover operation between the first operating system and the second operating system is executed according to switching request.
Specifically, the first operating system is switched to the second operation system using Hypervisor according to switching request by micro-kernel System guarantees that current master control system is the second operating system, to distribute GPU equipment to the second operating system.
S103, the GPU equipment of off-line mode is provided to the second operating system, so that GPU equipment is by the second operating system Control.
Specifically, the GPU equipment in off-line mode is distributed to the second operating system by Hypervisor by micro-kernel, GPU equipment can be called directly by guaranteeing the second operating system as master control system.
Specifically, in the application, by control GPU equipment and respectively when Hypervisor distributes GPU equipment to operating system What mapping relations between operating system were realized, for example, Hypervisor establish be the first operating system and GPU equipment room reflects Relationship is penetrated, realization is exactly that the GPU equipment is distributed to the first operating system to call;Modify the first operating system and GPU equipment Between mapping relations be the second operating system and GPU equipment room mapping relations, be accomplished that and the GPU equipment distributed to second Operating system is called.
The control method of GPU equipment provided by the present application can be using the hardware device for running multiple operating systems at the same time On, such as PC machine or mobile terminal (including mobile phone, pad).
The control method of GPU equipment provided by the present application is by cutting each operating system to the control of true GPU equipment Be changed to off-line mode, for by GPU equipment distribute to other operating systems carry out control basic condition is provided, to complete different behaviour After making the switching between system, the GPU equipment in off-line mode is directly supplied to the operation for needing to be called to GPU equipment System control, it is this by the way that the GPU equipment of off-line mode is supplied directly to the processing mode that each operating system controls, it reaches Arrived the purpose of switching at runtime of the GPU equipment between different operating system, and this mode be not necessarily to true GPU equipment into Row simulation, eliminates the time cost because carrying out simulation consumption to GPU equipment, thus solves different operating system request call Bring delay issue, reduces resource waste when GPU equipment is operated, and improves the utilization rate of GPU equipment.
Embodiment two
The embodiment of the present application provides alternatively possible implementation, further includes implementing on the basis of example 1 Method shown in example two, this method comprises:
It detects that terminal device starts, original GPU driving in the first operating system, the second operating system is packed respectively Processing drives the GPU of the GPU driving and kernel mode that there is user mode in the first operating system and the second operating system It is dynamic.
The packing processes that the present embodiment is driven by the former GPU to the first operating system and the second operating system, so that the The GPU of GPU driving and kernel mode that user mode is existed simultaneously in one operating system and the second operating system drives, and is first Operating system or the second operating system access GPU equipment provide driving and guarantee.Simultaneously as the application is not necessarily to true GPU equipment is simulated, therefore shortens the time of different operating system response operation requests, solves response operation requests Delay issue facilitates GPU equipment switching at runtime between different operating system, to improve the utilization rate of GPU equipment.
Specifically, the application is made each operating system while being deposited by the packing processes for driving original GPU in each operating system It is driven in the GPU driving of user mode and the GPU of kernel mode, realizes the side that response upper layer application is completed by former GPU driving Formula is adjusted to drive the mode completed jointly by the GPU driving of user mode and the GPU of kernel mode, makes GPU equipment is each When operating system controls, the GPU driving of kernel mode handles the operation requests that the GPU driving of user mode receives, It realizes and GPU equipment is accessed, complete the response to the operation requests, by between the GPU of control GPU equipment and kernel mode driving Mapping relations, realize control of the different operating system to GPU equipment, fast implement GPU equipment between different operating system Switching at runtime.
For example, when GPU equipment is controlled by the first operating system, what is made a response to the operation requests of GPU equipment is The GPU driving of kernel mode in one operating system, rather than original GPU drives.In fact, responding upper layer application in the application to GPU The operation requests of equipment are handled by two GPU drivers, one be user mode GPU driver, one A is the GPU driver of kernel mode.
Embodiment three
Fig. 2 is the flow diagram provided by the embodiments of the present application to each operating system packing processes one embodiment.This Embodiment further includes method shown in embodiment three on the basis of example 2, this method comprises:
S201, when there is user mode in the first operating system and the second operating system GPU driving and kernel mode GPU driving when, according to preset boot sequence, start the operation that sequence is first between the first operating system and the second operating system System, and GPU equipment is sequentially allocated to the GPU driving of the user mode of the first operating system of sequence and kernel mode GPU driving, so that the operating system control GPU equipment that sequence is first.
Specifically, the first operating system can be the operating system that sequence is first in boot sequence, is also possible to sequence and exists Operating system afterwards.It is following to be illustrated so that the first operating system is the first operating system of sequence as an example.Specifically, micro-kernel Start the first operating system by starting Hypervisor, after the first operating system is activated, Hypervisor is grasped to first Make system distribution GPU equipment, specifically can by establish GPU equipment and the first operating system user mode GPU driving and Mapping relations between the GPU driving of kernel mode.In application, the first operating system using user mode GPU driving receive come The operation requests are handled from the operation requests of upper level applications, then by the GPU driving of kernel mode, are completed to GPU The calling of equipment responds the operation requests.
S202, the relations of distribution for interrupting GPU equipment with the GPU driving of the kernel mode of the first operating system;
Specifically, micro-kernel is driven by the GPU of the Hypervisor kernel mode for interrupting GPU equipment and the first operating system Mapping between dynamic, is switched to off-line mode to the control of GPU equipment for the first operating system, so that Hypervisor completes the After switching between one operating system and the second operating system, the purpose for removing GPU equipment from the first operating system is realized.
The posterior operating system of sequence between S203, the first operating system of starting and the second operating system, and by GPU equipment according to The GPU driving of user mode and the GPU of kernel mode of the sub-distribution to the posterior operating system of sequence drive, so that sequence is rear Operating system control GPU equipment.
Specifically, micro-kernel can re-establish GPU equipment by Hypervisor and the mapping of the second operating system is closed System realizes that the purpose that GPU equipment is distributed to the control of the second operating system utilizes use when the second operating system being made to be placed in foreground The GPU driving of family mode receives the operation requests to GPU equipment, and the GPU drive control GPU equipment of kernel mode asks the operation It asks and is handled, complete the response to the operation requests.
The present embodiment by the starting to different operating system, guarantee each operating system can to true GPU equipment into Row control, wherein the GPU driving of the user mode of each operating system and the GPU of kernel mode are driven to true GPU equipment and exist Switching at runtime between different operating system provides the foundation guarantee, this that each operating system on terminal device is verified by starting Mode prevent early period because respective operating system can not start, and then influence later period true GPU equipment in different operation system Switching at runtime between system.
Example IV
The embodiment of the present application provides one embodiment of GPU equipment switching at runtime between different operating system, the implementation Example further includes the method that example IV provides on the basis of embodiment three, this method comprises:
The state of the graphics processor GPU equipment of first operating system control is the use of GPU equipment and the first operating system The GPU of family mode drives and the relations of distribution are established in the GPU of kernel mode driving;
The graphics processor GPU equipment that first operating system controls is switched to off-line mode, comprising: interruption sets GPU The relations of distribution that the standby GPU with the kernel mode of the first operating system drives;
The GPU equipment of off-line mode is provided to the second operating system, so that GPU equipment is controlled by the second operating system, It include: that the GPU that GPU equipment is sequentially allocated to the GPU driving of the user mode of the second operating system and kernel mode drives, it is real The purpose of existing second operating system control GPU equipment.
Specifically, micro-kernel interrupts the mapping relations of the first operating system and true GPU equipment by Hypervisor, It drives the GPU of kernel mode in the first operating system to be released from the control of true GPU equipment, at this point, true GPU equipment In the state not controlled by the first operating system, and the GPU driving that the first operating system can use user mode receives The operation requests of layer application, but because the GPU driving of kernel mode in the first operating system loses the control to true GPU equipment System, the first operating system can only receive the operation requests to GPU equipment, but can not make a response to operation requests, complete the After switching between one operating system and the second operating system, the second operating system is switched to foreground.Specifically, Hypervisor After the switching for completing the first operating system and the second operating system, the second operating system is placed in foreground, realize by GPU equipment from The purpose being completely exfoliated in first operating system obtains the second operating system so that GPU equipment is distributed to the second operating system To the access authority to GPU equipment.Specifically, the second operating system and true GPU equipment room are established by Hypervisor Mapping relations, realize that and the second operating system is especially by user mode to the purpose of the second operating system distribution GPU equipment GPU driving receive operation requests, so as to kernel mode GPU driving the operation requests are made a response.
Further, the graphics processor GPU equipment that the first operating system controls is switched to off-line mode, further includes:
After interrupting the relations of distribution for driving the GPU of GPU equipment and the kernel mode of the first operating system, the first behaviour is utilized The GPU driving for making the user mode of system receives and please store the operation of GPU equipment to reservation buffer zone.
Further, after the first operating system controls GPU equipment again, the operation stored to predetermined cache region is asked It asks and is handled.
Specifically, GPU driving and the GPU equipment room of the first System kernel mode can be interrupted by Hypervisor Mapping relations, drive the GPU of kernel mode in the first operating system and lose control to GPU equipment, after the completion of interruption, tool Body, Hypervisor, which sends to interrupt to the first operating system, completes signal, so as to the GPU of the user mode of the first operating system Driving receives upper layer application to the operation requests of GPU equipment and stores to predetermined cache region, prevents the first operating system to GPU When the control of equipment is switched to offline, operation requests of the upper-level system to GPU equipment can be subjected to caching process, this implementation When example ensure that the control to GPU equipment is in off-line state using the GPU driving of user mode, each operating system can pass through The GPU driving of user mode temporarily receives operation requests, to control GPU equipment again in the first operating system, i.e., again After establishing the mapping relations of the first operating system and GPU equipment, the GPU driving access GPU of the kernel mode of the first operating system Equipment makes a response the operation requests of storage.
Embodiment five
The embodiment of the present application provides a kind of control device of GPU equipment, is applied to include the first operating system and second The terminal device of operating system, as shown in figure 3, the control device 30 of the GPU equipment may include: offline drive module 301, be Switching module 302 of uniting and control switching module 303, wherein
It, will when offline drive module 301 is used to detect the switching request between the first operating system and the second operating system The graphics processor GPU equipment of first operating system control is switched to off-line mode;
System switching module 302 is used to execute the switching between the first operating system and the second operating system according to switching request Operation;
Control switching module 303 is used to the GPU equipment of off-line mode being provided to the second operating system, so that GPU equipment It is controlled by the second operating system.
Each operating system of control device of GPU equipment provided by the present application carries out control to true GPU equipment and is switched to Off-line mode, for by GPU equipment distribute to other operating systems carry out control condition is provided, so as to complete different operating system Between switching after, directly will be supplied to the control system control for needing to be called to GPU equipment in the GPU equipment of off-line mode System, it is this by the way that the GPU equipment of off-line mode is supplied directly to the processing mode that each operating system controls, realize reality The purpose for having showed the coordinated control GPU equipment between different operating system has reached dynamic of the GPU equipment between different operating system The purpose of switching, and this mode is eliminated without simulating to true GPU equipment because simulating to GPU equipment The time cost of consumption, thus solve the control system of the request call GPU equipment bring when operating to GPU equipment Delay issue reduces resource waste, and improves the utilization rate of GPU equipment.
A kind of control method of GPU equipment provided by the present application can be performed in the control device of the GPU equipment of the present embodiment, Realization principle is similar, and details are not described herein again.
For example, further, as shown in figure 4, the device 30 further include: kernel packs module 304.
Wherein, kernel packaging module 304 is for detecting that terminal device starts, respectively to the first operating system, the second behaviour Make original GPU driving in system and carry out packing processes, makes there is user mode in the first operating system and the second operating system The GPU of GPU driving and kernel mode drives.
The present embodiment is by the packing processes that drive to original GPU in the first operating system and the second operating system, so that the The GPU of GPU driving and kernel mode that user mode is existed simultaneously in one operating system and the second operating system drives, and is first Operating system or the second operating system access GPU equipment provide driving and guarantee, prevent the first operating system or the second operation system Original GPU driving directly accesses to GPU equipment on system, by packing processes, determines final real by the GPU driving of kernel mode Now to the access of GPU equipment, switching at runtime of the GPU equipment between different operating system is achieved the purpose that.Simultaneously as this Shen The time cost because carrying out simulation consumption to GPU equipment please be eliminated, is solved without being simulated to true GPU equipment The delay issue for responding operation requests, by facilitating GPU equipment switching at runtime between different operating system, to improve The utilization rate of GPU equipment.
For example, further, as shown in figure 4, the device 30 further include: the first starting module 305, starting switching module 306 and second starting module 307.
Wherein, the first starting module 305, which is used to work as in the first operating system and the second operating system, has user mode GPU driving and kernel mode GPU driving when, according to preset boot sequence, start the first operating system and the second operation The first operating system of sequence between system, and GPU equipment is sequentially allocated to the user mode of the first operating system of sequence The GPU of GPU driving and kernel mode drives distribution, so that the operating system control GPU equipment that sequence is first;
Starting switching module 306 is used to interrupt the distribution of the GPU driving of the kernel mode of GPU equipment and the first operating system Relationship;
Second starting module 307 is for starting the posterior operation system of sequence between the first operating system and the second operating system System, and the GPU that GPU equipment is sequentially allocated to the user mode of the posterior operating system of sequence drives and the GPU of kernel mode Driving distribution, so that the posterior operating system of sequence controls GPU equipment.
The present embodiment by the starting to different operating system, guarantee each operating system can to true GPU equipment into Row control, provides the foundation for switching at runtime of the true GPU equipment between different operating system, prevents early period because of individual operations System can not start, and influence switching at runtime of the later period true GPU equipment between different operating system.
Further, in offline drive module 301 by the first operating system control graphics processor GPU equipment be switched to from Ray mode, comprising: interrupt the relations of distribution of the GPU driving of the kernel mode of GPU equipment and the first operating system;Offline driving mould After block 301 is also used to interrupt the relations of distribution of GPU driving of the kernel mode of GPU equipment and the first operating system, first is utilized The GPU driving of the user mode of operating system receives the operation requests to GPU equipment, and the operation requests are stored to predetermined slow Deposit region.
Specifically, the mapping relations that the first operating system and GPU equipment room are interrupted by Hypervisor, make the first operation The GPU driving of kernel mode loses the control to GPU equipment in system, and after the completion of interruption, Hypervisor is to the first operation System, which sends to interrupt, completes signal, so that the first operating system receives upper layer application to GPU equipment using the GPU driving of user mode Operation requests and stored, so as to after the mapping relations for re-establishing the first operating system and GPU equipment, the first operation System makes a response the operation requests of storage using the GPU driving access GPU equipment of kernel mode.
Further, the GPU equipment of off-line mode is provided to the second operating system by control switching module 303, so that described GPU equipment is controlled by the second operating system, comprising: GPU equipment is sequentially allocated to the GPU of the user mode to the second operating system The GPU of driving and kernel mode driving, so that the second operating system controls GPU equipment.
Embodiment six
The embodiment of the present application provides a kind of electronic equipment, as shown in figure 5, electronic equipment shown in fig. 5 400 includes: place Manage device 4001 and memory 4003.Wherein, processor 4001 is connected with memory 4003, is such as connected by bus 4002.It is optional , electronic equipment 400 can also include transceiver 4004.It should be noted that transceiver 4004 is not limited to one in practical application A, the structure of the electronic equipment 400 does not constitute the restriction to the embodiment of the present application.
Processor 4001 can be CPU, general processor, DSP, ASIC, FPGA or other programmable logic device, crystalline substance Body pipe logical device, hardware component or any combination thereof.It, which may be implemented or executes, combines described by present disclosure Various illustrative logic blocks, module and circuit.Processor 4001 is also possible to realize the combination of computing function, such as wraps It is combined containing one or more microprocessors, DSP and the combination of microprocessor etc..
Bus 4002 may include an access, and information is transmitted between said modules.Bus 4002 can be pci bus or Eisa bus etc..Bus 4002 can be divided into address bus, data/address bus, control bus etc..Only to be used in Fig. 5 convenient for indicating One thick line indicates, it is not intended that an only bus or a type of bus.
Memory 4003 can be ROM or can store the other kinds of static storage device of static information and instruction, RAM Or the other kinds of dynamic memory of information and instruction can be stored, it is also possible to EEPROM, CD-ROM or other CDs Storage, optical disc storage (including compression optical disc, laser disc, optical disc, Digital Versatile Disc, Blu-ray Disc etc.), magnetic disk storage medium Or other magnetic storage apparatus or can be used in carry or store have instruction or data structure form desired program generation Code and can by any other medium of computer access, but not limited to this.
Optionally, memory 4003 is used to store the application code for executing application scheme, and by processor 4001 It is executed to control.Processor 4001 is for executing the application code stored in memory 4003, to realize implementation shown in Fig. 4 The movement of the control device for the GPU equipment that example provides.
The embodiment of the present application provides a kind of computer readable storage medium, is stored on the computer readable storage medium Computer program realizes method shown in embodiment one to example IV any embodiment when the program is executed by processor.
The present embodiment is by the packing processes that drive to original GPU in the first operating system and the second operating system, so that the The GPU of GPU driving and kernel mode that user mode is existed simultaneously in one operating system and the second operating system drives, and is first Operating system or the second operating system access GPU equipment provide driving and guarantee.Simultaneously as the application is not necessarily to true GPU equipment is simulated, and eliminates the time cost because carrying out simulation consumption to GPU equipment, while solving because of simulation process Caused by different operating system call GPU equipment delay issue, reached dynamic of the GPU equipment between different operating system and cut The purpose changed, reduces resource waste, and improves the utilization rate to GPU equipment.
The embodiment of the present application provides a kind of computer readable storage medium and is suitable for above method embodiment.Herein no longer It repeats.
It should be understood that although each step in the flow chart of attached drawing is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, can execute in the other order.Moreover, at least one in the flow chart of attached drawing Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, execution sequence, which is also not necessarily, successively to be carried out, but can be with other At least part of the sub-step or stage of step or other steps executes in turn or alternately.
The above is only some embodiments of the application, it is noted that those skilled in the art are come It says, under the premise of not departing from the application principle, several improvements and modifications can also be made, these improvements and modifications also should be regarded as The protection scope of the application.

Claims (10)

1. a kind of control method of GPU equipment, which is characterized in that applied to including the first operating system and the second operating system Terminal device, this method comprises:
When detecting the switching request between the first operating system and the second operating system, at the figure of the first operating system control Reason device GPU equipment is switched to off-line mode;
The handover operation between the first operating system and the second operating system is executed according to switching request;
The GPU equipment of off-line mode is provided to the second operating system, so that the GPU equipment is controlled by the second operating system.
2. the method according to claim 1, wherein the method also includes:
It detects that terminal device starts, the former GPU driving of the first operating system, the second operating system is carried out at packaging respectively Reason drives the GPU of the GPU driving and kernel mode that there is user mode in the first operating system and the second operating system.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
When the GPU of the GPU driving and kernel mode that there is user mode in the first operating system and the second operating system drives When, according to preset boot sequence, start the operating system that sequence is first between the first operating system and the second operating system, and will GPU equipment is sequentially allocated the GPU driving to the GPU driving of the user mode of the first operating system of sequence and kernel mode, with Make the operating system control GPU equipment that sequence is first;
Interrupt the relations of distribution of the GPU driving of the kernel mode of GPU equipment and the first operating system;
Start between the first operating system and the second operating system the posterior operating system of sequence, and by GPU equipment be sequentially allocated to The GPU of the user mode of sequentially posterior operating system drives and the GPU of kernel mode driving, so that the posterior operation system of sequence System control GPU equipment.
4. according to the method in claim 2 or 3, which is characterized in that the state of GPU equipment of the first operating system control is The relations of distribution are established in the GPU driving of the user mode of GPU equipment and the first operating system and the GPU driving of kernel mode;
The graphics processor GPU equipment by the control of the first operating system is switched to off-line mode, comprising:
Interrupt the relations of distribution of the GPU driving of the kernel mode of GPU equipment and the first operating system;
It is described that the GPU equipment of off-line mode is provided to the second operating system, so that the GPU equipment is by the second operating system control System, comprising:
GPU equipment is sequentially allocated the GPU driving to the GPU driving of the user mode of the second operating system and kernel mode, with The second operating system is set to control GPU equipment.
5. according to the method described in claim 4, it is characterized in that, the graphics processor that the first operating system is controlled GPU equipment is switched to off-line mode, further includes:
After the relations of distribution of GPU driving for interrupting the kernel mode of GPU equipment and the first operating system, the first operating system is utilized The GPU driving of user mode receive to the operation requests of GPU equipment, and the operation requests are stored to predetermined cache area Domain.
6. according to the method described in claim 5, it is characterized in that, the method also includes:
After the first operating system controls GPU equipment again, the operation requests stored to predetermined cache region are handled.
7. a kind of control device of GPU equipment, which is characterized in that applied to including the first operating system and the second operating system Terminal device, the device include:
Offline drive module, when for detecting the switching request between the first operating system and the second operating system, by the first behaviour The graphics processor GPU equipment for making system control is switched to off-line mode;
System switching module, for executing the handover operation between the first operating system and the second operating system according to switching request;
Control switching module, for the GPU equipment of off-line mode to be provided to the second operating system so that the GPU equipment by The control of second operating system.
8. device according to claim 7, which is characterized in that described device includes:
Kernel packs module, for detecting that terminal device starts, respectively to former in the first operating system, the second operating system GPU driving carries out packing processes, makes to exist in the first operating system and the second operating system the GPU driving of user mode and interior The GPU of kernel normal form drives.
9. a kind of electronic equipment, characterized in that it comprises:
One or more processors;
Memory;
One or more application program, wherein one or more of application programs are stored in the memory and are configured To be executed by one or more of processors, one or more of programs are configured to: executing -6 according to claim 1 The control method of GPU equipment described in one.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor The control method of GPU equipment described in any one of claims 1-6 is realized when execution.
CN201810783072.6A 2018-07-17 2018-07-17 Control method, device and the electronic equipment of GPU equipment Pending CN109101283A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810783072.6A CN109101283A (en) 2018-07-17 2018-07-17 Control method, device and the electronic equipment of GPU equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810783072.6A CN109101283A (en) 2018-07-17 2018-07-17 Control method, device and the electronic equipment of GPU equipment

Publications (1)

Publication Number Publication Date
CN109101283A true CN109101283A (en) 2018-12-28

Family

ID=64846541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810783072.6A Pending CN109101283A (en) 2018-07-17 2018-07-17 Control method, device and the electronic equipment of GPU equipment

Country Status (1)

Country Link
CN (1) CN109101283A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442389A (en) * 2019-08-07 2019-11-12 北京技德系统技术有限公司 A kind of shared method using GPU of more desktop environments
CN110851055A (en) * 2019-11-08 2020-02-28 北京云迹科技有限公司 Robot, method, terminal equipment and storage medium for switching display
CN113110813A (en) * 2021-03-31 2021-07-13 联想(北京)有限公司 First electronic equipment and processing method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000536A (en) * 2006-01-13 2007-07-18 英业达股份有限公司 Display chip shared method
CN101782861A (en) * 2009-12-24 2010-07-21 华为终端有限公司 Management method and device of operation systems in embedded system
CN101901159A (en) * 2010-08-03 2010-12-01 中兴通讯股份有限公司 Method and system for loading Linux operating system on multi-core CPU
CN102447723A (en) * 2010-10-12 2012-05-09 运软网络科技(上海)有限公司 Client-side virtualization framework
CN103699444A (en) * 2013-12-17 2014-04-02 华为技术有限公司 CPU (central processing unit) hot plug implementing method and device
CN103902328A (en) * 2012-12-28 2014-07-02 联想(北京)有限公司 Information processing method and electronic device
CN106371890A (en) * 2016-08-29 2017-02-01 山东乾云启创信息科技股份有限公司 Simulation method of GPU (ground power unit)
CN106683035A (en) * 2015-11-09 2017-05-17 龙芯中科技术有限公司 GPU acceleration method and GPU acceleration device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000536A (en) * 2006-01-13 2007-07-18 英业达股份有限公司 Display chip shared method
CN101782861A (en) * 2009-12-24 2010-07-21 华为终端有限公司 Management method and device of operation systems in embedded system
CN101901159A (en) * 2010-08-03 2010-12-01 中兴通讯股份有限公司 Method and system for loading Linux operating system on multi-core CPU
CN102447723A (en) * 2010-10-12 2012-05-09 运软网络科技(上海)有限公司 Client-side virtualization framework
CN103902328A (en) * 2012-12-28 2014-07-02 联想(北京)有限公司 Information processing method and electronic device
CN103699444A (en) * 2013-12-17 2014-04-02 华为技术有限公司 CPU (central processing unit) hot plug implementing method and device
CN106683035A (en) * 2015-11-09 2017-05-17 龙芯中科技术有限公司 GPU acceleration method and GPU acceleration device
CN106371890A (en) * 2016-08-29 2017-02-01 山东乾云启创信息科技股份有限公司 Simulation method of GPU (ground power unit)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442389A (en) * 2019-08-07 2019-11-12 北京技德系统技术有限公司 A kind of shared method using GPU of more desktop environments
CN110442389B (en) * 2019-08-07 2024-01-09 北京技德系统技术有限公司 Method for sharing GPU (graphics processing Unit) in multi-desktop environment
CN110851055A (en) * 2019-11-08 2020-02-28 北京云迹科技有限公司 Robot, method, terminal equipment and storage medium for switching display
CN113110813A (en) * 2021-03-31 2021-07-13 联想(北京)有限公司 First electronic equipment and processing method

Similar Documents

Publication Publication Date Title
WO2018119951A1 (en) Gpu virtualization method, device, system, and electronic apparatus, and computer program product
CN109101283A (en) Control method, device and the electronic equipment of GPU equipment
US9778997B2 (en) Server backup method and backup system using the method
CN106844007A (en) A kind of virtual method and system based on spatial reuse
US9830181B2 (en) Method and system for gracefully shutdown virtual system
JP2011100431A (en) Device and method for controlling virtual machine
WO2019028682A1 (en) Multi-system shared memory management method and device
CN101765225A (en) Virtual cluster management system and cluster node
US20110107344A1 (en) Multi-core apparatus and load balancing method thereof
CN105786589A (en) Cloud rendering system, server and method
CN108958880B (en) Data processing method and data processing system
WO2011050683A1 (en) Method and device for displaying application image
KR20160033517A (en) Hybrid virtualization scheme for interrupt controller
CN103744716A (en) Dynamic interrupt balanced mapping method based on current virtual central processing unit (VCPU) scheduling state
CN106796530A (en) A kind of virtual method, device and electronic equipment, computer program product
WO2023093843A1 (en) Configuration device, scheduling device, configuration method, and scheduling method
CN107003875A (en) For the display methods of multiple operating system, device and electronic equipment
JP2022084869A (en) Scheduling method for deep learning framework, scheduling device, electronic equipment, storage medium, and program
CN110162397B (en) Resource allocation method, device and system
CN112328365A (en) Virtual machine migration method, device, equipment and storage medium
CN109542829B (en) Control method and device of GPU (graphics processing Unit) equipment in multiple systems and electronic equipment
WO2020192448A1 (en) Migration method and system of virtual machine
CN114528086A (en) Method, device, equipment and medium for thermal migration of pooled heterogeneous cloud computing application
CN111124599A (en) Virtual machine memory data migration method and device, electronic equipment and storage medium
CN111290837B (en) Method for constructing lightweight virtualization system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20181228

RJ01 Rejection of invention patent application after publication