GPU video memory isolation method and device based on Kubernetes, medium and product

By using Device Plugin and Scheduler on the Kubernetes platform, the computing API and graphics API are hijacked to achieve efficient management and isolation of GPU memory resources, which solves the challenge of rendering-intensive applications on the memory requirements and ensures stable operation of applications and resource utilization. Reasonable distribution.

CN118796352APending Publication Date: 2024-10-18YAOKE INTELLIGENT TECH SHANGHAI CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410796724.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing containerized video memory isolation methods are difficult to effectively manage the demand for GPU video memory from rendering-intensive applications, leading to resource conflicts and performance degradation. Especially in emerging application scenarios such as the Metaverse and digital twins, video memory management is more complex and cannot be met by existing technologies. Unified management and efficient scheduling requirements for computing and rendering-intensive applications.

Method used

Adopt the Kubernetes-based GPU memory isolation method, obtain video memory information through Device Plugin, configure containerized application parameters, use Scheduler to schedule video memory resources, hijack computing APIs and graphics APIs, implement video memory allocation and monitoring, and ensure that parallel computing and rendering programs are fair and Allocate and use video memory resources efficiently.

Benefits of technology

It achieves efficient management and isolation of GPU memory resources, ensures stable operation of rendering-intensive applications and reasonable allocation of memory resources, avoids resource conflicts and performance degradation, and improves system flexibility and fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796352A_ABST
    Figure CN118796352A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of image processing, and discloses a Kubernetes-based GPU video memory isolation method and device, a medium and a product. The method comprises the following steps: initializing a configuration file, and setting parameters of a GPU driver and a plug-in; the Device Plug obtains video memory information, and calls the NVML to automatically detect the current available video memory amount on the node; configuring containerized application program parameters, and setting a video memory type and a video memory amount required by a user; the containerized application program is started, and the video memory application is processed through Device Plug; judging a node which meets the video memory application by Device Plug, and scheduling the node to a corresponding node by Scheduler; if the nodes meeting the video memory application do not exist, the Pod is placed in a Pending state, and the condition meeting the video memory application is waited to appear. The technical problem of insufficient distribution of video memory management can be at least solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a GPU video memory isolation method, device, medium and product based on Kubernetes. Background Art

[0002] In modern computing technology, containerized deployment has become a widely used technical means, especially when dealing with rendering-intensive applications, such as advanced graphics processing and game rendering (such as Vulkan, OpenGL). These applications need to frequently create and destroy a large number of temporary graphics objects in the video memory to generate complex scenes and special effects. Each graphics object, such as textures, vertices, and triangles, requires space in the video memory. These requirements bring huge challenges to video memory management.

[0003] Existing containerized video memory isolation methods mainly manage video memory allocation by hijacking the computing API. These methods can meet the video memory requirements of computing-intensive applications. However, for rendering-intensive applications, these methods cannot effectively solve the need to apply for video memory through graphics APIs (such as Vulkan and OpenGL). In these scenarios, the requirements for video memory management are more complex and changeable, and efficient management and isolation are required when allocating and releasing video memory to prevent resource conflicts and performance degradation.

[0004] Emerging application scenarios such as the Metaverse and digital twins require not only computing-intensive tasks, but also rendering-intensive tasks at the same time. Applications in these scenarios have a more urgent demand for GPU memory, and a new memory management method is needed that can achieve efficient management and isolation of memory on the Kubernetes platform, meet the needs of multiple containers sharing the same graphics card, and ensure the reasonable allocation and use of memory resources, and avoid unexpected container exits due to memory preemption. Therefore, in view of the shortcomings of existing technologies in memory management, especially the problem of not being able to meet the needs of rendering-intensive applications, a new GPU memory management method is urgently needed to achieve unified management and efficient scheduling of computing and rendering-intensive applications, to ensure the stable operation of applications and efficient use of memory resources. Summary of the invention

[0005] One purpose of the present application is to provide a Kubernetes-based GPU video memory isolation method, device, medium and product, at least to solve the technical problem of insufficient video memory management allocation.

[0006] To achieve the above objectives, some embodiments of the present application provide the following aspects:

[0007] In the first aspect, some embodiments of the present application also provide a GPU video memory isolation method based on Kubernetes, the method comprising: initializing the configuration file, setting the parameters of the GPU driver and plug-in; the Device Plugin obtains the video memory information, and calls NVML to automatically detect the amount of video memory currently available on the node; configures the containerized application parameters, and sets the video memory type and amount required by the user; starts the containerized application, and processes the video memory application through the Device Plugin; the Device Plugin determines the node that meets the video memory application, and the Scheduler schedules it to the corresponding node; if there is no node that meets the video memory application, the Pod is placed in the Pending state, waiting for the conditions that meet the video memory application to appear.

[0008] In a second aspect, some embodiments of the present application further provide an electronic device, comprising: one or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed, cause the processor to perform the steps of the method described above.

[0009] In a third aspect, some embodiments of the present application further provide a computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method as described above.

[0010] In a fourth aspect, some embodiments of the present application further provide a computer program product, comprising a computer program / instruction, which implements the steps of the method described above when executed by a processor.

[0011] Compared with the related art, the solution provided in the embodiment of the present application realizes video memory allocation and monitoring at the graphics driver level by hijacking the computing API and graphics API under Kubernetes. This method can not only hijack the computing API call, but also effectively manage the video memory allocation performed through the graphics API. In this way, it can be ensured that parallel computing programs and real-time rendering programs can allocate and use video memory resources fairly and efficiently in the Kubernetes cluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0013] Figure 1 This is a schematic diagram of the overall process of a GPU memory isolation method based on Kubernetes provided according to the first embodiment of the present application;

[0014] Figure 2 A complete flow chart of a GPU memory isolation method based on Kubernetes provided according to the second embodiment of the present application;

[0015] Figure 3 A schematic diagram of a hijacking process according to the third embodiment of the present application;

[0016] Figure 4 A schematic diagram of the structure of a GPU memory isolation architecture based on Kubernetes provided according to the fourth embodiment of the present application;

[0017] Figure 5 The present invention is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0019] The following terms are used in this article.

[0020] Kubernetes: is an open source container orchestration platform for automatically deploying, scaling, and managing containerized applications. It provides functions such as container orchestration, service discovery, load balancing, automatic scaling, and rolling updates to help users simplify the management and operation of containerized applications.

[0021] Device Plugin: It is a component in Kubernetes that is used to manage and allocate special hardware resources on cluster nodes, such as GPUs, FPGAs, etc. Device Plugin enables Kubernetes to identify and manage these special hardware resources by registering resources, reporting resource usage, and processing resource allocation requests.

[0022] Scheduler: It is the scheduler component in Kubernetes, responsible for allocating the Pods to be scheduled to the appropriate nodes in the cluster. The Scheduler selects the best node to run each Pod based on factors such as resource requirements, node health, and scheduling strategies, ensuring efficient use of cluster resources and load balancing.

[0023] Pod: It is the smallest deployable unit in Kubernetes, representing one or more container groups that share the same network namespace and storage volume. Containers within a Pod can communicate with each other, share storage, and be scheduled and managed together. Pod is usually used to deploy and run a single application instance or service component.

[0024] NVML (NVIDIA Management Library): is a library provided by NVIDIA for monitoring and managing NVIDIA GPU devices. NVML provides an API interface that allows users to obtain GPU status information, such as video memory usage, temperature, power status, etc., and perform basic management operations, such as setting the GPU working mode.

[0025] CUDA (Compute Unified Device Architecture): is a parallel computing platform and programming model developed by NVIDIA that allows developers to use NVIDIA GPUs for general computing. CUDA extends the C, C++, and Fortran programming languages ​​to enable developers to write parallel computing codes, significantly improving the performance of compute-intensive applications.

[0026] Vulkan: is a modern cross-platform graphics and computing API that provides low-overhead, efficient graphics and computing capabilities. Vulkan was developed by the Khronos Group to provide closer control over the hardware and improve the performance and scalability of graphics and computing applications. It is widely used in game development, high-performance computing, and real-time rendering.

[0027] First embodiment

[0028] The first embodiment of the present application relates to a GPU memory isolation method based on Kubernetes.

[0029] like Figure 1 As shown, the method may include the following steps:

[0030] S101, initializing the configuration file and setting the parameters of the GPU driver and plug-in;

[0031] S102, Device Plugin obtains video memory information and calls NVML to automatically detect the amount of video memory currently available on the node;

[0032] S103, configuring containerized application parameters, and setting the video memory type and amount required by the user;

[0033] S104, starting the containerized application;

[0034] S105, Device Plugin processes the video memory application; Device Plugin determines the node that meets the video memory application, and Scheduler schedules it to the corresponding node; if there is no node that meets the video memory application, the Pod is placed in the Pending state, waiting for the condition that meets the video memory application to appear.

[0035] The following is a detailed description of each of the above steps.

[0036] In step S101, the working parameters of the GPU driver and the plug-in can be pre-set by initializing the configuration file. These parameters include the size of the video memory pool, priority rules, and video memory isolation strategy, etc., to ensure that the GPU resources can be correctly identified and managed when the system starts.

[0037] In step S102, the Device Plugin automatically detects the video memory usage on the node by calling the NVML library. The NVML library provides detailed video memory usage information, including total video memory, used video memory, and remaining video memory, which will be used to determine whether the node can meet the video memory application.

[0038] In step S103, the user configures the graphics memory parameters of the containerized application according to the application requirements. By accurately setting the graphics memory type and amount, it is ensured that each containerized application has sufficient graphics memory resources when running, avoiding performance problems or program crashes caused by insufficient graphics memory.

[0039] In step S104, containerized applications are started, and the Scheduler begins to schedule these applications and attempts to allocate them to nodes with sufficient video memory resources.

[0040] Finally, in step S105, the Device Plugin processes the video memory application and determines whether the video memory resources on the node meet the application requirements. If so, the Scheduler schedules the application to the node; if not, the Pod will be placed in the Pending state and wait for the resources to meet the conditions before scheduling. The Device Plugin periodically rechecks the video memory resources to ensure that the scheduling operation is performed immediately once the conditions are met.

[0041] It is not difficult to find that compared with the related technologies, the Kubernetes-based GPU memory isolation method provided in the embodiment of the present application effectively solves the problem of memory resource allocation in containerized deployment, especially the memory management requirements for rendering-intensive applications.

[0042] Second embodiment

[0043] The second embodiment of the present application relates to a GPU memory isolation method based on Kubernetes. The second implementation method is an improvement on the first embodiment. Figure 2 As shown, the specific improvements are:

[0044] Initialize the configuration file: configure GPU driver parameters, including memory pool size, priority rules, and memory isolation policy; set the GPU working mode to determine the computing mode, graphics mode, or hybrid mode; specify the GPU resource name in the Device Plugin so that the Device Plugin can correctly identify and manage GPU resources; install the Kubernetes cluster through kubeadm; apply the GPU configuration file to install the driver and set the corresponding labels in the cluster; configure and install the KubernetesDevice Plugin; customize the memory resource name in the Scheduler configuration file; install the Device Plugin and Scheduler in Pod form through kubectl apply.

[0045] Device Plugin obtains video memory information: Use Kubectl to check whether the corresponding Pods of Device Plugin and Scheduler are running normally to ensure that GPU-related services are running normally. If not, check the corresponding configuration file parameters and reinstall them. Device Plugin queries the GPU status on the node to obtain the amount of video memory used and the total amount of video memory in the current cluster.

[0046] Configure containerized applications: define Custom Resource Definition (CRD) to declare the amount of video memory requested by the application; set the ResourceQuota of each application, that is, the upper limit of the amount of video memory that the application can request; set the LimitRange of each application, that is, the lower limit of the amount of video memory that the application can use; CRD triggers the Device Plugin Pod to determine whether the remaining amount of video memory meets the application; after the determination is completed, update the status of the corresponding CRD to success or failure; if the result is failure, you need to delete the CRD or wait for the Device Plugin Pod to re-determine periodically.

[0047] Start the containerized application: The Scheduler communicates with the Device Plugin Pod, checks the video memory resources on the node, and schedules the Pod to a node that meets the resource requirements through the scheduling algorithm; after the container is started, the video memory is requested through the computing API or graphics API.

[0048] Device Plugin processes video memory requests: When a container requests video memory resources, the Device Plugin Pod intercepts the request and records the required amount of video memory; the Device Plugin Pod reads the corresponding CRD to process these requests and records the resource allocation internally; the Device Plugin Pod calculates whether the current video memory request exceeds the video memory limit, and if so, returns a failure code to the user program; the Device Plugin Pod calls the hijacked computing API or graphics API through the system call ioctl function and returns the corresponding video memory address. If the call fails, it returns a failure code to the user program; the user program executes the corresponding computing task or rendering task.

[0049] It is not difficult to find that in the embodiment of the present application, the management efficiency and resource utilization of the GPU video memory isolation method based on Kubernetes are significantly improved. Through precise resource configuration and management, enhanced video memory resource detection and monitoring, and efficient resource request and allocation mechanism, the system is ensured to accurately identify and schedule GPU resources. In addition, by defining CRD to declare the amount of video memory application, setting ResourceQuota and LimitRange for each application, the reasonable allocation of video memory resources is achieved. Through the communication between Scheduler and Device Plugin Pod, and hijacking the system call of computing API or graphics API, the correct allocation of video memory resources is carried out, which ensures the normal operation of the application and improves the flexibility and fault tolerance of the system.

[0050] Third embodiment

[0051] The third embodiment of the present application relates to a GPU memory isolation method based on Kubernetes. The third implementation is an improvement on the first embodiment, and the specific improvements are:

[0052] like Figure 3 As shown, the hijacking process includes:

[0053] Initialize the hijacking environment. When the program starts, get the device capabilities and set the global resource limit parameters and initialize the hijacking function through initialization(). The purpose of this step is to obtain the capability information of the GPU device and set the global resource limit parameters to ensure that the system can reasonably allocate according to the overall availability of video memory resources. In addition, this step also includes initializing the hijacking functions, which will intercept and process subsequent video memory allocation requests.

[0054] Hijack CUDA and Vulkan functions and redirect them to custom processing functions: By hijacking CUDA and Vulkan functions, these function calls will be redirected to custom processing functions. In this way, all video memory allocation requests will first be managed and monitored by the custom processing function instead of being directly processed by the original function.

[0055] The application calls the hijacked cuMemAlloc or vkCreateBuffer. When the application is running, it calls the hijacked CUDA or Vulkan functions (such as cuMemAlloc or vkCreateBuffer) to request video memory allocation. These calls will be redirected to the custom processing function set above.

[0056] The hijacking function calls get_used_gpu_memory() to access the NVML library to obtain the GPU memory usage details of all current processes. The custom processing function calls the get_used_gpu_memory() function to obtain the GPU memory usage details of all current processes through the NVML library. The NVML library provides detailed memory usage information, including the amount of memory used by each process, which is used to monitor and manage memory resources.

[0057] Summarize the video memory usage data to determine the total amount of video memory used by the current process. Summarize the acquired video memory usage data to determine the total amount of video memory used by the current process. The purpose of this step is to understand the video memory usage of the current process so as to make reasonable resource allocation in subsequent steps.

[0058] Determine whether the total video memory is exceeded, and compare whether the used video memory plus the video memory requested this time exceeds the total video memory limit of the system configuration; if it exceeds the limit, set the error value and the error status to CUDA_ERROR_OUT_OF_MEMORY, and return the error value to the application; if it does not exceed the video memory limit, call the original video memory allocation API (ENTRY_CALL) to perform video memory allocation, return a success status, and obtain a return code; if the return code indicates success, return the video memory address to the application and update the amount of available video memory; if the return code does not indicate success, return the error value to the application.

[0059] It should be noted that the third embodiment of the present application may also be an improvement based on the second embodiment.

[0060] It is not difficult to find that in the embodiment of the present application, by hijacking the Vulkan graphics API that applies for video memory, the containerized deployment of the real-time rendering program is achieved, which solves the problem that the traditional containerized deployment cannot adapt to the real-time rendering program that applies for video memory through the graphics API, and improves the scalability of the real-time rendering task.

[0061] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0062] Fourth embodiment

[0063] The fourth embodiment of the present application relates to a GPU memory isolation architecture based on Kubernetes.

[0064] like Figure 4 As shown in the figure, the top-level application is based on Kubernetes in user space. CUDA App Pod and Vulkan App Pod, as computing-intensive and rendering-intensive programs, apply to Device Plugin Pod in the form of containers and occupy GPU video memory. Device Plugin Pod, as an agent, applies to the kernel module for video memory through system calls. Finally, the kernel module sends gpu instruction to the GPU Device to enable the GPU to complete the computing or rendering tasks.

[0065] The top-level application is deployed based on Kubernetes in user space. Specifically, it includes the following two Pods: CUDA App Pod is a container for computing-intensive programs, which mainly performs CUDA-related video memory operations; Vulkan AppPod is a container for rendering-intensive programs, which mainly performs Vulkan-related video memory operations.

[0066] These two Pods apply for and occupy GPU video memory from the Device Plugin Pod by calling their respective video memory operation functions: the CUDA App Pod calls the CUDA functions cudaMalloc(), cudaMemcpy(), and cudaFree(); the Vulkan AppPod calls the Vulkan functions vkCreateBuffer(), vkGetBufferMemoryRequirements(), and vkBindBufferMemory().

[0067] Device Plugin Pod processes video memory requests and acts as a proxy to receive video memory request requests from CUDA App Pod and VulkanApp Pod. For CUDA video memory requests, such as cuMemAlloc, Device Plugin Pod processes and forwards them to the kernel module; for Vulkan video memory requests, such as vkAllocateMemory, Device Plugin Pod processes and forwards them to the kernel module. Device Plugin Pod requests video memory from the kernel module through the system call ioctl.

[0068] The GPU Kernel Module allocates video memory and performs video memory allocation after receiving the system call request from the Device Plugin Pod. The GPU Kernel Module sends the gpu instruction to the GPU device to ensure that the video memory is allocated to the specified application.

[0069] The GPU Device performs computing and rendering tasks and completes the corresponding computing or rendering tasks according to the received instructions. The CUDA App Pod and the Vulkan App Pod can continue to perform their respective computing or rendering operations after the video memory is successfully allocated.

[0070] Through this embodiment, the GPU video memory isolation method based on Kubernetes realizes the video memory resource management of computing-intensive and rendering-intensive applications. As a video memory management agent, Device Plugin Pod realizes the unified processing and scheduling of CUDA and Vulkan video memory applications, ensuring the reasonable allocation of video memory resources; through the collaboration of system calls and kernel modules, real-time monitoring and allocation of video memory resources ensures the efficiency and security of video memory use; through the reasonable allocation and dynamic adjustment of video memory resources, conflicts and waste of video memory resources are avoided, and the stability and resource utilization of the system are improved. It effectively solves the problem of video memory resource allocation in containerized deployment, especially for the video memory management needs of computing and rendering intensive applications, and realizes efficient isolation and management of video memory resources.

[0071] In addition, some embodiments of the present application also provide an electronic device. The electronic device may be a digital computer in various forms, such as a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, etc. The electronic device may also be a mobile device in various forms, such as a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices.

[0072] The electronic device includes: one or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the steps of the method provided in any one or more of the above embodiments. Figure 5 An exemplary structural diagram of the electronic device is disclosed. Figure 5 As shown, the electronic device includes: one or more processors 1101, memory 1102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Among them, the components shown in this article, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described and / or required herein.

[0073] The electronic device may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.

[0074] The input device 1103 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 1104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0075] To provide interaction with a user, the electronic device may be a computer. The computer has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0076] In the embodiments of the present application, a computer program / instruction is stored on a computer-readable medium, and when the computer program / instruction is executed by a processor, the steps of the method provided by any one or more of the above embodiments are implemented. The computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more computer-readable instructions.

[0077] The memory 1102 can be used as a non-transient computer-readable storage medium, which can be used to store non-transient software programs, non-transient computer executable programs and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more embodiments in the embodiments of the present application.

[0078] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0079] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0080] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0081] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0082] In the above-described embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. For example, it can be implemented by using an application specific integrated circuit (ASIC), a general-purpose computer or any other similar hardware device. In certain embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit that cooperates with a processor to perform each step or function.

[0083] The computer program product provided in the embodiment of the present application includes one or more computer programs / instructions, and when the computer program / instructions are executed by the processor, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0084] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0085] The scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes that fall within the meaning and scope of the equivalent elements of the claims are included in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim may also be implemented by one unit or device through software or hardware. The words "first", "second", etc. are only used to distinguish the description, and do not indicate any particular order, nor can they be understood as indicating or implying relative importance.

[0086] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily mention changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims, and the above embodiments should be regarded as exemplary and non-restrictive.

Claims

1. A GPU memory isolation method based on Kubernetes, characterized in that: The method comprises: Initialize the configuration file and set the parameters of GPU driver and plug-in; Device Plugin obtains video memory information and calls NVML to automatically detect the amount of video memory currently available on the node; Configure containerized application parameters and set the type and amount of video memory required by the user; Start the containerized application and process the memory request through the Device Plugin. The Device Plugin determines the node that meets the memory request and schedules it to the corresponding node. If there is no node that meets the memory request, the Pod is placed in the Pending state, waiting for the conditions that meet the memory request to appear.

2. The method according to claim 1, characterized in that The configuration file initialization includes: Configure GPU driver parameters, including memory pool size, priority rules, and memory isolation policy; Configure the GPU working mode, including computing mode, graphics mode, and hybrid mode.

3. The method according to claim 2, characterized in that The Device Plugin obtains video memory information including: Use Kubectl to check whether the Pods corresponding to the Device Plugin and Scheduler are running normally to ensure that GPU-related services are running normally; if not, check the parameters of the corresponding configuration file and reinstall it.

4. The method according to claim 3, characterized in that The configuration of containerized application parameters includes: Defining the amount of video memory requested by the containerized application; Set the upper limit of the amount of video memory that each application can request; Set the minimum amount of video memory that each application can use.

5. The method according to claim 4, characterized in that The launching of the containerized application comprises: The Scheduler communicates with the Device Plugin Pod, checks the video memory resources on the node, and schedules the Pod to the node that meets the video memory application through the scheduling algorithm; and applies for video memory through the computing API or graphics API.

6. The method according to claim 5, characterized in that The processing of the video memory application by the Device Plugin includes: When a container requests video memory resources, the Device Plugin Pod intercepts the request and records the amount of video memory required; The Device Plugin Pod reads the video memory application and records the allocation of the video memory resources internally; The Device Plugin Pod calculates whether the video memory application exceeds the video memory limit, and returns a failure code to the user program if the video memory application exceeds the limit; The Device Plugin Pod calls the hijacked computing API or graphics API through the ioctl function and returns the corresponding video memory address. If the call fails, it returns a failure code to the user program.

7. The method according to claim 6, characterized in that The method further comprises: When starting the containerized application, the initialization function is called to obtain device capabilities, set global resource limit parameters, and initialize the hijacking function; Hijack CUDA and Vulkan functions and redirect them to custom processing functions; The containerized application calls the hijacked function; the custom processing function performs video memory checking and allocation.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as claimed in any one of claims 1 to 7.

9. A computer readable medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Equipment fault processing method, electronic equipment, storage medium and program product

    CN120256187A