GPU resource testing method and device, medium and electronic equipment
By installing the target operating system on the test server and building a GPU virtual machine, the problem of inefficient testing of GPU resources in the existing technology is solved, and a more efficient testing process is achieved.
Patent Information
- Application Number
- CN202411525296.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-07
AI Technical Summary
The existing GPU resource testing methods are inefficient and the environment is cumbersome. The environment must be redeployed every time it is executed, resulting in low testing efficiency.
By responding to user's test instructions, install the target operating system on the test server, and build the target GPU virtual machine on the test server based on the test environment information deployed in advance on the environment server, set the test configuration information corresponding to the target GPU virtual machine, and according to GPU virtual machine and test configuration information are tested.
It reduces the time to deploy the test environment and effectively improves the efficiency of testing GPU resources.
Smart Images

Figure CN119396530A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, medium and electronic device for testing GPU resources. Background Art
[0002] In recent years, GPU virtualization technology has developed rapidly with the rapid growth of cloud computing, artificial intelligence, big data analysis and high-performance computing needs, becoming an important technology supporting complex graphics processing, machine learning, scientific computing and other fields.
[0003] The existing GPU resource testing method uses GPU Pass-Through and vGPU technology to deploy GPU virtualization scenarios and virtualization tests. However, the environment deployment is cumbersome and the environment must be redeployed each time it is executed, resulting in low test efficiency. Therefore, how to provide a GPU resource testing method to solve the problem of low efficiency in testing GPU resources is of great practical significance. Summary of the invention
[0004] The embodiments of the present application provide a method, device, medium and electronic device for testing GPU resources, which can improve the efficiency of testing GPU resources.
[0005] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for testing GPU resources, including:
[0007] Responding to the user's test instructions, installing the target operating system on the test server;
[0008] Based on the test environment information pre-deployed on the environment server, building a target GPU virtual machine on the test server; the environment server and the test server are in the same local area network;
[0009] Set the test configuration information corresponding to the target GPU virtual machine;
[0010] The GPU resources of the test server are tested according to the GPU virtual machine and the test configuration information.
[0011] The GPU resource testing method provided in the embodiment of the present application, in the process of testing the GPU resources, responds to the user's test instructions and installs the target operating system on the test server; based on the test environment information pre-deployed on the environment server, builds the target GPU virtual machine on the test server; the environment server and the test server are in the same local area network; sets the test configuration information corresponding to the target GPU virtual machine; and tests the GPU resources of the test server according to the GPU virtual machine and the test configuration information, which can reduce the time for deploying the test environment and effectively improve the efficiency of testing the GPU resources.
[0012] In an optional embodiment, the target operating system includes a KVM system and a VMware ESXI system; the step of responding to a user's test instruction and installing the target operating system on the test server includes:
[0013] Monitor user's test instructions;
[0014] If the type of the test instruction of the user is a first type of test instruction, installing a KVM system on the test server in response to the test instruction;
[0015] If the type of the user's test instruction is a second type of test instruction, a VMware ESXI system is installed on the test server in response to the test instruction.
[0016] The method of this embodiment monitors the user's test instructions; if the type of the user's test instructions is a first type of test instruction, the KVM system is installed on the test server in response to the test instructions; if the type of the user's test instructions is a second type of test instruction, the Vmware ESXI system is installed on the test server in response to the test instructions. When testing GPU resources, it can be determined according to the type of the user's test instructions whether to install the KVM system or the Vmware ESXI system on the test server, thereby achieving flexible operating system installation based on the type of the user's test instructions, and more efficiently improving the efficiency of testing GPU resources.
[0017] In an optional embodiment, the method further includes:
[0018] In response to the environment deployment instruction of the user, the test environment information is deployed on the environment server.
[0019] The method of this embodiment also includes responding to the user's environment deployment instructions and deploying the test environment information on the environment server, so that the test environment information can be deployed in advance on the environment server or the test environment information can be redeployed on the environment server to improve the efficiency of testing GPU resources.
[0020] In an optional embodiment, the test environment information includes a VMware Vcenter environment image, a datastore / NFS server environment image, a vGPU License Server environment image, a GPU test script, and a virtual machine image; the data store / NFS server environment image includes a test environment deployment script.
[0021] In the method of this embodiment, the test environment information includes VMware Vcenter environment image, data store / NFS server environment image, vGPU License Server environment image, GPU test script, and virtual machine image; the data store / NFS server environment image includes a test environment deployment script, which can efficiently provide software used in the test process of GPU resources, thereby more effectively improving the efficiency of testing GPU resources.
[0022] In an optional embodiment, the step of constructing a target GPU virtual machine on the test server based on the test environment information pre-deployed on the environment server includes:
[0023] If the target operating system is the KVM system, a target GPU virtual machine is constructed on the test server based on the datastore / NFS server environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information;
[0024] If the target operating system is a VMware ESXI system, a target GPU virtual machine is constructed on the test server based on the VMware Vcenter environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information.
[0025] The method of this embodiment, if the target operating system is the KVM system, then based on the data store / NFS server environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information, build a target GPU virtual machine on the test server; if the target operating system is a VMware ESXI system, then based on the VMware Vcenter environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information, build a target GPU virtual machine on the test server according to the target operating system and the test environment information, thereby improving the efficiency of testing GPU resources.
[0026] In an optional embodiment, the setting of the test configuration information corresponding to the target GPU virtual machine includes:
[0027] Obtain the PCI address of the GPU device of the test server;
[0028] The PCI address is added to the pass-through device list of the target GPU virtual machine; the pass-through device list is used for the virtual machine to identify the GPU device.
[0029] The method of this embodiment obtains the PCI address of the GPU device of the test server; adds the PCI address to the pass-through device list of the target GPU virtual machine; the pass-through device list is used for the virtual machine to identify the GPU device, thereby providing a mechanism for configuring GPU pass-through, setting the test configuration information corresponding to the target GPU virtual machine, and improving the efficiency of testing GPU resources.
[0030] In an optional embodiment, the setting of the test configuration information corresponding to the target GPU virtual machine includes:
[0031] Creating a virtual machine instance corresponding to the target GPU virtual machine;
[0032] Allocate a corresponding vGPU configuration file to the virtual machine instance;
[0033] A resource driver is installed in the target GPU virtual machine; the resource driver is used by the virtual machine to identify and use the GPU device.
[0034] The method of this embodiment provides a mechanism for deploying vGPU instances by creating a virtual machine instance corresponding to the target GPU virtual machine; allocating a corresponding vGPU configuration file to the virtual machine instance; and installing a resource driver in the target GPU virtual machine; the resource driver is used by the virtual machine to identify and use the GPU device, thereby setting the test configuration information corresponding to the target GPU virtual machine and improving the efficiency of testing GPU resources.
[0035] In a second aspect, an embodiment of the present application further provides a GPU resource testing device, including:
[0036] The system deployment module is used to respond to the user's test instructions and install the target operating system on the test server;
[0037] A virtual machine creation module, used to build a target GPU virtual machine on the test server based on the test environment information pre-deployed on the environment server; the environment server and the test server are in the same local area network;
[0038] An information configuration module, used to set the test configuration information corresponding to the target GPU virtual machine;
[0039] The resource testing module is used to test the GPU resources of the test server according to the GPU virtual machine and the test configuration information.
[0040] In an optional embodiment, the target operating system includes a KVM system and a VMware ESXI system; the system deployment module is specifically used to:
[0041] Monitor user's test instructions;
[0042] If the type of the test instruction of the user is a first type of test instruction, installing a KVM system on the test server in response to the test instruction;
[0043] If the type of the user's test instruction is a second type of test instruction, a VMware ESXI system is installed on the test server in response to the test instruction.
[0044] In an optional embodiment, the device further includes a test environment management unit;
[0045] The test environment management unit is used to respond to the environment deployment instruction of the user and deploy the test environment information on the environment server.
[0046] In an optional embodiment, the test environment information includes a VMware Vcenter environment image, a datastore / NFS server environment image, a vGPU License Server environment image, a GPU test script, and a virtual machine image; the data store / NFS server environment image includes a test environment deployment script.
[0047] In an optional embodiment, the virtual machine creation module is specifically used to:
[0048] If the target operating system is the KVM system, a target GPU virtual machine is constructed on the test server based on the datastore / NFS server environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information;
[0049] If the target operating system is a VMware ESXI system, a target GPU virtual machine is constructed on the test server based on the VMware Vcenter environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information.
[0050] In an optional embodiment, the information configuration module is specifically used to:
[0051] Obtain the PCI address of the GPU device of the test server;
[0052] The PCI address is added to the pass-through device list of the target GPU virtual machine; the pass-through device list is used for the virtual machine to identify the GPU device.
[0053] In an optional embodiment, the information configuration module is specifically used to:
[0054] Creating a virtual machine instance corresponding to the target GPU virtual machine;
[0055] Allocate a corresponding vGPU configuration file to the virtual machine instance;
[0056] A resource driver is installed in the target GPU virtual machine; the resource driver is used by the virtual machine to identify and use the GPU device.
[0057] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the GPU resource testing method of the first aspect is implemented.
[0058] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the processor implements the GPU resource testing method of the first aspect.
[0059] The technical effects brought about by any one of the implementation methods in the second to fourth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0061] Figure 1 A flowchart of a method for testing GPU resources provided in an embodiment of the present application;
[0062] Figure 2 A flowchart of installing a target operating system on a test server in a GPU resource testing method provided in an embodiment of the present application;
[0063] Figure 3 A schematic diagram of a process of building a target GPU virtual machine on a test server in a GPU resource testing method provided in an embodiment of the present application;
[0064] Figure 4 One of the flow diagrams of setting test configuration information corresponding to a target GPU virtual machine in a GPU resource testing method provided in an embodiment of the present application;
[0065] Figure 5 A second flow chart of setting test configuration information corresponding to a target GPU virtual machine in a method for testing GPU resources provided in an embodiment of the present application;
[0066] Figure 6 One of the structural schematic diagrams of a GPU resource testing device provided in an embodiment of the present application;
[0067] Figure 7 A second structural diagram of a GPU resource testing device provided in an embodiment of the present application;
[0068] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0070] It should be noted that the terms "including" and "having" and their variations involved in the documents of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0071] The following are explanations of some of the terms that appear in the text:
[0072] (1) GPU (Graphics Processing Unit): GPU is a microprocessor specially designed for processing graphics and image computing tasks. The main functions of GPU include: rendering images, parallel computing, floating-point computing power, number of cores, etc. It is also widely used in the following fields: artificial intelligence, high-performance computing, video editing, virtual reality (VR) and augmented reality (AR), etc.
[0073] (2) Virtualization: Virtualization is a technology that allows a single physical resource (such as a server or storage device) to be divided into multiple virtual resources.
[0074] (3) vGPU (virtual GPU): vGPU allows multiple virtual machines to share physical GPU resources.
[0075] (4) KVM (Kernel-based Virtual Machine): KVM is an open source virtualization module embedded in the Linux kernel that can transform a physical server into multiple virtual servers.
[0076] In recent years, GPU virtualization technology has developed rapidly with the rapid growth of cloud computing, artificial intelligence, big data analysis and high-performance computing needs, becoming an important technology supporting complex graphics processing, machine learning, scientific computing and other fields.
[0077] The existing GPU resource testing method uses GPU Pass-Through and vGPU technology to deploy GPU virtualization scenarios and virtualization tests. However, the environment deployment is cumbersome and the environment must be redeployed each time it is executed, resulting in low test efficiency. Therefore, how to provide a GPU resource testing method to solve the problem of low efficiency in testing GPU resources is of great practical significance.
[0078] In order to solve the existing technical problems, the embodiment of the present application provides a test method, device, medium and electronic device for GPU resources. In the process of testing GPU resources, the target operating system is installed on the test server in response to the user's test instructions; based on the test environment information pre-deployed on the environment server, the target GPU virtual machine is built on the test server; the environment server and the test server are in the same local area network; the test configuration information corresponding to the target GPU virtual machine is set; according to the GPU virtual machine and the test configuration information, the GPU resources of the test server are tested. The method deploys the test environment information on the environment server in advance by cooperating with the environment server and the test server, which can reduce the time of deploying the test environment and effectively improve the efficiency of testing GPU resources.
[0079] In order to make the invention purpose, technical scheme and advantages of the embodiments of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 the present application.
[0080] The technical solution provided in the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0081] The GPU resource testing method provided in the embodiment of the present application can be applied to a server or a terminal device. The following embodiments of the present application are described by taking the GPU resource testing method applied to a terminal device as an example.
[0082] The present application embodiment provides a method for testing GPU resources, such as Figure 1 As shown, the following steps are included:
[0083] Step S101, responding to a test instruction from a user, installing a target operating system on a test server.
[0084] During specific implementation, the terminal device responds to the user's test instruction and installs the target operating system on the test server.
[0085] In some optional embodiments, the target operating system includes a KVM system and a VMware ESXI system; in the above step S101, the process of installing the target operating system on the test server in response to the user's test instruction is as follows: Figure 2 As shown, this can be achieved by following the steps below:
[0086] Step S201, monitoring the user's test instructions.
[0087] During specific implementation, the terminal device monitors whether a test instruction from the user is received.
[0088] Step S202: If the type of the user's test instruction is a first type of test instruction, then install a KVM system on the test server in response to the test instruction.
[0089] In specific implementation, after the terminal device monitors and receives the test instruction from the user, if the type of the user's test instruction is a first type of test instruction, the KVM system is installed on the test server in response to the test instruction.
[0090] Step S203: If the type of the user's test instruction is a second type of test instruction, a VMware ESXI system is installed on the test server in response to the test instruction.
[0091] During specific implementation, after the terminal device monitors and receives the test instruction from the user, if the type of the test instruction from the user is the second type of test instruction, the VMware ESXI system is installed on the test server in response to the test instruction.
[0092] The method of this embodiment monitors the user's test instructions; if the user's test instructions are of the first type, the KVM system is installed on the test server in response to the test instructions; if the user's test instructions are of the second type, the Vmware ESXI system is installed on the test server in response to the test instructions. When testing GPU resources, it can be determined whether to install the KVM system or the Vmware ESXI system on the test server according to the type of the user's test instructions, thereby achieving flexible operating system installation based on the type of the user's test instructions, and more efficiently improving the efficiency of testing GPU resources.
[0093] In one embodiment, the method for testing GPU resources further includes:
[0094] Respond to the user's environment deployment instructions and deploy the test environment information on the environment server.
[0095] In a specific implementation, the environment deployment instruction may be a first type of deployment instruction for instructing to pre-deploy the test environment information on the environment server; or a second type of deployment instruction for instructing to redeploy the test environment information on the environment server. In response to receiving the environment deployment instruction from the user, the test environment information is deployed on the environment server to pre-deploy the test environment information on the environment server, or to redeploy the test environment information on the environment server.
[0096] The method of this embodiment also includes responding to the user's environment deployment instructions to deploy test environment information on the environment server, so that the test environment information can be pre-deployed on the environment server or the test environment information can be redeployed on the environment server to improve the efficiency of testing GPU resources.
[0097] In one embodiment, the test environment information includes a VMware Vcenter environment image, a data store / NFSserver environment image, a vGPU License Server environment image, a GPU test script, and a virtual machine image; the data store / NFS server environment image includes a test environment deployment script.
[0098] In one embodiment, the VMware Vcenter environment image includes a test environment deployment script.
[0099] In an embodiment of the present application, the VMware Vcenter environment image and the data store / NFS server environment image may include the same test environment deployment script or different test environment deployment scripts.
[0100] In the method of this embodiment, the test environment information includes VMware Vcenter environment image, data store / NFSserver environment image, vGPU License Server environment image, GPU test script, and virtual machine image; the data store / NFS server environment image includes a test environment deployment script, which can efficiently provide software used in the test process of GPU resources, thereby more effectively improving the efficiency of testing GPU resources.
[0101] Step S102: Building a target GPU virtual machine on the test server based on the test environment information pre-deployed on the environment server.
[0102] Among them, the environment server and the test server are in the same local area network.
[0103] During specific implementation, the test server and the environment server can achieve keyless mutual access through the network in the same local area network.
[0104] In some optional embodiments, the process of building a target GPU virtual machine on the test server based on the test environment information pre-deployed on the environment server in the above step S102 is as follows: Figure 3 As shown, this can be achieved by following the steps below:
[0105] Step S301: If the target operating system is a KVM system, a target GPU virtual machine is built on the test server based on the data store / NFS server environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information.
[0106] In some embodiments, if the target operating system is RHEL / ubuntu KVM, a pre-prepared KVM template is obtained from the data store / NFSserver environment image through network mounting or copying, and a new virtual machine is created using the obtained KVM template as a template. The template has already deployed the environment required for GPU testing, and the newly created virtual machine is opened; finally, the environment server is used to interact with the virtual machine to perform relevant tests remotely.
[0107] Step S302: If the target operating system is a VMware ESXI system, a target GPU virtual machine is built on the test server based on the VMware Vcenter environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information.
[0108] In some embodiments, if the operating system is VMware ESXI, the environment can be deployed in the same manner as when the target operating system is RHEL / ubuntu KVM; in addition, the virtual machines can be managed or deployed in batches through VMware Vcenter environment mirroring.
[0109] In the method of this embodiment, if the target operating system is a KVM system, a target GPU virtual machine is built on the test server based on the datastore / NFS server environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information; if the target operating system is a VMware ESXI system, a target GPU virtual machine is built on the test server based on the VMware Vcenter environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information, thereby achieving the goal of building a target GPU virtual machine on the test server based on the target operating system and the test environment information, thereby improving the efficiency of testing GPU resources.
[0110] Step S103: setting test configuration information corresponding to the target GPU virtual machine.
[0111] In some embodiments of the present application, the GPU is virtualized by Pass-Through or vGPU. For KVM virtualization, copy the XML configuration and packaged virtual machine image from the data store / NFS server environment and manually edit or use a virtualization management tool (such as Virtual Machine Manager) to create a virtual machine configuration file, ensuring that the correct GPU PCI address is added to the pass-through device list. For VMware ESXI, batch manage and copy the image to the test server through VMware Vcenter.
[0112] In some optional embodiments, the process of setting the test configuration information corresponding to the target GPU virtual machine in the above step S103 is as follows: Figure 4 As shown, this can be achieved by following the steps below:
[0113] Step S401, obtaining the PCI address of the GPU device of the test server.
[0114] In specific implementation, you can use the lspci command to find out the PCI address of the GPU.
[0115] Step S402, adding the PCI address to the pass-through device list of the target GPU virtual machine; the pass-through device list is used for the virtual machine to identify the GPU device.
[0116] In specific implementation, edit the libvirt configuration file (such as / etc / libvirt / qemu / your_vm.xml) of the host machine, and add the PCI address of the GPU to the pass-through device list. In some embodiments of the present application, the host machine may be a test server.
[0117] The method of this embodiment obtains the PCI address of the GPU device of the test server; adds the PCI address to the pass-through device list of the target GPU virtual machine; the pass-through device list is used by the virtual machine to identify the GPU device, thereby providing a mechanism for configuring GPU pass-through, setting the test configuration information corresponding to the target GPU virtual machine, and improving the efficiency of testing GPU resources.
[0118] In some optional embodiments, the process of setting the test configuration information corresponding to the target GPU virtual machine in the above step S103 is as follows: Figure 5 As shown, this can be achieved by following the steps below:
[0119] Step S501: Create a virtual machine instance corresponding to the target GPU virtual machine.
[0120] During specific implementation, a corresponding virtual machine instance may be created for the target GPU virtual machine.
[0121] Step S502: assign a corresponding vGPU configuration file to the virtual machine instance.
[0122] In some embodiments, a vGPU profile is assigned to each virtual machine that requires GPU acceleration.
[0123] Exemplarily, the process of assigning a corresponding vGPU profile to a virtual machine instance may be to configure the vGPU instance, for example, through NVIDIA vGPU Manager or a management interface of a virtualization platform, and select a suitable vGPU profile according to the application scenario. Each vGPU profile defines different GPU resource allocations, such as video memory size, number of CUDA cores, etc.
[0124] Step S503, installing a resource driver in the target GPU virtual machine; the resource driver is used by the virtual machine to identify and use the GPU device.
[0125] In an embodiment of the present application, the GPU device may be a physical GPU, wherein the physical GPU is a GPU microprocessor.
[0126] In some embodiments, installing a resource driver in a target GPU virtual machine may be, for a vGPU virtualization scenario, installing a vGPU driver, including installing the NVIDIA GRID driver and vGPU Manager software on a test server; and using a vGPU License Server environment image, including registering on the NVIDIA vGPU Licensing Portal and downloading a license file, and then applying the license in the vGPU Manager so that the GPU can be used normally in the virtual machine.
[0127] Exemplarily, the resource driver may be an NVIDIA GRID client driver; within the virtual machine, a suitable NVIDIA GRID client driver is installed so that the virtual machine can recognize and use the assigned vGPU.
[0128] In some embodiments of the present application, it also includes: dynamically allocating and managing vGPU instances based on the actual needs of the virtual machines and the available resources of the physical GPU through the GPU scheduler to ensure that each virtual machine obtains sufficient GPU performance.
[0129] In some embodiments of the present application, it also includes: using the tools provided by NVIDIA GRID and the monitoring function of the virtualization platform to monitor GPU usage, adjust the vGPU configuration according to the actual operating conditions, and optimize resource allocation.
[0130] The method of this embodiment creates a virtual machine instance corresponding to the target GPU virtual machine; allocates a corresponding vGPU configuration file to the virtual machine instance; and installs a resource driver in the target GPU virtual machine; the resource driver is used by the virtual machine to identify and use the GPU device, thereby providing a mechanism for deploying vGPU instances, setting the test configuration information corresponding to the target GPU virtual machine, and improving the efficiency of testing GPU resources.
[0131] Step S104: testing the GPU resources of the test server according to the GPU virtual machine and the test configuration information.
[0132] In some embodiments of the present application, the test of GPU resources can be performed by establishing a network connection between a data store / NFS server environment mirror and a test server to ensure network communication, prepare or copy test scripts, or remotely execute test programs to perform testing.
[0133] The GPU resource testing method provided in the embodiment of the present application responds to the user's test instructions and installs the target operating system on the test server during the process of testing the GPU resources; builds the target GPU virtual machine on the test server based on the test environment information pre-deployed on the environment server; the environment server and the test server are in the same local area network; sets the test configuration information corresponding to the target GPU virtual machine; and tests the GPU resources of the test server according to the GPU virtual machine and the test configuration information, which can reduce the time for deploying the test environment and effectively improve the efficiency of testing the GPU resources.
[0134] Based on the same inventive concept, a GPU resource testing device is also provided in the embodiment of the present application. Since the device is a device corresponding to the GPU resource testing method provided in the embodiment of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the above method, and the repeated parts will not be repeated.
[0135] Figure 6 A schematic diagram of the structure of a GPU resource testing device provided in an embodiment of the present application is shown. Figure 6 As shown, the GPU resource testing device includes a system deployment module 601 , a virtual machine creation module 602 , an information configuration module 603 and a resource testing module 604 .
[0136] The system deployment module 601 is used to respond to the user's test instruction and install the target operating system on the test server;
[0137] A virtual machine creation module 602 is used to build a target GPU virtual machine on a test server based on the test environment information pre-deployed on the environment server; the environment server and the test server are in the same local area network;
[0138] The information configuration module 603 is used to set the test configuration information corresponding to the target GPU virtual machine;
[0139] The resource testing module 604 is used to test the GPU resources of the test server according to the GPU virtual machine and the test configuration information.
[0140] In an optional embodiment, the target operating system includes a KVM system and a VMware ESXI system; the system deployment module 601 is specifically used to:
[0141] Monitor user's test instructions;
[0142] If the type of the user's test instruction is a first type of test instruction, then responding to the test instruction to install a KVM system on the test server;
[0143] If the type of the user's test instruction is a second type of test instruction, the VMware ESXI system is installed on the test server in response to the test instruction.
[0144] In an optional embodiment, if Figure 7 As shown, the device also includes a test environment management unit 701;
[0145] The test environment management unit 701 is used to respond to the environment deployment instruction of the user and deploy the test environment information on the environment server.
[0146] In an optional embodiment, the test environment information includes VMware Vcenter environment image, datastore / NFS server environment image, vGPU License Server environment image, GPU test script, virtual machine image; the data store / NFS server environment image includes a test environment deployment script.
[0147] In an optional embodiment, the virtual machine creation module 602 is specifically configured to:
[0148] If the target operating system is a KVM system, build the target GPU virtual machine on the test server based on the test environment information including the data store / NFS server environment image, vGPU License Server environment image, and virtual machine image;
[0149] If the target operating system is a VMware ESXI system, a target GPU virtual machine is built on the test server based on the test environment information including the VMware Vcenter environment image, the vGPU License Server environment image, and the virtual machine image.
[0150] In an optional embodiment, the information configuration module 603 is specifically used to:
[0151] Get the PCI address of the GPU device of the test server;
[0152] Add the PCI address to the pass-through device list of the target GPU virtual machine; the pass-through device list is used by the virtual machine to identify the GPU device.
[0153] In an optional embodiment, the information configuration module 603 is specifically used to:
[0154] Create a virtual machine instance corresponding to the target GPU virtual machine;
[0155] Assign the corresponding vGPU configuration file to the virtual machine instance;
[0156] Install the resource driver in the target GPU virtual machine; the resource driver is used by the virtual machine to identify and use the GPU device.
[0157] Based on the same inventive concept, a GPU resource testing system is also provided in the embodiment of the present application. Since the system includes the test server and environment server provided by the method of the aforementioned embodiment of the present application, and the principle of solving the problem by the system is similar to that of the method, the implementation of the system can refer to the implementation of the aforementioned method, and the repeated parts will not be repeated.
[0158] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. The electronic device can be used for testing GPU resources. In the embodiment of the present application, the electronic device can be a server or a terminal device. In one embodiment, the electronic device can be a terminal device. In this embodiment, the structure of the electronic device can be as follows: Figure 8 As shown, it includes a memory 801 , a communication module 803 and one or more processors 802 .
[0159] The memory 801 is used to store computer programs executed by the processor 802. The memory 801 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0160] The memory 801 may be a volatile memory, such as a random-access memory (RAM); the memory 801 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 801 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 801 may be a combination of the above memories.
[0161] The processor 802 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 802 is used to implement the above-mentioned GPU resource testing method when calling the computer program stored in the memory 801 .
[0162] The communication module 803 is used to communicate with terminal devices and other servers.
[0163] The specific connection medium between the memory 801, the communication module 803 and the processor 802 is not limited in the embodiment of the present application. Figure 8 In the embodiment, the memory 801 and the processor 802 are connected via a bus 804. The bus 804 is Figure 8 The connections between other components are shown in bold lines, and are not intended to be limiting. Bus 804 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0164] According to one aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the test method of the GPU resource in the above embodiment. The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can 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 readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable 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.
[0165] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for testing GPU resources, characterized in that: include: Responding to the user's test instructions, installing the target operating system on the test server; Based on the test environment information pre-deployed on the environment server, building a target GPU virtual machine on the test server; The environment server and the test server are in the same local area network; Set the test configuration information corresponding to the target GPU virtual machine; The GPU resources of the test server are tested according to the GPU virtual machine and the test configuration information.
2. The method according to claim 1, characterized in that The target operating system includes a KVM system and a VMware ESXI system; the step of responding to a user's test instruction and installing the target operating system on the test server includes: Monitor user's test instructions; If the type of the test instruction of the user is a first type of test instruction, installing a KVM system on the test server in response to the test instruction; If the type of the user's test instruction is a second type of test instruction, a VMware ESXI system is installed on the test server in response to the test instruction.
3. The method according to claim 2, characterized in that The method further comprises: In response to the environment deployment instruction of the user, the test environment information is deployed on the environment server.
4. The method according to claim 3, characterized in that The test environment information includes VMware Vcenter environment image, data store / NFS server environment image, vGPU License Server environment image, GPU test script, and virtual machine image; the data store / NFS server environment image includes a test environment deployment script.
5. The method according to claim 4, characterized in that The step of constructing a target GPU virtual machine on the test server based on the test environment information pre-deployed on the environment server includes: If the target operating system is the KVM system, a target GPU virtual machine is constructed on the test server based on the datastore / NFS server environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information; If the target operating system is a VMware ESXI system, a target GPU virtual machine is constructed on the test server based on the VMware Vcenter environment image, the vGPU License Server environment image, and the virtual machine image included in the test environment information.
6. The method according to claim 1, characterized in that The setting of the test configuration information corresponding to the target GPU virtual machine includes: Obtain the PCI address of the GPU device of the test server; The PCI address is added to the pass-through device list of the target GPU virtual machine; the pass-through device list is used for the virtual machine to identify the GPU device.
7. The method according to claim 1, characterized in that The setting of the test configuration information corresponding to the target GPU virtual machine includes: Creating a virtual machine instance corresponding to the target GPU virtual machine; Allocate a corresponding vGPU configuration file to the virtual machine instance; A resource driver is installed in the target GPU virtual machine; the resource driver is used by the virtual machine to identify and use the GPU device.
8. A GPU resource testing device, characterized in that: include: The system deployment module is used to respond to the user's test instructions and install the target operating system on the test server; A virtual machine creation module, used to build a target GPU virtual machine on the test server based on the test environment information pre-deployed on the environment server; The environment server and the test server are in the same local area network; An information configuration module, used to set the test configuration information corresponding to the target GPU virtual machine; The resource testing module is used to test the GPU resources of the test server according to the GPU virtual machine and the test configuration information.
9. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Method and device for detecting video memory competition of GPU (Graphics Processing Unit) end based on CPU end
CN122019311A
Method and device for detecting GPU memory competition based on CPU end
CN122019311B