WO2023273238A1 - 图形处理资源调配方法、装置、设备及存储介质 - Google Patents

图形处理资源调配方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023273238A1
WO2023273238A1 PCT/CN2021/140866 CN2021140866W WO2023273238A1 WO 2023273238 A1 WO2023273238 A1 WO 2023273238A1 CN 2021140866 W CN2021140866 W CN 2021140866W WO 2023273238 A1 WO2023273238 A1 WO 2023273238A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual
graphics processing
shared
resources
resource
Prior art date
Application number
PCT/CN2021/140866
Other languages
English (en)
French (fr)
Inventor
向达
刘宽
段江南
黄景平
Original Assignee
天翼云科技有限公司
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 天翼云科技有限公司 filed Critical 天翼云科技有限公司
Publication of WO2023273238A1 publication Critical patent/WO2023273238A1/zh

Links

Images

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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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

Definitions

  • the present application relates to the field of computer technology, and in particular, to a graphics processing resource allocation method, device, device, and readable storage medium.
  • Cloud computing is an increase, usage and delivery model of Internet-based related services that provides available, convenient, and on-demand network access.
  • Cloud computing usually involves providing dynamically scalable and virtualized resources through the Internet.
  • the computing nodes in the cloud computing data center are virtualized into several virtual machines, and remote users use the virtual resources in the cloud computing system through the network. machine.
  • OpenStack is a widely used and influential open source cloud computing management platform, which maintains and manages various cloud computing hardware resources, such as memory, central processing unit (Central Processing Unit, CPU) and so on. OpenStack supports the management of Graphic Processing Unit (GPU) resources from the Queen version, so that virtual machines with GPU can be created.
  • GPU Graphic Processing Unit
  • OpenStack allocates GPU resources, it adopts the method of configuring a fixed GPU resource for a virtual machine.
  • the cloud computing system may create many virtual machines according to the needs, and the GPU used is a relatively expensive processing unit, and a fixed GPU resource is configured for each virtual machine. Great waste.
  • the purpose of the present application is to provide a graphics processing resource allocation method, device, device, and readable storage medium, which can at least improve the utilization rate of GPU resources allocated for virtual machines to a certain extent.
  • a method for allocating graphics processing resources including: acquiring information about virtual graphics processing resources, where the virtual graphics processing resources include virtual shared resources for graphics processing, and the information about virtual graphics processing resources includes the The number of virtual shared resources for graphics processing and over-allocation parameters; creating a target shared virtual machine according to the number of virtual shared resources for graphics processing and the over-allocation parameters; obtaining shared virtual resources for graphics processing available in the virtual shared resources for graphics processing the information; allocate the graphics processing virtual shared resource to the target shared virtual machine according to the information of the available graphics processing shared virtual resource.
  • the creating the target shared virtual machine according to the number of the graphics processing virtual shared resources and the over-allocation parameters includes: acquiring the number of created shared virtual machines; judging the created shared virtual machines Whether the quantity is less than the product of the quantity of the graphics processing virtual shared resource and the over-allocation parameter; when the quantity of the created shared virtual machine is less than the quantity of the graphics processing virtual shared resource and the over-allocation parameter When multiplying, create the target shared virtual machine.
  • the obtaining the information of the available graphics processing shared virtual resources in the graphics processing virtual shared resources includes: obtaining the temperature of the graphics processor corresponding to the available graphics processing shared virtual resources; Allocating a graphics processing virtual shared resource to the target shared virtual machine according to the information of the available graphics processing shared virtual resources includes: sharing the graphics processing with the lowest temperature corresponding to a graphics processor among the available graphics processing shared virtual resources Virtual resources are allocated to the target shared virtual machine.
  • the obtaining the temperature of the graphics processor corresponding to the available graphics processing shared virtual resource includes: obtaining the temperature of the graphics processor through a monitoring component, and storing the temperature of the graphics processor in In the service monitoring database: acquiring the temperature of the graphics processor corresponding to the available graphics processing shared virtual resource from the service monitoring database through an interface of the service monitoring database.
  • the obtaining the information of the graphics processing shared virtual resources available in the graphics processing virtual shared resources includes: obtaining the status of the created shared virtual machine; When the status is shutdown, recycle the graphics processing shared virtual resources of the shutdown created shared virtual machine, obtain the information of the recycled graphics processing shared virtual resources; obtain the information of the unallocated graphics processing shared virtual resources; The information about shared virtual resources for graphics processing and the information about shared virtual resources for graphics processing that are not allocated are used as the information about shared virtual resources for graphics processing that are available.
  • the method further includes: in response to the power-on request of the target shared virtual machine in the power-off state, acquiring the number of shared virtual machines in the power-on state; determining the number of shared virtual machines in the power-on state Whether the number of machines is less than the number of the graphics processing virtual shared resources; when the number of the shared virtual machines in the power-on state is less than the number of the graphics processing virtual shared resources, perform the power-on operation of the target shared virtual machine.
  • the graphics processing virtual resources further include graphics processing virtual exclusive resources
  • the information of the graphics processing virtual resources further includes the number of the graphics processing virtual exclusive resources
  • the method further includes: In response to a request to create a target virtual machine, obtain the type of the target virtual machine; when the type of the target virtual machine is exclusive, obtain the number of created exclusive virtual machines; determine the created exclusive virtual machine Whether the number of virtual machines is less than the number of virtual exclusive resources for graphics processing; when the number of created exclusive virtual machines is less than the number of virtual exclusive resources for graphics processing, create a target exclusive virtual machine; obtain Information about unallocated exclusive virtual resources for graphics processing in the virtual exclusive resources for graphics processing; assign virtual exclusive resources for graphics processing to the target exclusive virtual machine according to the information about the unallocated exclusive virtual resources for graphics processing .
  • a device for allocating graphics processing resources including: a resource information acquisition module, configured to acquire information on graphics processing virtual resources, where the graphics processing virtual resources include graphics processing virtual shared resources, and the graphics
  • the information on processing virtual resources includes the number of virtual shared resources for graphics processing and over-allocation parameters;
  • the shared virtual machine creation module is used to create a target shared virtual machine according to the number of virtual shared resources for graphics processing and the over-allocation parameters;
  • the available resource acquisition module is used to obtain the information of the graphics processing shared virtual resources available in the graphics processing virtual shared resources;
  • the shared resource allocation module is used to share the information of the graphics processing shared virtual resources for the target according to the information of the available graphics processing shared virtual resources
  • the virtual machine allocates graphics processing virtual shared resources.
  • the shared virtual machine creation module includes: an already-created shared quantity acquisition module, configured to acquire the number of created shared virtual machines; a shared quantity limiting module, configured to determine the created shared virtual machine Whether the number of virtual machines is less than the product of the number of virtual shared resources for graphics processing and the over-allocation parameter; When the product of the number of virtual shared resources and the over-allocation parameter is processed, the target shared virtual machine is created.
  • the available resource obtaining module is further used to obtain the temperature of the graphics processor corresponding to the available graphics processing shared virtual resource; the shared resource allocation module is also used to allocate the available Among the graphics processing shared virtual resources, the graphics processing shared virtual resource corresponding to the graphics processor with the lowest temperature is allocated to the target shared virtual machine.
  • the available resource acquisition module includes: a graphics processor temperature acquisition module, configured to acquire the temperature of the graphics processor through a monitoring component, and store the temperature of the graphics processor in a service monitoring database Middle: a graphics processor temperature acquisition module, configured to acquire the temperature of the graphics processor corresponding to the available graphics processing shared virtual resource from the service monitoring database through the interface of the service monitoring database.
  • the available resource obtaining module includes: a state obtaining module, configured to obtain the state of the created shared virtual machine; a resource recovery module, configured to obtain the state of the created shared virtual machine When shutting down, recycle the graphics processing shared virtual resources of the shutdown created shared virtual machine, and obtain the information of the recycled graphics processing shared virtual resources; the unallocated shared resource acquisition module is used to obtain the unallocated graphics processing shared virtual resources resource information; the available resource acquisition module is further configured to use the recovered graphics processing shared virtual resource information and the unallocated graphics processing shared virtual resource information as the available graphics processing shared virtual resources information.
  • the device further includes: an acquisition module for the number of powered-on virtual machines, configured to acquire the number of shared virtual machines in the powered-on state in response to the power-on request of the target shared virtual machine in the powered-off state;
  • the power-on virtual machine number limiting module is used to determine whether the number of the shared virtual machines in the power-on state is less than the number of the graphics processing virtual shared resources; When the quantity is less than the quantity of the graphics processing virtual shared resource, perform the power-on operation of the target shared virtual machine.
  • the graphics processing virtual resources further include graphics processing virtual exclusive resources, and the information of the graphics processing virtual resources further includes the number of the graphics processing virtual exclusive resources;
  • the device further includes: A virtual machine type obtaining module, configured to obtain the type of the target virtual machine in response to a request for creating a target virtual machine; an exclusive quantity obtaining module has been created, used to obtain when the type of the target virtual machine is exclusive The number of created exclusive virtual machines; the exclusive number limit module, used to determine whether the number of the created exclusive virtual machines is less than the number of virtual exclusive resources for graphics processing; the exclusive virtual machine creation module, It is used to create a target exclusive virtual machine when the number of the created exclusive virtual machines is less than the number of the graphics processing virtual exclusive resources; an unallocated exclusive resource acquisition module is used to acquire the graphics processing virtual Information about unallocated graphics processing exclusive virtual resources in the exclusive resources; an exclusive resource allocation module, configured to allocate graphics processing virtual resources to the target exclusive virtual machine according to the information of the unallocated graphics processing exclusive virtual resources Exclusive resources.
  • a device including: a memory, a processor, and executable instructions stored in the memory and operable in the processor, and the processor executes the executable instructions When implementing any of the above methods.
  • a computer-readable storage medium on which computer-executable instructions are stored, and when the executable instructions are executed by a processor, any one of the above-mentioned methods is implemented.
  • the graphics processing resource allocation method createds a target shared virtual machine according to the number of graphics processing virtual shared resources and over-allocation parameters, and then uses the information of graphics processing shared virtual resources available in the graphics processing virtual shared resources as the target
  • the shared virtual machine allocates the virtual shared resource for graphics processing, so that the number of virtual machines exceeding the virtual shared resource for graphics processing can be created, and the utilization rate of the graphics processing resource is improved.
  • Fig. 1 shows a schematic diagram of a system structure in an embodiment of the present application.
  • FIG. 2 shows a flow chart of a method for allocating graphics processing resources in an embodiment of the present application.
  • Fig. 3 is a flow chart of a method for allocating exclusive graphics processing resources according to an exemplary embodiment.
  • FIG. 4 shows a schematic diagram of a virtual machine creation process according to FIG. 2 and FIG. 3 .
  • FIG. 5 shows a schematic diagram of the processing process of step S206 shown in FIG. 2 in an embodiment.
  • FIG. 6 shows a schematic diagram of the processing process of step S206 and step S208 shown in FIG. 2 in an embodiment.
  • Fig. 7 shows a method for allocating GPU resources when a virtual machine starts up according to an exemplary embodiment.
  • FIG. 8 shows a schematic diagram of a virtual machine startup process according to FIG. 6 and FIG. 7 .
  • Fig. 9 is an architecture diagram of a GPU resource allocation system according to an exemplary embodiment.
  • FIG. 10 shows a block diagram of an apparatus for allocating graphics processing resources in an embodiment of the present application.
  • FIG. 11 shows a block diagram of another device for allocating graphics processing resources in the embodiment of the present application.
  • FIG. 12 shows a schematic structural diagram of an electronic device in an embodiment of the present application.
  • Example embodiments will now be described more fully with reference to the accompanying drawings.
  • Example embodiments may, however, be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the concepts of example embodiments to those skilled in the art.
  • the drawings are merely schematic illustrations of the application and are not necessarily drawn to scale.
  • the same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted.
  • first, second, etc. are used for descriptive purposes only, and should not be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features.
  • “plurality” means at least two, such as two, three, etc., unless otherwise specifically defined.
  • the symbol “/” generally indicates that the contextual objects are an “or” relationship.
  • connection should be understood in a broad sense, for example, it can be electrically connected or can communicate with each other; it can be directly connected or indirectly connected through an intermediary.
  • OpenStack does not support the over-allocation of GPU resources. For example, if a computing node has 4 GPU graphics cards, if it is virtualized into 4 GPU resources, only 4 virtual machines with GPU graphics cards can be created at most. Each of the 4 virtual machines is not allocated a GPU resource fixedly, so that even if some of the 4 virtual machines are turned off, they will always occupy GPU resources, resulting in low utilization of GPU resources and waste of GPU resources.
  • the present application provides a method for allocating graphics processing resources, creating a target shared virtual machine according to the number of graphics processing virtual shared resources and over-allocation parameters, and then according to the information of graphics processing shared virtual resources available in the graphics processing virtual shared resources.
  • the target shared virtual machine allocates the virtual shared resource for graphics processing, so that the number of virtual machines exceeding the virtual shared resource for graphics processing can be created, and the utilization rate of the graphics processing resource is improved.
  • FIG. 1 shows an exemplary system architecture 10 to which the method for allocating graphics processing resources or the device for allocating graphics processing resources of the present application can be applied.
  • the system architecture 10 may include a terminal device 102 , a network 104 , a server 106 and a database 108 .
  • the terminal device 102 may be various electronic devices with a display screen and supporting input and output, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, wearable devices, virtual reality devices, smart homes, etc. .
  • the network 104 is used as a medium for providing a communication link between the terminal device 102 and the server 106 .
  • Network 104 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.
  • the server 106 may be a server or a server cluster providing various services, such as computing nodes in a cloud computing system, management platform services, and the like.
  • the database 108 can be a large database software placed on a server, or a small database software installed on a computer for storing data.
  • a user can use the terminal device 102 to interact with the server 106 and the database 108 through the network 104 to receive or send data and the like.
  • the user can use the terminal device 102 to input overconfiguration parameters, and transmit them to the management platform server 106 through the network 104 .
  • the user may use the terminal device 102 to send a request for creating a virtual machine to the management platform server 106 through the network 104 .
  • the user may obtain information such as the number of available GPU virtual resources from the database 108 at the terminal device 102 through the network 104 .
  • the server 106 can also receive data from the database 108 or send data to the database 108 through the network 104 .
  • the server 106 may be a cloud computing management platform server, and is used to obtain information such as the number of unallocated GPU virtual resources from the database 108 through the network 104, and then allocate GPU virtual resources.
  • the server 106 may be a computing node server, configured to send the GPU information of the computing node to the database 108 through the network 104 .
  • terminal devices, networks, servers and databases in Fig. 1 are only illustrative. According to the realization needs, there can be any number of terminal devices, networks, servers and databases.
  • Fig. 2 is a flow chart showing a method for allocating graphics processing resources according to an exemplary embodiment.
  • the method shown in FIG. 2 can be applied to, for example, the server side of the above-mentioned system, and can also be applied to the terminal device of the above-mentioned system.
  • the method 20 provided in the embodiment of the present application may include the following steps.
  • step S202 the information of the graphics processing virtual resource is acquired, the graphics processing virtual resource includes the graphics processing virtual shared resource, and the information of the graphics processing virtual resource includes the quantity of the graphics processing virtual shared resource and an over-allocation parameter.
  • the method shown in FIG. 2 can be implemented through the business management platform, and the cloud computing platform is managed by using the OpenStack project.
  • Nova is a core component of OpenStack and is responsible for maintaining and managing various cloud computing hardware resources, such as Memory, CPU, GPU, etc.
  • the nova-compute service of OpenStack is initialized when it starts, and the graphics card information contained in the current computing node is collected in the initialization program, including the model and number of GPUs, the virtual slice type of each GPU, and other information, and these information are recorded in OpenStack's
  • the logical abstraction is a virtual GPU (virtual GPU, vGPU) resource pool.
  • the upper-level business management console can obtain the GPU virtual resource information of each computing node from the vGPU resource pool by calling the nova native interface /v2/os-hypervisor s/detail.
  • graphics processing virtual resources may include graphics processing virtual shared resources (shared GPU resources or shared vGPUs) and graphics processing virtual exclusive resources (exclusive GPU resources or exclusive vGPUs), and GPU virtual exclusive resources Shared resources do not set over-allocation parameters, and GPU virtual shared resources set over-allocation parameters such as over-allocation ratio according to business conditions.
  • the over-allocation parameter refers to the parameter that indicates that the number of virtual machines with GPUs that can be created exceeds the number of GPU virtual resources.
  • the over-allocation ratio is the ratio of the number of virtual machines with GPUs that can be created to the number of GPU virtual resources.
  • the over-allocation ratio of shared GPU resources can be initially determined according to business requirements, and the parameters can be saved in the configuration center of the business management platform.
  • the over-allocation ratio can be adjusted according to the actual situation through later analysis of operating data.
  • the business management console After the business management console obtains the GPU virtual resource information of all computing nodes through the interface, it can plan according to the actual business scenario, set exclusive or shared tags for each GPU virtual resource, and record them in the database.
  • the method shown in 2 is the process of creating a virtual machine with a shared GPU, and the process of creating a virtual machine with an exclusive GPU can refer to FIG. 3 and FIG. 4 .
  • step S204 a target shared virtual machine is created according to the number of graphics processing virtual shared resources and the over-allocation parameters.
  • the number of created shared virtual machines can be obtained, and it is judged whether the number of created shared virtual machines is less than the product of the number of graphics processing virtual shared resources and the over-allocation parameter (over-allocation ratio).
  • the over-allocation parameter over-allocation ratio
  • the number of shared virtual machines that has been created is not less than the product of the number of shared virtual resources for graphics processing and the over-allocation parameter, it means that the number of shared virtual machines that has been created has reached the maximum number that can be created, and you can prompt lack of resources.
  • step S206 the information of the graphics processing shared virtual resources available in the graphics processing virtual shared resources is obtained.
  • unused shared GPU resources that have been allocated to virtual machines with shared GPUs but not actually used may be reclaimed, and then the reclaimed shared GPU resources may be combined with unallocated shared GPU resources
  • the available shared GPU resources are used to realize the over-allocation of shared GPU resources, and the specific implementation method can refer to FIG. 5 .
  • step S208 the graphics processing virtual shared resource is allocated to the target shared virtual machine according to the information of the available graphics processing shared virtual resource.
  • the temperature of the graphics processor corresponding to the available graphics processing shared virtual resource can be obtained, and then the graphics processing shared virtual resource corresponding to the graphics processor with the lowest temperature is selected and allocated to the target shared virtual machine.
  • graphics processing shared virtual resources corresponding to graphics processors with a lower temperature may also be selected and allocated to the target shared virtual machine, for example, a temperature threshold may be set, and graphics processors whose temperature is lower than the threshold Randomly select one of them, and allocate its corresponding graphics processing shared virtual resource to the target shared virtual machine.
  • the target shared virtual machine is created according to the number of graphics processing virtual shared resources and the over-allocation parameters, and then the information of the graphics processing shared virtual resources available in the graphics processing virtual shared resources is used as the target
  • the shared virtual machine allocates virtual shared resources for graphics processing, so that virtual machines that exceed the number of virtual shared resources for graphics processing can be created, which improves the utilization of graphics processing resources, maximizes the use of limited GPU resources, and reduces the cost budget of cluster deployment.
  • Fig. 3 is a flow chart of a method for allocating exclusive graphics processing resources according to an exemplary embodiment.
  • the method shown in FIG. 3 can be applied, for example, to the server side of the above-mentioned system, and can also be applied to the terminal device of the above-mentioned system.
  • the method 30 provided by the embodiment of the present application may include the following steps.
  • step S302 the quantity of virtual exclusive graphics processing resources is obtained.
  • the method for obtaining the information of the GPU virtual exclusive resources is similar to the method for obtaining the information of the GPU virtual shared resources, only distinguishing them on the resource tags, and the specific implementation method can refer to step S202.
  • step S304 in response to the request to create the target virtual machine, the type of the target virtual machine is acquired.
  • the method in FIG. 2 can be used to create a virtual machine and allocate GPU virtual resources.
  • step S306 when the type of the target virtual machine is an exclusive type, the number of created exclusive virtual machines is acquired.
  • step S308 it is determined whether the number of created exclusive virtual machines is less than the number of virtual exclusive resources for graphics processing.
  • step S310 when the number of created exclusive virtual machines is less than the number of virtual exclusive virtual resources for graphics processing, a target exclusive virtual machine is created. If the number of created exclusive virtual machines has reached the number of virtual exclusive resources for graphics processing, it will prompt that the resources are insufficient and no more creation will be performed.
  • step S312 information about unallocated virtual exclusive virtual resources for graphics processing among the exclusive virtual resources for graphics processing is obtained.
  • the information of the exclusive virtual resources for graphics processing may be, for example, the temperature of the physical GPU corresponding to the exclusive virtual resources for graphics processing, and the obtaining method may refer to step S206 in FIG. 2 .
  • step S314 the virtual dedicated graphics processing resource is allocated to the target dedicated virtual machine according to the information of the unallocated dedicated graphics processing virtual resource. Similar to the allocation of shared virtual resources for graphics processing in step S208 in FIG. 2 , the virtual resource of the GPU with the lowest temperature can be selected and allocated to the created target exclusive virtual machine. Refer to FIG. 6 for a specific implementation.
  • the graphics processing exclusive resource allocation method provided in the embodiment of the present application, by scheduling according to the remaining unallocated graphics processing virtual exclusive resources when creating an exclusive virtual machine, from all available exclusive GPU virtual resources , select the resource corresponding to the GPU with the lowest temperature and allocate it to the virtual machine, avoiding the situation that some graphics cards actually work for a long time but the temperature is already high, while some graphics cards actually work for a short time but the temperature is relatively low
  • a graphics card with a high temperature may be allocated to a virtual machine, resulting in an unbalanced load on the graphics card, thereby increasing the service life of the graphics card.
  • FIG. 4 shows a schematic diagram of a virtual machine creation process according to FIG. 2 and FIG. 3 .
  • the process starts (S402).
  • the service management station receives a request for creating a GPU virtual machine (S404)
  • it first determines whether to create an exclusive GPU virtual machine or a shared GPU virtual machine (S406).
  • the management console obtains the remaining available exclusive GPU resources (S410), and performs scheduling selection, for example, obtains the graphics card temperature corresponding to the exclusive GPU resources in real time by calling the Prometheus interface (S412), and selects from all available exclusive GPU pools An exclusive GPU resource corresponding to a GPU graphics card with the lowest temperature is allocated to the virtual machine (S414), and then the process ends (S416).
  • FIG. 5 shows a schematic diagram of the processing process of step S206 shown in FIG. 2 in an embodiment. As shown in FIG. 5 , available shared virtual resources for graphics processing can be obtained through the following steps.
  • step S502 the status of the created shared virtual machine is obtained.
  • the service management station can obtain the virtual machine with the identification (identification, id) by calling the nova virtual machine details query interface v2.1/servers/ ⁇ id ⁇ for each virtual machine with GPU The current status is on or off.
  • step S504 when the status of the created shared virtual machine is shut down, reclaim the graphics processing shared virtual resources of the shut down created shared virtual machine, and obtain information about the recycled graphics processing shared virtual resources.
  • step S506 information about unallocated shared virtual resources for graphics processing is obtained.
  • step S508 the recycled graphic processing shared virtual resource information and the unallocated graphic processing shared virtual resource information are used as the available graphic processing shared virtual resource information. If the created shared virtual machine is turned off, the GPU resources of the virtual machine are idle, and the business management console can recycle them, and combine them with unallocated shared GPU resources to form all available shared GPU resources.
  • idle shared GPU resources are reclaimed and redistributed to realize over-allocation of shared GPU resources.
  • FIG. 6 shows a schematic diagram of the processing process of step S206 and step S208 shown in FIG. 2 in an embodiment.
  • the method for allocating graphics processing shared virtual resources for the target shared virtual machine provided in the embodiment of the present application may include the following steps.
  • step S602 the temperature of the graphics processor is obtained through the monitoring component, and the temperature of the graphics processor is stored in the service monitoring database.
  • the open source monitoring component dcgm data center GPU manager, data center GPU manager
  • the open source monitoring component dcgm can be installed and deployed on the GPU server to manage and monitor the state of the GPU in a cluster environment, and collect the data of each graphics card GPU Running temperature (dcgm_gpu_temp), GPU power (dcgm_power_usage) and other information, and save these data to Prometheus (an open source service monitoring system and time series database in cloud computing).
  • step S604 the temperature of the graphics processor corresponding to the available shared virtual resource for graphics processing is acquired from the service monitoring database through the interface of the service monitoring database.
  • an endpoint (endpoint) and corresponding service (service) can be configured and created, and the interface /gpu/metrics/ ⁇ id ⁇ is exposed to the outside through Prometheus to provide access to the business management console, so that the business management console can obtain it through the interface To the real-time temperature, power and other information of each graphics card.
  • step S606 among the available shared virtual resources for graphics processing, the shared virtual resource for graphics processing corresponding to the lowest temperature of the graphics processor is allocated to the target shared virtual machine.
  • the temperature of the GPU operation is obtained in real time by calling the Prometheus interface, and the GPU graphics card with the lowest temperature is selected among all available GPU resources to allocate to the target shared virtual machine.
  • the graphics card temperature as a reference index for GPU resource scheduling to ensure that the GPU graphics card currently allocated to the virtual machine is relatively idle and has a short usage time, so that those graphics cards that are used for a long time and are relatively busy can be buffered. After reducing it, it can be allocated to the virtual machine, which can prevent a certain graphics card from being in a high-load working state all the time, realize the load balancing of the graphics card in use, and effectively extend the service life of the graphics card.
  • Fig. 7 shows a method for allocating GPU resources when a virtual machine starts up according to an exemplary embodiment.
  • the method shown in FIG. 7 can be applied, for example, to the server side of the above system, and can also be applied to the terminal device of the above system.
  • the method 70 provided by the embodiment of the present application may include the following steps.
  • step S702 in response to the power-on request of the target shared virtual machine in the power-off state, the number of shared virtual machines in the power-on state is obtained.
  • step S704 it is determined whether the number of shared virtual machines in the power-on state is smaller than the number of graphics processing virtual shared resources.
  • step S706 when the number of shared virtual machines in the power-on state is less than the number of graphics processing virtual shared resources, a power-on operation of the target shared virtual machine is performed.
  • GPU resources can be rescheduled and allocated when the virtual machine is started, and the scheduling logic is the same as when creating a virtual machine with a GPU.
  • the scheduling logic is the same as when creating a virtual machine with a GPU.
  • step S708 when the number of shared virtual machines in the power-on state is not less than the number of graphics processing virtual shared resources, intercept the power-on requests of the target shared virtual machine, and queue them in sequence according to the request time until there are other shared virtual machines. After the virtual machine releases the graphics processing virtual shared resource, the target shared virtual machine is powered on.
  • the service management station when the service management station executes the startup action on the shutdown target shared virtual machine with GPU, it can first determine whether it is an exclusive GPU virtual machine or a shared GPU virtual machine, if it is an exclusive GPU virtual machine , it can be started directly due to the one-to-one allocation of exclusive GPU resources. If it is a shared GPU virtual machine, go to step S702 in FIG. 7 .
  • the method for allocating shared virtual resources for graphics processing when a virtual machine is powered on by selecting the GPU graphics card with the lowest temperature among all available GPU resources and assigning it to the target shared virtual machine, it is possible to prevent a certain graphics card from working under high load all the time. state, to achieve load balancing of graphics cards in use.
  • FIG. 8 shows a schematic diagram of a virtual machine startup process according to FIG. 6 and FIG. 7 .
  • the process starts (S802).
  • the service management station receives a request to start the shutdown GPU virtual machine (S804), it determines whether the virtual machine that requests to start has an exclusive GPU or a shared GPU (S806).
  • Fig. 9 is an architecture diagram of a GPU resource allocation system according to an exemplary embodiment.
  • the service management platform 902 is used to create a GPU virtual machine and allocate GPU resources to it, and each computing node 906 manages the graphics card through a hypervisor (Hypervisor), and reports information such as GPU temperature and power to the vGPU resource pool 904.
  • the vGPU resource pool 904 includes the type (exclusive or shared) and status (idle or occupied, on or off, etc.) of each GPU virtual resource vGPU1, vGPU2, ..., vGPUn (n is a positive integer).
  • the number of GPU virtual machines created by the business management platform 902 may exceed the number of vGPU resources. For example, the business management platform 902 in FIG. The number of GPU virtual machines running at the same time does not exceed n.
  • Fig. 10 is a block diagram of an apparatus for allocating graphics processing resources according to an exemplary embodiment.
  • the apparatus shown in FIG. 10 may be applied to, for example, the server end of the above-mentioned system, and may also be applied to the terminal equipment of the above-mentioned system.
  • the apparatus 100 may include a resource information acquisition module 1002 , a shared virtual machine creation module 1004 , an available resource acquisition module 1006 and a shared resource allocation module 1008 .
  • the resource information obtaining module 1002 may be used to obtain information of virtual graphics processing resources, including virtual graphics processing shared resources, and the information of virtual graphics processing resources includes the number and over-allocation parameters of virtual graphics processing resources.
  • the shared virtual machine creating module 1004 may be configured to create a target shared virtual machine according to the number of graphics processing virtual shared resources and over-allocation parameters.
  • the available resource obtaining module 1006 may be configured to obtain information of available graphics processing shared virtual resources in the graphics processing virtual shared resources.
  • the shared resource allocation module 1008 may be configured to allocate virtual shared resources for graphics processing to the target shared virtual machine according to the information of available shared virtual resources for graphics processing.
  • Fig. 11 is a block diagram of another device for allocating graphics processing resources according to an exemplary embodiment.
  • the apparatus shown in FIG. 11 can be applied, for example, to the server end of the above-mentioned system, and can also be applied to the terminal equipment of the above-mentioned system.
  • the device 110 may include a resource information acquisition module 1102, a shared virtual machine creation module 1104, an available resource acquisition module 1106, a shared resource allocation module 1108, a boot virtual machine quantity acquisition module 11010, a boot virtual machine Quantity limitation module 11012, virtual machine startup module 11014, virtual machine type acquisition module 11016, created exclusive quantity acquisition module 11018, exclusive quantity limitation module 110110, exclusive virtual machine creation module 110112, unallocated exclusive resource acquisition module 110114 and an exclusive resource allocation module 110116, wherein the shared virtual machine creation module 1104 may include a created shared quantity acquisition module 11042, a shared quantity limit module 11044, and the available resource acquisition module 1106 may include a graphics processor temperature acquisition module 11062, a graphics processor Temperature acquisition module 11064 , status acquisition module 11066 , resource recovery module 11068 and unallocated shared resource acquisition module 110610 .
  • the resource information acquisition module 1102 can be used to acquire information about virtual resources for graphics processing.
  • Virtual resources for graphics processing include virtual shared resources for graphics processing and virtual exclusive resources for graphics processing.
  • Information about virtual resources for graphics processing includes the number and over-allocation of virtual shared resources for graphics processing. parameters and the number of virtual exclusive resources for graphics processing.
  • the shared virtual machine creating module 1104 may be configured to create a target shared virtual machine according to the number of graphics processing virtual shared resources and over-allocation parameters.
  • the shared virtual machine creation module 1104 is also configured to create a target shared virtual machine when the number of created shared virtual machines is less than the product of the number of graphics processing virtual shared resources and the over-allocation parameter.
  • the created sharing quantity obtaining module 11042 may be used to obtain the quantity of created shared virtual machines.
  • the shared number limiting module 11044 may be used to determine whether the number of created shared virtual machines is less than the product of the number of graphics processing virtual shared resources and the over-allocation parameter.
  • the available resource acquisition module 1106 may be configured to acquire information about available graphics processing shared virtual resources in the graphics processing virtual shared resources.
  • the available resource obtaining module 1106 is further configured to obtain the temperature of the graphics processor corresponding to the available shared virtual resource for graphics processing.
  • the graphics processor temperature acquisition module 11062 can be used to acquire the temperature of the graphics processor through the monitoring component, and store the temperature of the graphics processor in the service monitoring database.
  • the graphics processor temperature obtaining module 11064 may be configured to obtain the temperature of the graphics processor corresponding to the available shared virtual resource for graphics processing from the service monitoring database through an interface of the service monitoring database.
  • the state obtaining module 11066 may be used to obtain the state of the created shared virtual machine.
  • the resource reclamation module 11068 may be configured to reclaim the graphics processing shared virtual resources of the shutdown created shared virtual machine when the status of the created shared virtual machine is shutdown, and obtain information about the recycled graphics processing shared virtual resources.
  • the unallocated shared resource acquisition module 110610 can be used to acquire information about unallocated graphics processing shared virtual resources.
  • the available resource acquisition module 1106 may also be configured to use the recovered graphics processing shared virtual resource information and the unallocated graphics processing shared virtual resource information as the available graphics processing shared virtual resource information.
  • the shared resource allocation module 1108 may be configured to allocate the graphics processing virtual shared resource to the target shared virtual machine according to the information of the available graphics processing shared virtual resource.
  • the shared resource allocation module 1108 is further configured to allocate the graphics processing shared virtual resource with the lowest temperature corresponding to the graphics processor among the available graphics processing shared virtual resources to the target shared virtual machine.
  • the acquisition module 11010 for the number of powered-on virtual machines may be configured to acquire the number of shared virtual machines in the powered-on state in response to the power-on request of the target shared virtual machine in the powered-off state.
  • the limit module 11012 for the number of powered-on virtual machines can be used to determine whether the number of shared virtual machines in the powered-on state is smaller than the number of virtual graphics shared resources.
  • the virtual machine start-up module 11014 can be configured to perform a start-up operation of the target shared virtual machine when the number of shared virtual machines in the power-on state is less than the number of graphics processing virtual shared resources.
  • the virtual machine type obtaining module 11016 may be configured to obtain the type of the target virtual machine in response to the request for creating the target virtual machine.
  • the created exclusive number obtaining module 11018 may be used to obtain the number of created exclusive virtual machines when the type of the target virtual machine is exclusive.
  • the exclusive number limiting module 110110 can be used to determine whether the number of created exclusive virtual machines is less than the number of virtual exclusive resources for graphics processing.
  • the dedicated virtual machine creating module 110112 can be used to create a target dedicated virtual machine when the number of created dedicated virtual machines is less than the number of dedicated graphics processing virtual resources.
  • the unallocated exclusive resource acquisition module 110114 may be used to acquire information about unallocated exclusive virtual resources for graphics processing in the virtual exclusive resources for graphics processing.
  • the exclusive resource allocation module 110116 can be configured to allocate virtual exclusive resources for graphics processing to the target exclusive virtual machine according to the information of unallocated exclusive virtual resources for graphics processing.
  • FIG. 12 shows a schematic structural diagram of an electronic device in an embodiment of the present application. It should be noted that the device shown in FIG. 12 is only an example of a computer system, and should not impose any limitation on the functions and scope of use of the embodiments of the present application.
  • a device 1200 includes a central processing unit (CPU) 1201 that can operate according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage section 1208 into a random access memory (RAM) 1203 Various appropriate actions and processes are performed.
  • ROM read-only memory
  • RAM random access memory
  • various programs and data necessary for the operation of the device 1200 are also stored.
  • the CPU 1201, ROM 1202, and RAM 1203 are connected to each other via a bus 1204.
  • An input/output (I/O) interface 1205 is also connected to the bus 1204 .
  • the following components are connected to the I/O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 1208 including a hard disk, etc. and a communication section 1209 including a network interface card such as a LAN card, a modem, or the like.
  • the communication section 1209 performs communication processing via a network such as the Internet.
  • a drive 1210 is also connected to the I/O interface 1205 as needed.
  • a removable medium 1211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1210 as necessary so that a computer program read therefrom is installed into the storage section 1208 as necessary.
  • the processes described above with reference to the flowcharts can be implemented as computer software programs.
  • the embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flow charts.
  • the computer program may be downloaded and installed from a network via communication portion 1209 and/or installed from removable media 1211 .
  • this computer program is executed by a central processing unit (CPU) 1201
  • CPU central processing unit
  • the computer-readable medium shown in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that includes one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block in the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a A combination of dedicated hardware and computer instructions.
  • the modules involved in the embodiments described in the present application may be implemented by means of software or hardware.
  • the described modules can also be set in a processor, for example, it can be described as: a processor includes a resource information acquisition module, a data preprocessing module, a shared virtual machine creation module, an available resource acquisition module and a shared resource allocation module.
  • a processor includes a resource information acquisition module, a data preprocessing module, a shared virtual machine creation module, an available resource acquisition module and a shared resource allocation module.
  • the names of these modules do not constitute a limitation on the module itself under certain circumstances, for example, the resource information acquisition module can also be described as "a module that acquires GPU virtual resources from a resource pool".
  • the present application also provides a computer-readable medium.
  • the computer-readable medium may be contained in the device described in the above embodiments, or may exist independently without being assembled into the device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the device, the device includes:
  • graphics processing virtual resources include graphics processing virtual shared resources, graphics processing virtual resources information includes the number of graphics processing virtual shared resources and over-allocation parameters; according to the number of graphics processing virtual shared resources and over-allocation parameters Create a target shared virtual machine; acquire information about shared virtual resources for graphics processing available in the virtual shared resources for graphics processing; allocate virtual shared resources for graphics processing to the target shared virtual machine according to the information about shared virtual resources for graphics processing.

Landscapes

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

Abstract

本申请提供一种图形处理资源调配方法、装置、设备及存储介质,涉及计算机技术领域。该方法包括:获取图形处理虚拟资源的信息,所述图形处理虚拟资源包括图形处理虚拟共享资源,所述图形处理虚拟资源的信息包括所述图形处理虚拟共享资源的数量和超配参数;根据所述图形处理虚拟共享资源的数量和所述超配参数创建目标共享虚拟机;获取所述图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息;根据所述可用的图形处理共享虚拟资源的信息为所述目标共享虚拟机分配图形处理虚拟共享资源。该方法实现了图形处理虚拟共享资源的超配比,提高了图形处理资源的利用率。

Description

图形处理资源调配方法、装置、设备及存储介质
本申请要求在2021年6月29日提交中国专利局、申请号为202110725072.2、发明名称为“图形处理资源调配方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,具体而言,涉及一种图形处理资源调配方法、装置、设备及可读存储介质。
背景技术
云计算是一种基于互联网的相关服务的增加、使用和交付模式,这种模式提供可用的、便捷的、按需的网络访问。云计算通常涉及通过互联网来提供动态易扩展且虚拟化的资源,采用虚拟化技术,把云计算数据中心的计算节点虚拟化成为若干个虚拟机,远端用户通过网络使用云计算系统中的虚拟机。
OpenStack是一个应用广泛、具有影响力的开源云计算管理平台,维护和管理各种云计算硬件资源,如内存、中央处理器(Central Processing Unit,CPU)等。OpenStack从Queen版本开始支持对图形处理器(Graphic Processing Unit,GPU)资源的管理,从而可以创建出带GPU的虚拟机。OpenStack对GPU进行资源调配时,采用为一个虚拟机配置一个固定的GPU资源的方式。然而,云计算系统根据需要可能会创建很多个虚拟机,而使用的GPU是一个相对昂贵的处理部件,为每个虚拟机配置固定的GPU资源,GPU资源的利用率较低,造成GPU资源的极大浪费。
如上所述,如何提高虚拟机GPU资源的利用率成为亟待解决的问题。
在所述背景技术部分公开的上述信息仅用于加强对本申请的背景的理解,因此它可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
本申请的目的在于提供一种图形处理资源调配方法、装置、设备及可读存储介质,至少在一定程度上提高为虚拟机调配的GPU资源的利用率。
本申请的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本申请的实践而习得。
根据本申请的一方面,提供一种图形处理资源调配方法,包括:获取图形处理虚拟资源的信息,所述图形处理虚拟资源包括图形处理虚拟共享资源,所述图形处理虚拟资源的信息包括所述图形处理虚拟共享资源的数量和超配参数;根据所述图形处理虚拟共享资源的数量和所述超配参数创建目标共享虚拟机;获取所述图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息;根据所述可用的图形处理共享虚拟资源的信息为所述目标共享虚拟机分配图形处理虚拟共享资源。
根据本申请的一实施例,所述根据所述图形处理虚拟共享资源的数量和超配参数创建目标共享虚拟机包括:获取已创建的共享虚拟机的数量;判断所述已创建的共享虚拟机的数量是否小于所述图形处理虚拟共享资源的数量与所述超配参数的乘积;在所述已创建的共享虚拟机的数量小于所述图形处理虚拟共享资源的数量与所述超配参数的乘积时,创建所述目标共享虚拟机。
根据本申请的一实施例,所述获取所述图形处理虚拟共享资源中可用的图形处理共享虚拟资 源的信息包括:获取所述可用的图形处理共享虚拟资源对应的图形处理器的温度;所述根据所述可用的图形处理共享虚拟资源的信息为所述目标共享虚拟机分配图形处理虚拟共享资源包括:将所述可用的图形处理共享虚拟资源中对应的图形处理器的温度最低的图形处理共享虚拟资源分配给所述目标共享虚拟机。
根据本申请的一实施例,所述获取所述可用的图形处理共享虚拟资源对应的图形处理器的温度包括:通过监控组件获取图形处理器的温度,并将所述图形处理器的温度存储在服务监控数据库中;通过所述服务监控数据库的接口从所述服务监控数据库中获取所述可用的图形处理共享虚拟资源对应的图形处理器的温度。
根据本申请的一实施例,所述获取所述图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息包括:获取已创建的共享虚拟机的状态;在所述已创建的共享虚拟机的状态为关机时,对关机的已创建的共享虚拟机的图形处理共享虚拟资源进行回收,获得回收的图形处理共享虚拟资源的信息;获取未分配的图形处理共享虚拟资源的信息;将所述回收的图形处理共享虚拟资源的信息和所述未分配的图形处理共享虚拟资源的信息作为所述可用的图形处理共享虚拟资源的信息。
根据本申请的一实施例,所述方法还包括:响应于处于关机状态的所述目标共享虚拟机的开机请求,获取处于开机状态的共享虚拟机的数量;判断所述处于开机状态的共享虚拟机的数量是否小于所述图形处理虚拟共享资源的数量;在所述处于开机状态的共享虚拟机的数量小于所述图形处理虚拟共享资源的数量时,进行所述目标共享虚拟机的开机操作。
根据本申请的一实施例,所述图形处理虚拟资源还包括图形处理虚拟独享资源,所述图形处理虚拟资源的信息还包括所述图形处理虚拟独享资源的数量;所述方法还包括:响应于创建目标虚拟机请求,获取所述目标虚拟机的类型;在所述目标虚拟机的类型为独享型时,获取已创建的独享虚拟机的数量;判断所述已创建的独享虚拟机的数量是否小于所述图形处理虚拟独享资源的数量;在所述已创建的独享虚拟机的数量小于所述图形处理虚拟独享资源的数量时,创建目标独享虚拟机;获取所述图形处理虚拟独享资源中未分配的图形处理独享虚拟资源的信息;根据所述未分配的图形处理独享虚拟资源的信息为所述目标独享虚拟机分配图形处理虚拟独享资源。
根据本申请的再一方面,提供一种图形处理资源调配装置,包括:资源信息获取模块,用于获取图形处理虚拟资源的信息,所述图形处理虚拟资源包括图形处理虚拟共享资源,所述图形处理虚拟资源的信息包括所述图形处理虚拟共享资源的数量和超配参数;共享虚拟机创建模块,用于根据所述图形处理虚拟共享资源的数量和所述超配参数创建目标共享虚拟机;可用资源获取模块,用于获取所述图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息;共享资源分配模块,用于根据所述可用的图形处理共享虚拟资源的信息为所述目标共享虚拟机分配图形处理虚拟共享资源。
根据本申请的一实施例,所述共享虚拟机创建模块包括:已创建共享数量获取模块,用于获取已创建的共享虚拟机的数量;共享数量限制模块,用于判断所述已创建的共享虚拟机的数量是否小于所述图形处理虚拟共享资源的数量与所述超配参数的乘积;所述共享虚拟机创建模块,还用于在所述已创建的共享虚拟机的数量小于所述图形处理虚拟共享资源的数量与所述超配参数的乘积时,创建所述目标共享虚拟机。
根据本申请的一实施例,所述可用资源获取模块,还用于获取所述可用的图形处理共享虚拟资源对应的图形处理器的温度;所述共享资源分配模块,还用于将所述可用的图形处理共享虚拟资源中对应的图形处理器的温度最低的图形处理共享虚拟资源分配给所述目标共享虚拟机。
根据本申请的一实施例,所述可用资源获取模块,包括:图形处理器温度采集模块,用于通过监控组件获取图形处理器的温度,并将所述图形处理器的温度存储在服务监控数据库中;图形处理器温度获取模块,用于通过所述服务监控数据库的接口从所述服务监控数据库中获取所述可用的图形处理共享虚拟资源对应的图形处理器的温度。
根据本申请的一实施例,所述可用资源获取模块,包括:状态获取模块,用于获取已创建的共享虚拟机的状态;资源回收模块,用于在所述已创建的共享虚拟机的状态为关机时,对关机的 已创建的共享虚拟机的图形处理共享虚拟资源进行回收,获得回收的图形处理共享虚拟资源的信息;未分配共享资源获取模块,用于获取未分配的图形处理共享虚拟资源的信息;所述可用资源获取模块,还用于将所述回收的图形处理共享虚拟资源的信息和所述未分配的图形处理共享虚拟资源的信息作为所述可用的图形处理共享虚拟资源的信息。
根据本申请的一实施例,所述装置还包括:开机虚拟机数量获取模块,用于响应于处于关机状态的所述目标共享虚拟机的开机请求,获取处于开机状态的共享虚拟机的数量;开机虚拟机数量限制模块,用于判断所述处于开机状态的共享虚拟机的数量是否小于所述图形处理虚拟共享资源的数量;虚拟机开机模块,用于在所述处于开机状态的共享虚拟机的数量小于所述图形处理虚拟共享资源的数量时,进行所述目标共享虚拟机的开机操作。
根据本申请的一实施例,所述图形处理虚拟资源还包括图形处理虚拟独享资源,所述图形处理虚拟资源的信息还包括所述图形处理虚拟独享资源的数量;所述装置还包括:虚拟机类型获取模块,用于响应于创建目标虚拟机请求,获取所述目标虚拟机的类型;已创建独享数量获取模块,用于在所述目标虚拟机的类型为独享型时,获取已创建的独享虚拟机的数量;独享数量限制模块,用于判断所述已创建的独享虚拟机的数量是否小于所述图形处理虚拟独享资源的数量;独享虚拟机创建模块,用于在所述已创建的独享虚拟机的数量小于所述图形处理虚拟独享资源的数量时,创建目标独享虚拟机;未分配独享资源获取模块,用于获取所述图形处理虚拟独享资源中未分配的图形处理独享虚拟资源的信息;独享资源分配模块,用于根据所述未分配的图形处理独享虚拟资源的信息为所述目标独享虚拟机分配图形处理虚拟独享资源。
根据本申请的再一方面,提供一种设备,包括:存储器、处理器及存储在所述存储器中并可在所述处理器中运行的可执行指令,所述处理器执行所述可执行指令时实现如上述任一种方法。
根据本申请的再一方面,提供一种计算机可读存储介质,其上存储有计算机可执行指令,所述可执行指令被处理器执行时实现如上述任一种方法。
本申请的实施例提供的图形处理资源调配方法,根据图形处理虚拟共享资源的数量和超配参数创建目标共享虚拟机,然后根据图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息为目标共享虚拟机分配图形处理虚拟共享资源,从而可实现创建超过图形处理虚拟共享资源的数量的虚拟机,提高了图形处理资源的利用率。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本申请。
附图说明
通过参照附图详细描述其示例实施例,本申请的上述和其它目标、特征及优点将变得更加显而易见。
图1示出本申请实施例中一种系统结构的示意图。
图2示出本申请实施例中一种图形处理资源调配方法的流程图。
图3是根据一示例性实施例示出的一种图形处理独享资源调配方法的流程图。
图4根据图2和图3示出了一种虚拟机创建流程的示意图。
图5示出了图2中所示的步骤S206在一实施例中的处理过程示意图。
图6示出了图2中所示的步骤S206和步骤S208在一实施例中的处理过程示意图。
图7是根据一示例性实施例示出的一种虚拟机开机时的GPU资源调配方法。
图8根据图6和图7示出了一种虚拟机开机流程的示意图。
图9是根据一示例性实施例示出的一种GPU资源调配系统架构图。
图10示出本申请实施例中一种图形处理资源调配装置的框图。
图11示出本申请实施例中另一种图形处理资源调配装置的框图。
图12示出本申请实施例中一种电子设备的结构示意图。
具体实施方式
现在将参考附图更全面地描述示例实施例。然而,示例实施例能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施例使得本申请将更加全面和完整,并将示例实施例的构思全面地传达给本领域的技术人员。附图仅为本申请的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本申请的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本申请的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、装置、步骤等。在其它情况下,不详细示出或描述公知结构、方法、装置、实现或者操作以避免喧宾夺主而使得本申请的各方面变得模糊。
此外,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。符号“/”一般表示前后关联对象是一种“或”的关系。
在本申请中,除非另有明确的规定和限定,“连接”等术语应做广义理解,例如,可以是电连接或可以互相通讯;可以是直接相连,也可以通过中间媒介间接相连。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本申请中的具体含义。
如上所述,OpenStack不支持GPU资源的超配,比如一台计算节点有4块GPU显卡,若将其虚拟化为4个GPU资源,则最多只能创建出4台带GPU显卡的虚拟机,并未这4台虚拟机固定地各分配一个GPU资源,这样即使这4台虚拟机有些处于关机状态,也会一直占用着GPU资源,导致GPU资源的利用率低,造成GPU资源的浪费。
因此,本申请提供了一种图形处理资源调配方法,根据图形处理虚拟共享资源的数量和超配参数创建目标共享虚拟机,然后根据图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息为目标共享虚拟机分配图形处理虚拟共享资源,从而可实现创建超过图形处理虚拟共享资源的数量的虚拟机,提高了图形处理资源的利用率。
图1示出了可以应用本申请的图形处理资源调配方法或图形处理资源调配装置的示例性系统架构10。
如图1所示,系统架构10可以包括终端设备102、网络104、服务器106和数据库108。终端设备102可以是具有显示屏并且支持输入、输出的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机、台式计算机、可穿戴设备、虚拟现实设备、智能家居等等。网络104用以在终端设备102和服务器106之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。服务器106可以是提供各种服务的服务器或服务器集群等,例如云计算系统中的计算节点,管理平台服务等等。数据库108可以为置于服务器上的大型数据库软件,也可以为安装在计算机上的小型数据库软件,用于存储数据。
用户可以使用终端设备102通过网络104与服务器106和数据库108交互,以接收或发送数据等。例如用户可使用终端设备102输入超配参数,通过网络104传输到管理平台服务器106上。又例如用户可使用终端设备102通过网络104向管理平台服务器106发送创建虚拟机的请求。再例如用户可在终端设备102通过网络104从数据库108中获取可用GPU虚拟资源数量等信息。
在服务器106也可通过网络104从数据库108接收数据或向数据库108发送数据等。例如服务器106可为云计算管理平台服务器,用于通过网络104从数据库108获取未分配的GPU虚拟资源数量等信息,然后进行GPU虚拟资源分配。又例如服务器106可为计算节点服务器,用于将该计算节点的GPU信息通过网络104发送至数据库108。
应该理解,图1中的终端设备、网络、服务器和数据库的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络、服务器和数据库。
图2是根据一示例性实施例示出的一种图形处理资源调配方法的流程图。如图2所示的方法 例如可以应用于上述系统的服务器端,也可以应用于上述系统的终端设备。
参考图2,本申请实施例提供的方法20可以包括以下步骤。
在步骤S202中,获取图形处理虚拟资源的信息,图形处理虚拟资源包括图形处理虚拟共享资源,图形处理虚拟资源的信息包括图形处理虚拟共享资源的数量和超配参数。
在一些实施例中,图2所示的方法可以通过业务管理台来实施,采用OpenStack项目对云计算平台进行管理,nova是OpenStack的一个核心组件,负责维护和管理各种云计算硬件资源,如内存、CPU、GPU等等。对云计算平台中的GPU服务器进行管理,首先需要安装GPU虚拟化驱动程序,明确GPU虚拟化切片类型,并在nova的配置文件中进行配置。OpenStack的nova-compute服务启动时进行初始化,在初始化程序中收集当前计算节点包含的显卡信息,包括GPU的型号及数量、每块GPU的虚拟化切片类型等信息,并将这些信息记录到OpenStack的nova数据库compute_nodes表中,逻辑抽象为虚拟GPU(virtual GPU,vGPU)资源池。上层业务管理台可以通过调用nova原生接口/v2/os-hypervisor s/detail,从vGPU资源池中获取到每台计算节点的GPU虚拟资源信息。
在一些实施例中,图形处理虚拟资源可以包括图形处理虚拟共享资源(共享型GPU资源或共享型vGPU)和图形处理虚拟独享资源(独享型GPU资源或独享型vGPU),GPU虚拟独享资源不设置超配参数,GPU虚拟共享资源根据业务情况设置超配参数如超配比。超配参数是指表示可以创建的带有GPU的虚拟机的数量超过GPU虚拟资源的数量的参数,例如超配比为可以创建的带有GPU的虚拟机的数量与GPU虚拟资源的数量的比,云计算系统中vGPU资源池上线之前,可根据业务需求初步确定共享型GPU资源的超配比,并将该参数保存在业务管理台的配置中心。超配比可以通过后期分析运营数据根据实际情况进行调整。
业务管理台通过接口获取到所有计算节点的GPU虚拟资源信息后,可以根据实际业务场景进行规划,为每个GPU虚拟资源设置独享型或共享型标签,并记录在数据库中。在接收到创建目标虚拟机请求后,响应于创建目标虚拟机请求,可先获取待创建的目标虚拟机的类型,然后可按照独享型或共享型的逻辑进行创建及GPU虚拟资源分配,图2所示的方法为带有共享型GPU的虚拟机的创建流程,带有独享型GPU的虚拟机的创建流程可参照图3和图4。
在步骤S204中,根据图形处理虚拟共享资源的数量和超配参数创建目标共享虚拟机。
在一些实施例中,可获取已创建的共享虚拟机的数量,判断已创建的共享虚拟机的数量是否小于图形处理虚拟共享资源的数量与超配参数(超配比)的乘积,在已创建的共享虚拟机的数量小于图形处理虚拟共享资源的数量与超配参数的乘积时,创建目标共享虚拟机。例如,vGPU资源池中所有计算节点包含的vGPU的总数量为N(N为正整数),设置其中M1个vGPU为独享型,M2个vGPU为共享型,且共享型vGPU的超配比为R,那么该资源池最多可以创建出M1个带有独享型GPU的虚拟机和M2*R个带有共享型GPU的虚拟机,其中N=M1+M2,M1、M2为正整数,R为大于1的数,M2*R可为整数也可不为整数,若M2*R不为整数,则最多可创建出[M2*R](对M2*R取整)个带有共享型GPU的虚拟机。
在一些实施例中,在已创建的共享虚拟机的数量不小于图形处理虚拟共享资源的数量与超配参数的乘积时,说明已创建的共享虚拟机的数量已达到最大可创建数,可提示资源不足。
在步骤S206中,获取图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息。
在一些实施例中,例如,可对已分配给带有共享型GPU的虚拟机但实际未使用的共享型GPU资源进行回收,然后将回收的共享型GPU资源与未分配的共享型GPU资源组成可用的共享型GPU资源,以实现共享型GPU资源的超配使用,具体实施方式可参照图5。
在步骤S208中,根据可用的图形处理共享虚拟资源的信息为目标共享虚拟机分配图形处理虚拟共享资源。
在一些实施例中,例如,可获取可用的图形处理共享虚拟资源对应的图形处理器的温度,然后从中选取温度最低的图形处理器对应的图形处理共享虚拟资源分配给目标共享虚拟机,具体实施方式可参照图4及图6。
在一些实施例中,例如,也可选取温度较低的图形处理器对应的图形处理共享虚拟资源分配 给目标共享虚拟机,例如可设定一个温度阈值,从温度低于该阈值的图形处理器中随机选取一个,将其对应的图形处理共享虚拟资源分配给目标共享虚拟机。
根据本申请实施例提供的图形处理资源调配方法,根据图形处理虚拟共享资源的数量和超配参数创建目标共享虚拟机,然后根据图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息为目标共享虚拟机分配图形处理虚拟共享资源,从而可实现创建超过图形处理虚拟共享资源的数量的虚拟机,提高了图形处理资源的利用率,最大化利用有限的GPU资源,降低集群部署的成本预算。
图3是根据一示例性实施例示出的一种图形处理独享资源调配方法的流程图。如图3所示的方法例如可以应用于上述系统的服务器端,也可以应用于上述系统的终端设备。
参考图3,本申请实施例提供的方法30可以包括以下步骤。
在步骤S302中,获取图形处理虚拟独享资源的数量。获取GPU虚拟独享资源的信息的方法与获取GPU虚拟共享资源的信息的方法类似,仅在资源的标签上进行区分,具体实施方式可参照步骤S202。
在步骤S304中,响应于创建目标虚拟机请求,获取目标虚拟机的类型。在目标虚拟机的类型为独享型时,则可采用图2的方法创建虚拟机并分配GPU虚拟资源。
在步骤S306中,在目标虚拟机的类型为独享型时,获取已创建的独享虚拟机的数量。
在步骤S308中,判断已创建的独享虚拟机的数量是否小于图形处理虚拟独享资源的数量。
在步骤S310中,在已创建的独享虚拟机的数量小于图形处理虚拟独享资源的数量时,创建目标独享虚拟机。若已创建的独享虚拟机的数量已达到图形处理虚拟独享资源的数量,则提示资源不足,不再进行创建。
在步骤S312中,获取图形处理虚拟独享资源中未分配的图形处理独享虚拟资源的信息。图形处理独享虚拟资源的信息例如可以是图形处理独享虚拟资源对应的物理GPU的温度,获得方法可参照图2中的步骤S206。
在步骤S314中,根据未分配的图形处理独享虚拟资源的信息为目标独享虚拟机分配图形处理虚拟独享资源。与图2中的步骤S208中图形处理共享虚拟资源的分配类似,可从中选择温度最低的GPU的虚拟资源分配给创建的目标独享虚拟机,具体实施方式可参照图6。
根据本申请实施例提供的图形处理独享资源调配方法,通过在创建独享型虚拟机时,根据剩余未分配的图形处理虚拟独享资源来进行调度,从所有可用独享型GPU虚拟资源中,选择温度最低的GPU对应的资源分配给虚拟机使用,避免了当有些显卡的实际工作时长较长但温度已经很高,而有些显卡实际工作的时长并不长而温度还比较低的情况下,OpenStack随机调度时可能调度到温度高的显卡分配给虚拟机使用,造成的显卡的负载不均衡,从而提高了显卡的使用寿命。
图4根据图2和图3示出了一种虚拟机创建流程的示意图。如图4所示,流程开始(S402),业务管理台接收创建GPU虚拟机的请求(S404)时,首先判断要创建独享型GPU虚拟机还是共享型GPU虚拟机(S406)。若是创建独享型GPU虚拟机,则判断已创建的独享型GPU虚拟机数量是否已达到最大可创建数M1(S4082),若达到,则提示资源不足,结束流程(S416);否则,业务管理台获取所剩可用独享型GPU资源(S410),进行调度选择,例如通过调用Prometheus接口实时获取独享型GPU资源对应的显卡温度(S412),从所有可用独享型GPU池中,选择一块温度最低的GPU显卡对应的独享型GPU资源分配给虚拟机使用(S414),然后结束流程(S416)。若是创建共享型GPU虚拟机,则判断已创建的共享型GPU虚拟机数量是否已达到最大可创建数M2*R(S4086),若达到,则提示资源不足,结束流程(S416);否则,回收已分配但实际未使用的共享型GPU资源(S4086),结合未分配共享型GPU资源获取所有可用的共享型GPU资源(S410),然后通过调用Prometheus接口实时获取共享型GPU资源对应的显卡温度(S412),从所有可用共享型GPU池中,选择一块温度最低的GPU显卡对应的共享型GPU资源分配给虚拟机使用(S414),然后结束流程(S416),实现了共享型GPU资源的超配使用。
图5示出了图2中所示的步骤S206在一实施例中的处理过程示意图。如图5所示,可通过以下步骤获得可用的图形处理共享虚拟资源。
在步骤S502中,获取已创建的共享虚拟机的状态。
在一些实施例中,业务管理台可对每台带有GPU的虚拟机,通过调用nova虚拟机详情查询接口v2.1/servers/{id},获取到该标识(identification,id)的虚拟机当前所处状态为开机或关机。
在步骤S504中,在已创建的共享虚拟机的状态为关机时,对关机的已创建的共享虚拟机的图形处理共享虚拟资源进行回收,获得回收的图形处理共享虚拟资源的信息。
在步骤S506中,获取未分配的图形处理共享虚拟资源的信息。
在步骤S508中,将回收的图形处理共享虚拟资源的信息和未分配的图形处理共享虚拟资源的信息作为可用的图形处理共享虚拟资源的信息。若已创建的共享虚拟机处于关机状态,则该虚拟机的GPU资源处于闲置状态,业务管理台可以进行回收,再结合尚未分配的共享型GPU资源,组成所有可用共享型GPU资源。
根据本申请实施例提供的可用的图形处理共享虚拟资源方法,对闲置的共享型GPU资源进行回收再分配,实现共享型GPU资源的超配。
图6示出了图2中所示的步骤S206和步骤S208在一实施例中的处理过程示意图。如图6所示,在创建了目标共享虚拟机之后,本申请实施例提供的为目标共享虚拟机分配图形处理共享虚拟资源分配方法可以包括以下步骤。
在步骤S602中,通过监控组件获取图形处理器的温度,并将图形处理器的温度存储在服务监控数据库中。
在一些实施例中,可在GPU服务器上安装部署开源监控组件dcgm(data center GPU manager,数据中心GPU管理器)-exporter,用于在集群环境中管理和监视GPU的状态,采集每块显卡GPU运行的温度(dcgm_gpu_temp),GPU的功率(dcgm_power_usage)等信息,并将这些数据保存到Prometheus(一种云计算中开源的服务监控系统和时间序列数据库)中。
在步骤S604中,通过服务监控数据库的接口从服务监控数据库中获取可用的图形处理共享虚拟资源对应的图形处理器的温度。
在一些实施例中,可配置并创建端点(endpoint)以及对应的服务(service),通过Prometheus向外暴露接口/gpu/metrics/{id}提供业务管理台访问,使业务管理台能通过接口获取到每块显卡的实时温度、功率等信息。
在步骤S606中,将可用的图形处理共享虚拟资源中对应的图形处理器的温度最低的图形处理共享虚拟资源分配给目标共享虚拟机。
根据本申请实施例提供的图形处理共享虚拟资源分配方法,通过调用Prometheus接口实时获取GPU运行的温度,在所有可用GPU资源中选择温度最低的GPU显卡分配给目标共享虚拟机。引入显卡温度作为GPU资源调度的参考指标,保证当前分配给虚拟机的那块GPU显卡是比较空闲、使用时长较短的,从而可以让那些使用时长较长、比较繁忙的显卡得到缓冲,待温度降低后再分配给虚拟机,可避免某块显卡一直处于高负荷工作状态,实现显卡在使用上的负载均衡,可以有效延长显卡的使用寿命。
图7是根据一示例性实施例示出的一种虚拟机开机时的GPU资源调配方法。如图7所示的方法例如可以应用于上述系统的服务器端,也可以应用于上述系统的终端设备。
参考图7,本申请实施例提供的方法70可以包括以下步骤。
在步骤S702中,响应于处于关机状态的目标共享虚拟机的开机请求,获取处于开机状态的共享虚拟机的数量。
在步骤S704中,判断处于开机状态的共享虚拟机的数量是否小于图形处理虚拟共享资源的数量。
在步骤S706中,在处于开机状态的共享虚拟机的数量小于图形处理虚拟共享资源的数量时,进行目标共享虚拟机的开机操作。
在一些实施例中,虚拟机开机时可以重新调度分配GPU资源,调度逻辑和创建带有GPU的虚拟时的一致,具体实施方式可参照图2和图3。
在步骤S708中,在处于开机状态的共享虚拟机的数量不小于图形处理虚拟共享资源的数量 时,对目标共享虚拟机的开机请求进行拦截,按照请求的先后时间顺序进行排队,直到有其他共享虚拟机释放图形处理虚拟共享资源后,进行目标共享虚拟机的开机操作。
在一些实施例中,业务管理台对关机的带有GPU的目标共享虚拟机执行开机动作时,可首先判断是独享型GPU虚拟机还是共享型GPU虚拟机,若为独享型GPU虚拟机,则由于一对一分配了独享型GPU资源,可直接开机。若为共享型GPU虚拟机,则进入图7的步骤S702。
根据本申请实施例提供的虚拟机开机时的图形处理共享虚拟资源分配方法,通过在所有可用GPU资源中选择温度最低的GPU显卡分配给目标共享虚拟机,可避免某块显卡一直处于高负荷工作状态,实现显卡在使用上的负载均衡。
图8根据图6和图7示出了一种虚拟机开机流程的示意图。如图4所示,流程开始(S802),业务管理台接收对关机的GPU虚拟机开机的请求后(S804),判断请求开机的虚拟机带有独享型GPU还是共享型GPU(S806)。若是独享型GPU虚拟机,则可直接准备开机(S810);若是共享型GPU虚拟机,则需查询目前共享型GPU虚拟机开机运行的数量是否达到共享GPU资源的数量M2(S8082),若未达到则可以准备开机(S810),否则,开机需要排队等待(S8084),直到有其他共享型GPU虚拟机关机释放资源后方可准备开机。独享型GPU虚拟机和共享型GPU虚拟机开机时都会重新调度分配GPU资源,调度逻辑和创建GPU虚拟化时的一致,首先获取到所有可用GPU资源(S812),然后通过调用Prometheus接口实时获取GPU资源对应的显卡温度(S814),从所有可用GPU池中,选择一块温度最低的GPU显卡对应的独享型GPU资源分配给虚拟机(S816),然后对虚拟机执行开机(S818),结束流程(S820)。
图9是根据一示例性实施例示出的一种GPU资源调配系统架构图。如图9所示,业务管理平台902用于创建GPU虚拟机并为其分配GPU资源,各计算节点906通过超级监督者(Hypervisor)管理显卡,并将GPU温度、功率等信息上报到vGPU资源池904,vGPU资源池904中包括各GPU虚拟资源vGPU1、vGPU2、……、vGPUn(n为正整数)的类型(独享型或共享型)、状态(空闲或占用、开机或关机等)。业务管理平台902创建的GPU虚拟机的数量可以超过vGPU资源的数量,例如图9中业务管理平台902创建了2n个GPU虚拟机,而vGPU资源的数量为n,则超配比为2,且同时运行的GPU虚拟机的数量不超过n。
图10是根据一示例性实施例示出的一种图形处理资源调配装置的框图。如图10所示的装置例如可以应用于上述系统的服务器端,也可以应用于上述系统的终端设备。
参考图10,本申请实施例提供的装置100可以包括资源信息获取模块1002、共享虚拟机创建模块1004、可用资源获取模块1006和共享资源分配模块1008。
资源信息获取模块1002可用于获取图形处理虚拟资源的信息,图形处理虚拟资源包括图形处理虚拟共享资源,图形处理虚拟资源的信息包括图形处理虚拟共享资源的数量和超配参数。
共享虚拟机创建模块1004可用于根据图形处理虚拟共享资源的数量和超配参数创建目标共享虚拟机。
可用资源获取模块1006可用于获取图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息。
共享资源分配模块1008可用于根据可用的图形处理共享虚拟资源的信息为目标共享虚拟机分配图形处理虚拟共享资源。
图11是根据一示例性实施例示出的另一种图形处理资源调配装置的框图。如图11所示的装置例如可以应用于上述系统的服务器端,也可以应用于上述系统的终端设备。
参考图11,本申请实施例提供的装置110可以包括资源信息获取模块1102、共享虚拟机创建模块1104、可用资源获取模块1106、共享资源分配模块1108、开机虚拟机数量获取模块11010、开机虚拟机数量限制模块11012、虚拟机开机模块11014,虚拟机类型获取模块11016、已创建独享数量获取模块11018、独享数量限制模块110110、独享虚拟机创建模块110112、未分配独享资源获取模块110114和独享资源分配模块110116,其中,共享虚拟机创建模块1104可以包括已创建共享数量获取模块11042、共享数量限制模块11044,可用资源获取模块1106可以包括图形处理器温度采集模块11062、图形处理器温度获取模块11064、状态获取模块11066、资源 回收模块11068和未分配共享资源获取模块110610。
资源信息获取模块1102可用于获取图形处理虚拟资源的信息,图形处理虚拟资源包括图形处理虚拟共享资源和图形处理虚拟独享资源,图形处理虚拟资源的信息包括图形处理虚拟共享资源的数量和超配参数以及图形处理虚拟独享资源的数量。
共享虚拟机创建模块1104可用于根据图形处理虚拟共享资源的数量和超配参数创建目标共享虚拟机。
共享虚拟机创建模块1104还可用于在已创建的共享虚拟机的数量小于图形处理虚拟共享资源的数量与超配参数的乘积时,创建目标共享虚拟机。
已创建共享数量获取模块11042可用于获取已创建的共享虚拟机的数量。
共享数量限制模块11044可用于判断已创建的共享虚拟机的数量是否小于图形处理虚拟共享资源的数量与超配参数的乘积。
可用资源获取模块1106可用于获取图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息。
可用资源获取模块1106还可用于获取可用的图形处理共享虚拟资源对应的图形处理器的温度。
图形处理器温度采集模块11062可用于通过监控组件获取图形处理器的温度,并将图形处理器的温度存储在服务监控数据库中。
图形处理器温度获取模块11064可用于通过服务监控数据库的接口从服务监控数据库中获取可用的图形处理共享虚拟资源对应的图形处理器的温度。
状态获取模块11066可用于获取已创建的共享虚拟机的状态。
资源回收模块11068可用于在已创建的共享虚拟机的状态为关机时,对关机的已创建的共享虚拟机的图形处理共享虚拟资源进行回收,获得回收的图形处理共享虚拟资源的信息。
未分配共享资源获取模块110610可用于获取未分配的图形处理共享虚拟资源的信息。
可用资源获取模块1106还可用于将回收的图形处理共享虚拟资源的信息和未分配的图形处理共享虚拟资源的信息作为可用的图形处理共享虚拟资源的信息。
共享资源分配模块1108可用于根据可用的图形处理共享虚拟资源的信息为目标共享虚拟机分配图形处理虚拟共享资源。
共享资源分配模块1108还可用于将可用的图形处理共享虚拟资源中对应的图形处理器的温度最低的图形处理共享虚拟资源分配给目标共享虚拟机。
开机虚拟机数量获取模块11010可用于响应于处于关机状态的目标共享虚拟机的开机请求,获取处于开机状态的共享虚拟机的数量。
开机虚拟机数量限制模块11012可用于判断处于开机状态的共享虚拟机的数量是否小于图形处理虚拟共享资源的数量。
虚拟机开机模块11014可用于在处于开机状态的共享虚拟机的数量小于图形处理虚拟共享资源的数量时,进行目标共享虚拟机的开机操作。
虚拟机类型获取模块11016可用于响应于创建目标虚拟机请求,获取目标虚拟机的类型。
已创建独享数量获取模块11018可用于在目标虚拟机的类型为独享型时,获取已创建的独享虚拟机的数量。
独享数量限制模块110110可用于判断已创建的独享虚拟机的数量是否小于图形处理虚拟独享资源的数量。
独享虚拟机创建模块110112可用于在已创建的独享虚拟机的数量小于图形处理虚拟独享资源的数量时,创建目标独享虚拟机。
未分配独享资源获取模块110114可用于获取图形处理虚拟独享资源中未分配的图形处理独享虚拟资源的信息。
独享资源分配模块110116可用于根据未分配的图形处理独享虚拟资源的信息为目标独享虚拟机分配图形处理虚拟独享资源。
本申请实施例提供的装置中的各个模块的具体实现可以参照上述方法中的内容,此处不再赘述。
图12示出本申请实施例中一种电子设备的结构示意图。需要说明的是,图12示出的设备仅以计算机系统为示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图12所示,设备1200包括中央处理单元(CPU)1201,其可以根据存储在只读存储器(ROM)1202中的程序或者从存储部分1208加载到随机访问存储器(RAM)1203中的程序而执行各种适当的动作和处理。在RAM 1203中,还存储有设备1200操作所需的各种程序和数据。CPU1201、ROM 1202以及RAM 1203通过总线1204彼此相连。输入/输出(I/O)接口1205也连接至总线1204。
以下部件连接至I/O接口1205:包括键盘、鼠标等的输入部分1206;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分1207;包括硬盘等的存储部分1208;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分1209。通信部分1209经由诸如因特网的网络执行通信处理。驱动器1210也根据需要连接至I/O接口1205。可拆卸介质1211,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1210上,以便于从其上读出的计算机程序根据需要被安装入存储部分1208。
特别地,根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1209从网络上被下载和安装,和/或从可拆卸介质1211被安装。在该计算机程序被中央处理单元(CPU)1201执行时,执行本申请的系统中限定的上述功能。
需要说明的是,本申请所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的模块也可以设置在处理器中,例如,可以描述为:一种处理器包括资源信息获取模块、数据预处理模块、共享虚拟机创建模块、可用资源获取模块和共享资源分配模块。其中,这些模块的名称在某种情况下并不构成对该模块本身的限定,例如,资源信息获取模块还可以被 描述为“从资源池获取GPU虚拟资源的模块”。
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,使得该设备包括:
获取图形处理虚拟资源的信息,图形处理虚拟资源包括图形处理虚拟共享资源,图形处理虚拟资源的信息包括图形处理虚拟共享资源的数量和超配参数;根据图形处理虚拟共享资源的数量和超配参数创建目标共享虚拟机;获取图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息;根据可用的图形处理共享虚拟资源的信息为目标共享虚拟机分配图形处理虚拟共享资源。
以上具体地示出和描述了本申请的示例性实施例。应可理解的是,本申请不限于这里描述的详细结构、设置方式或实现方法;相反,本申请意图涵盖包含在所附权利要求的精神和范围内的各种修改和等效设置。

Claims (10)

  1. 一种图形处理资源调配方法,其特征在于,包括:
    获取图形处理虚拟资源的信息,所述图形处理虚拟资源包括图形处理虚拟共享资源,所述图形处理虚拟资源的信息包括所述图形处理虚拟共享资源的数量和超配参数;
    根据所述图形处理虚拟共享资源的数量和所述超配参数创建目标共享虚拟机;
    获取所述图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息;
    根据所述可用的图形处理共享虚拟资源的信息为所述目标共享虚拟机分配图形处理虚拟共享资源。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述图形处理虚拟共享资源的数量和超配参数创建目标共享虚拟机包括:
    获取已创建的共享虚拟机的数量;
    判断所述已创建的共享虚拟机的数量是否小于所述图形处理虚拟共享资源的数量与所述超配参数的乘积;
    在所述已创建的共享虚拟机的数量小于所述图形处理虚拟共享资源的数量与所述超配参数的乘积时,创建所述目标共享虚拟机。
  3. 根据权利要求1所述的方法,其特征在于,所述获取所述图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息包括:
    获取所述可用的图形处理共享虚拟资源对应的图形处理器的温度;
    所述根据所述可用的图形处理共享虚拟资源的信息为所述目标共享虚拟机分配图形处理虚拟共享资源包括:
    将所述可用的图形处理共享虚拟资源中对应的图形处理器的温度最低的图形处理共享虚拟资源分配给所述目标共享虚拟机。
  4. 根据权利要求3所述的方法,其特征在于,所述获取所述可用的图形处理共享虚拟资源对应的图形处理器的温度包括:
    通过监控组件获取图形处理器的温度,并将所述图形处理器的温度存储在服务监控数据库中;
    通过所述服务监控数据库的接口从所述服务监控数据库中获取所述可用的图形处理共享虚拟资源对应的图形处理器的温度。
  5. 根据权利要求1所述的方法,其特征在于,所述获取所述图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息包括:
    获取已创建的共享虚拟机的状态;
    在所述已创建的共享虚拟机的状态为关机时,对关机的已创建的共享虚拟机的图形处理共享虚拟资源进行回收,获得回收的图形处理共享虚拟资源的信息;
    获取未分配的图形处理共享虚拟资源的信息;
    将所述回收的图形处理共享虚拟资源的信息和所述未分配的图形处理共享虚拟资源的信息作为所述可用的图形处理共享虚拟资源的信息。
  6. 根据权利要求1所述的方法,其特征在于,还包括:
    响应于处于关机状态的所述目标共享虚拟机的开机请求,获取处于开机状态的共享虚拟机的数量;
    判断所述处于开机状态的共享虚拟机的数量是否小于所述图形处理虚拟共享资源的数量;
    在所述处于开机状态的共享虚拟机的数量小于所述图形处理虚拟共享资源的数量时,进行所述目标共享虚拟机的开机操作。
  7. 根据权利要求1所述的方法,其特征在于,所述图形处理虚拟资源还包括图形处理虚拟独享资源,所述图形处理虚拟资源的信息还包括所述图形处理虚拟独享资源的数量;
    所述方法还包括:
    响应于创建目标虚拟机请求,获取所述目标虚拟机的类型;
    在所述目标虚拟机的类型为独享型时,获取已创建的独享虚拟机的数量;
    判断所述已创建的独享虚拟机的数量是否小于所述图形处理虚拟独享资源的数量;
    在所述已创建的独享虚拟机的数量小于所述图形处理虚拟独享资源的数量时,创建目标独享虚拟机;
    获取所述图形处理虚拟独享资源中未分配的图形处理独享虚拟资源的信息;
    根据所述未分配的图形处理独享虚拟资源的信息为所述目标独享虚拟机分配图形处理虚拟独享资源。
  8. 一种图形处理资源调配装置,其特征在于,包括:
    资源信息获取模块,用于获取图形处理虚拟资源的信息,所述图形处理虚拟资源包括图形处理虚拟共享资源,所述图形处理虚拟资源的信息包括所述图形处理虚拟共享资源的数量和超配参数;
    共享虚拟机创建模块,用于根据所述图形处理虚拟共享资源的数量和所述超配参数创建目标共享虚拟机;
    可用资源获取模块,用于获取所述图形处理虚拟共享资源中可用的图形处理共享虚拟资源的信息;
    共享资源分配模块,用于根据所述可用的图形处理共享虚拟资源的信息为所述目标共享虚拟机分配图形处理虚拟共享资源。
  9. 一种设备,包括:存储器、处理器及存储在所述存储器中并可在所述处理器中运行的可执行指令,其特征在于,所述处理器执行所述可执行指令时实现如权利要求1至7任一项所述的方法。
  10. 一种计算机可读存储介质,其上存储有计算机可执行指令,其特征在于,所述可执行指令被处理器执行时实现如权利要求1至7任一项所述的方法。
PCT/CN2021/140866 2021-06-29 2021-12-23 图形处理资源调配方法、装置、设备及存储介质 WO2023273238A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110725072.2 2021-06-29
CN202110725072.2A CN113342534B (zh) 2021-06-29 2021-06-29 图形处理资源调配方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023273238A1 true WO2023273238A1 (zh) 2023-01-05

Family

ID=77481257

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/140866 WO2023273238A1 (zh) 2021-06-29 2021-12-23 图形处理资源调配方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN113342534B (zh)
WO (1) WO2023273238A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342534B (zh) * 2021-06-29 2024-01-02 天翼云科技有限公司 图形处理资源调配方法、装置、设备及存储介质
CN114661465A (zh) * 2022-03-17 2022-06-24 维塔科技(北京)有限公司 资源管理的方法、装置、存储介质及电子设备
CN114880077A (zh) * 2022-05-16 2022-08-09 阿里巴巴(中国)有限公司 资源调度方法、设备及存储介质
CN115328666B (zh) * 2022-10-14 2023-07-14 浪潮电子信息产业股份有限公司 设备调度方法、系统、电子设备及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105094947A (zh) * 2015-07-28 2015-11-25 中国联合网络通信集团有限公司 一种虚拟计算资源的配额管理方法及系统
CN109144706A (zh) * 2017-06-15 2019-01-04 阿里巴巴集团控股有限公司 一种cpu资源的动态分配方法、装置及物理机
CN111209115A (zh) * 2020-01-08 2020-05-29 北京和信创天科技股份有限公司 云桌面vGPU超分配方法
CN112667364A (zh) * 2021-01-05 2021-04-16 烽火通信科技股份有限公司 绑核与非绑核虚拟混合部署方法、装置、设备及存储介质
CN113342534A (zh) * 2021-06-29 2021-09-03 中国电信股份有限公司 图形处理资源调配方法、装置、设备及存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9069622B2 (en) * 2010-09-30 2015-06-30 Microsoft Technology Licensing, Llc Techniques for load balancing GPU enabled virtual machines
US9417929B2 (en) * 2012-12-20 2016-08-16 Vmware, Inc. Runtime profile determinations of virtual machines for graphics processing unit (GPU) allocation
CN105242957A (zh) * 2015-09-28 2016-01-13 广州云晫信息科技有限公司 一种云计算系统调配gpu资源到虚拟机的方法及系统
CN105589751B (zh) * 2015-11-27 2019-03-15 新华三技术有限公司 一种物理资源调度方法及装置
CN105511944B (zh) * 2016-01-07 2018-09-28 上海海事大学 一种云系统内部虚拟机的异常检测方法
CN110413377A (zh) * 2019-07-29 2019-11-05 北京百度网讯科技有限公司 共享专用处理资源的方法、装置、设备和存储介质
CN111047505A (zh) * 2019-12-20 2020-04-21 北京浪潮数据技术有限公司 一种gpu复用方法、装置、设备及可读存储介质
CN111124687B (zh) * 2019-12-30 2022-04-22 浪潮电子信息产业股份有限公司 一种cpu资源预留方法、装置及其相关设备
CN112286645B (zh) * 2020-12-29 2021-03-23 北京泽塔云科技股份有限公司 一种gpu资源池调度系统及方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105094947A (zh) * 2015-07-28 2015-11-25 中国联合网络通信集团有限公司 一种虚拟计算资源的配额管理方法及系统
CN109144706A (zh) * 2017-06-15 2019-01-04 阿里巴巴集团控股有限公司 一种cpu资源的动态分配方法、装置及物理机
CN111209115A (zh) * 2020-01-08 2020-05-29 北京和信创天科技股份有限公司 云桌面vGPU超分配方法
CN112667364A (zh) * 2021-01-05 2021-04-16 烽火通信科技股份有限公司 绑核与非绑核虚拟混合部署方法、装置、设备及存储介质
CN113342534A (zh) * 2021-06-29 2021-09-03 中国电信股份有限公司 图形处理资源调配方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN113342534B (zh) 2024-01-02
CN113342534A (zh) 2021-09-03

Similar Documents

Publication Publication Date Title
WO2023273238A1 (zh) 图形处理资源调配方法、装置、设备及存储介质
CN108351772B (zh) 跨应用实例的标识符
WO2019205371A1 (zh) 服务器、消息分配的方法及存储介质
US9098578B2 (en) Interactive search monitoring in a virtual machine environment
US8631405B2 (en) Identification and placement of new virtual machines based on similarity of software configurations with hosted virtual machines
US8650563B2 (en) Identification and placement of new virtual machines to reduce memory consumption based on shared images with hosted virtual machines
US9223623B2 (en) Dynamic service resource control
US20090210527A1 (en) Virtual Machine Management Apparatus, and Virtual Machine Management Method and Program
CN111679911B (zh) 云环境中gpu卡的管理方法、装置、设备及介质
CN113934464A (zh) Linux系统中启动安卓应用的方法、装置和电子设备
KR20110049429A (ko) 가상화 솔루션의 관리 시스템, 관리 서버, 및 그 방법
CN102622264A (zh) 一种云计算中多虚拟化计算平台方法
CN112825042A (zh) 资源管理方法和装置、电子设备及存储介质
CN110162397B (zh) 资源分配方法、装置及系统
CN113419846B (zh) 资源配置方法和装置、电子设备及计算机可读存储介质
CN114077367A (zh) Linux系统中实现安卓应用快捷方式的方法和装置
CN111475256A (zh) 资源分配方法、装置及系统
US10318343B2 (en) Migration methods and apparatuses for migrating virtual machine including locally stored and shared data
CN112269628A (zh) 资源调度系统及方法
US11347541B2 (en) Methods and apparatus for virtual machine rebalancing
CN107045452B (zh) 虚拟机调度方法和装置
US11868805B2 (en) Scheduling workloads on partitioned resources of a host system in a container-orchestration system
CN113076175B (zh) 用于虚拟机的内存共享方法及装置
CN108762891A (zh) 一种云平台资源调度方法和装置
KR102064466B1 (ko) 가상화 시스템에서의 가상 데스크톱을 할당하는 방법 및 그 가상화 시스템

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21948163

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE