An Automated Method and System for Configuring CUDA Environment and GPU Stress Testing

By building mapping relationship tables and automation scripts, the automatic configuration of the CUDA environment and the comprehensive testing of GPU performance are achieved, solving the problems of complex configuration and incomplete testing in the existing technology, and improving the installation efficiency and the accuracy of hardware damage judgment.

CN119922183BActive Publication Date: 2025-08-01POWERLEADER COMPUTER SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510416068.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-08-01
Estimated Expiration
2045-04-03

AI Technical Summary

Technical Problem

In the prior art, the configuration of CUDA environments is cumbersome and error-prone, and the GPU performance testing tool cannot conduct comprehensive testing, which increases the operational complexity and the risk of difficulty in accurately determining hardware damage.

Method used

By building a mapping relationship table between device model and architecture, cuda version, and cudnn version, using SSH and SFTP protocols to automatically connect to the Linux server, download and install CUDA and cuDNN, and combining matrix operation algorithms to comprehensively test the computing power and error correction capabilities of the GPU.

Benefits of technology

It realizes automated configuration and all-round testing of the CUDA environment, reduces manual operations, improves installation efficiency and accuracy, can accurately judge hardware damage, and reduces operational complexity and error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922183B_ABST
    Figure CN119922183B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and system for automatically configuring the CUDA environment and GPU stress testing. The method includes: constructing a mapping relationship table of the device model, architecture, cuda version, and cudnn version; inputting account information; connecting to the Linux server through the SSH protocol according to the configured operating system account and password, and then transmitting the Shell script through the SFTP protocol; obtaining the device model and returning it, and according to the query requirements for the obtained device model, querying the predefined mapping relationship table to determine the architecture, cuda, and cudnn versions corresponding to the device model, and automatically performing downloading, installation, and verification to obtain the automatically configured environment variables; allocating memory and initializing the matrix, starting the matrix operation algorithm, and comprehensively testing the computing power and error correction ability of the GPU. The present invention realizes the automatic downloading of cuda and the configuration of the cuda environment, and comprehensively tests the GPU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method and system for automatically configuring the CUDA environment and GPU stress testing, belonging to the field of communications. Background Art

[0002] In the current fields of high-performance computing and artificial intelligence, the configuration of the CUDA environment and the performance testing of GPUs are two crucial tasks. However, at present, these two tasks mostly rely on manual operations, and there are many problems and deficiencies. Among them, for the configuration of the CUDA environment, usually, users need to manually download the corresponding version of the CUDA toolkit from the official website according to their own needs, and then configure it according to complex installation steps. This process is not only cumbersome but also prone to configuration failure due to improper operations. In terms of GPU performance testing, although there are various testing tools on the market, most tools can only perform single-dimensional testing and cannot conduct comprehensive stress testing on GPUs. To conduct all-round testing on them, it is often necessary to manually combine multiple testing tools and manually set test parameters, which not only increases the complexity of operations but also makes it difficult to accurately determine whether there are potential damages to the hardware. Summary of the Invention

[0003] The present invention provides a method and system for automatically configuring the CUDA environment and GPU stress testing, aiming to solve at least one of the technical problems existing in the prior art.

[0004] The technical solution of the present invention relates to a method for automatically configuring the CUDA environment and GPU stress testing. The method according to the present invention includes the following steps:

[0005] A method for automatically configuring the CUDA environment and GPU stress testing, the method includes the following steps:

[0006] S100. Construct a mapping table of the device model, architecture, cuda version, and cudnn version;

[0007] S200. Input account information; configure the operating system account and password, connect to the Linux server through the SSH protocol, and then transfer the Shell script through the SFTP protocol;

[0008] S300. Obtain the device model and return it. According to the query requirements for obtaining the device model, query the predefined mapping table to determine the architecture, cuda, and cudnn versions corresponding to the device model, and automatically execute downloading, installation, and verification to obtain the automatically configured environment variables;

[0009] S400. Allocate memory and initialize the matrix, start the matrix operation algorithm, and comprehensively test the computing power and error correction ability of the GPU.

[0010] Furthermore, step S200 includes:

[0011] S210. Obtain the input information of the front-end web server; the input information includes the IP address, account, and password.

[0012] S220. Transmit the input information to the back-end server, and start the SSH service by starting a thread of the Python server.

[0013] S230. Perform SSH login using the configured operating system account and password, connect to the Linux system through the SSH protocol, and transfer the automatic installation script through the SFTP protocol.

[0014] Furthermore, step S300 includes:

[0015] S310. Execute Shell through SSH, which connects to the remote server through SSH and executes a Shell script.

[0016] S320. In the Shell script, call exec_command to execute the command nvidia-smi to output the model information.

[0017] S330. According to the extracted model, query the predefined mapping relation table to obtain the CUDA and cuDNN version information corresponding to different models.

[0018] S340. Automatically download and install CUDA according to the queried CUDA version, and automatically download and install cuDNN according to the queried cuDNN version.

[0019] S350. After the installation is completed, automatically configure the environment variables to ensure that CUDA and cuDNN can be correctly recognized and used.

[0020] S350. Verify whether the CUDA environment is configured correctly.

[0021] Furthermore, step S340 includes:

[0022] Find the supported CUDA version range from the predefined mapping relation table, set the internal field separator IFS to a space, read the minimum and maximum CUDA version numbers of the corresponding entry in the mapping table, and output the maximum version number to determine the CUDA version range suitable for this computing architecture.

[0023] Furthermore, in step S340,

[0024] Assign the incoming cuDNN version number and CUDA version number to local variables cudnn_version and cuda_version respectively, output the cuDNN version information being downloaded, construct the download link for cuDNN, store it in the variable cudnn_url, and then download the link to the specified file;

[0025] Use the curl command to log in and download with the cookies file. After logging in to the NVIDIA developer website using the curl command and saving the cookies information to the cookie_file file, use the saved cookies information to download the cuDNN library from the constructed link to the specified cudnn_path path;

[0026] In the install_cudnn function, assign the incoming cuDNN version number and CUDA version number to local variables cudnn_version and cuda_version respectively, construct the decompression path for cuDNN, and use the tar command to decompress the downloaded cuDNN compressed package to the specified directory to complete the installation of the cuDNN library.

[0027] Furthermore, the step S400 includes:

[0028] S410. Allocate memory on the host and initialize matrices A and B;

[0029] S420. Randomly inject some errors into matrices A and B;

[0030] S430. Allocate memory on the GPU for matrices A and B and the result matrix C;

[0031] S440. Copy the matrix data on the host from the host memory to the device memory;

[0032] S450. Start the first kernel function for matrix operation to multiply matrices A and B and store the result in matrix C;

[0033] S460. After the matrix operation is completed, use the second kernel function to randomly inject some errors into the result matrix C;

[0034] S460. Check whether there are any errors in the CUDA call;

[0035] S470. Release the memory resources on the device and the host.

[0036] Further, in step S420, the randomly injected error is implemented through the injectError function, which adds random values to certain elements in the matrix with a certain probability.

[0037] Further, in step S400,

[0038] By calculating the starting row row and column col of the current thread block in the global matrix, matrix element access positioning is performed;

[0039] Among them, row is calculated as follows: multiply the y-dimension index blockIdx.y of the thread block by the y-dimension size blockDim.y of the thread block, and then add the y-dimension index threadIdx.y of the thread;

[0040] Among them, col is calculated as follows: multiply the x-dimension index blockIdx.x of the thread block by the x-dimension size blockDim.x of the thread block, and then add the x-dimension index threadIdx.x of the thread.

[0041] The technical solution of the present invention also relates to a computer-readable storage medium, on which program instructions are stored, and when the program instructions are executed by a processor, the above method is implemented.

[0042] The technical solution of the present invention also relates to an automated CUDA environment configuration and GPU stress test system, the system includes a computer device, and the computer device includes the above computer-readable storage medium.

[0043] The beneficial effects of the present invention are as follows:

[0044] The automated CUDA environment configuration and GPU stress test method and system of the present invention realize the automatic download of cuda and the configuration of the cuda environment, and conduct a comprehensive test on the GPU. The present invention realizes the automatic download and installation of CUDA and cuDNN, and automatically configures the environment variables, ensuring that the installed environment is immediately available without the user manually editing the configuration file, greatly reducing the need for manual operations and improving the efficiency and accuracy of the installation process. Combining the GPU stress test function, it can conduct a comprehensive test on the GPU, introduce artificial damage at the software level, test the robustness and error handling ability of the test system, and is conducive to accurately judging whether there is damage to the hardware. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 is a flowchart of the method according to the present invention.

[0046] Figure 2It is a schematic diagram of the mapping relationship table of device models and architectures, cuda versions, and cudnn versions according to the method of the present invention.

[0047] Figure 3 It is a flowchart for inputting account information according to the method of the present invention.

[0048] Figure 4 It is a flowchart for Shell execution according to the method of the present invention.

[0049] Figure 5 It is a flowchart of the matrix operation algorithm according to the method of the present invention. Specific embodiments

[0050] The concept, specific structure, and technical effects of the present invention will be clearly and completely described below in conjunction with embodiments and drawings to fully understand the purpose, solution, and effects of the present invention.

[0051] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. The singular forms "a", "the", and "said" used herein are also intended to include the plural forms unless the context clearly indicates otherwise. In addition, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this technology belongs. The terms used in the description of this specification are only for describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0052] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish elements of the same type from each other. For example, without departing from the scope of this disclosure, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element. The use of any and all examples or exemplary language (such as "for example", "such as", etc.) provided herein is only intended to better illustrate the embodiments of the present invention and will not impose a limitation on the scope of the present invention unless otherwise required.

[0053] Refer to Figures 1 to 5 , in some embodiments, the method for automatically configuring the CUDA environment and GPU stress testing according to the present invention includes at least the following steps:

[0054] S100. Construct a mapping relationship table of device models and architectures, cuda versions, and cudnn versions;

[0055] S200. Input the account information; connect to the Linux server via the SSH protocol according to the configured operating system account and password, and then transfer the Shell script via the SFTP protocol.

[0056] S300. Obtain the model of the device and return it. According to the query requirements for obtaining the device model, query the predefined mapping relation table to determine the architecture, cuda, and cudnn versions corresponding to the device model, and automatically execute the download, installation, and verification to obtain the automatically configured environment variables.

[0057] S400. Allocate memory and initialize the matrix, start the matrix operation algorithm, and comprehensively test the computing power and error correction ability of the GPU.

[0058] In some embodiments, refer to Figure 2 , the present invention first constructs a mapping relation table between the device model and the architecture, cuda version, and cudnn version, and the above mapping relation table will be updated following the iteration of the GPU.

[0059] In some embodiments, in the input processing of the account information of the present invention, connect to the Linux server via the SSH protocol according to the configured operating system account and password, and then transfer the Shell script via the SFTP protocol. Refer to Figure 3 , obtain the input information of the front-end web server, where the input information includes the IP address, account, and password, transfer the input information to the back-end server, start the SSH service by opening a thread in the Python server, perform SSH login using the configured operating system account and password, and connect to the Linux system via the SSH protocol and transfer the automatic installation script via the SFTP protocol.

[0060] Specifically, first import the paramiko module. Then create an SSH client instance named ssh for creating an SSH connection. Then, set the host key of the SSH client and automatically add the unknown host key to the local known host list using paramiko.AutoAddPolicy(). Then, connect to the remote server through the connect function, and its parameters include: the IP address remote_ip of the remote server, the port number remote_port, the username remote_user, and the password remote_password.

[0061] Then, define a string variable named env_content to store the content of the environment variable configuration. Next, open (or create) a file named env.sh and operate it in write mode ("w") to write the content in the env_content variable into this file. Then, create an SFTP client instance through ssh.open_sftp() and assign it to the variable sftp. Next, upload the local env.sh file to the directory on the remote server. Finally, delete the local env.sh file.

[0062] In some embodiments, during the Shell execution of the present invention, the gpu model is judged through a shell script and returned to the control end. The control end queries the requirements according to this model, queries the architecture and the corresponding versions of cuda and cudnn, and automatically executes the download, installation, and nvcc verification. After completion, an environment with cuda configured is obtained. See Figure 4 , first, SSH executes the Shell, which connects to the remote server through SSH and executes a Shell script. Then, in the Shell script, call exec_command to execute the command nvidia-smi to output the model information. Then, according to the extracted model, query the predefined mapping table (see Figure 2 ), obtain the CUDA and cuDNN version information corresponding to different models. According to the queried CUDA version, automatically download and install CUDA, and according to the queried cuDNN version, automatically download and install cuDNN. After the installation is completed, automatically configure the environment variables to ensure that CUDA and cuDNN can be correctly recognized and used. Then use the nvcc (NVIDIA CUDA Compiler) command to verify whether the CUDA environment is correctly configured. Among them, if the nvcc command can be successfully executed, it means that the CUDA environment has been correctly configured.

[0063] Specifically, by executing the command nvidia-smi --query-gpu=name --format=csv,noheader,nounits, obtain the model information of the NVIDIA graphics card in the current system and store it in the variable gpu_name. Use the queried graphics card model to retrieve the corresponding computing architecture code name from the predefined mapping table (see Figure 2 ), and output it. Then, according to the retrieved computing architecture code name, retrieve the corresponding one from the predefined mapping table (see Figure 2Find the supported CUDA version range in it. By setting the internal field separator IFS to a space, read the minimum and maximum CUDA version numbers of the corresponding entry in the mapping table, and output the maximum version number to determine the CUDA version range suitable for this computing architecture. Then, according to the determined CUDA version number, retrieve the compatible cuDNN version number from the predefined mapping table (see Figure 2 ) and output it for downloading and installing the correct version of the cuDNN library.

[0064] Next, through the defined install_cuda function, after assigning the passed-in CUDA version number to the local variable cuda_version, output the CUDA version information being installed, construct the download link for the CUDA installer, store it in the variable installer_url, and download the link to a temporary path file. Then, use the wget command to download the CUDA installation package from the constructed link to the specified installer_path path, set the file to executable permissions, and then use the sudo command to install the CUDA toolkit in silent mode. Then, in the download_cudnn function, assign the passed-in cuDNN version number and CUDA version number to the local variables cudnn_version and cuda_version respectively, output the cuDNN version information being downloaded, construct the download link for cuDNN, store it in the variable cudnn_url, and then download the link to the specified file. Then, use the curl command to log in and download with the cookies file. After logging in to the NVIDIA developer website with the curl command and saving the cookies information to the cookie_file file, use the saved cookies information to download the cuDNN library from the constructed link to the specified cudnn_path path. Then, in the install_cudnn function, assign the passed-in cuDNN version number and CUDA version number to the local variables cudnn_version and cuda_version respectively, then construct the extraction path for cuDNN, and use the tar command to extract the downloaded cuDNN compressed package to the specified directory to complete the installation of the cuDNN library.

[0065] Next, define a function named configure_environment in the provided script to configure the CUDA environment variables. It assigns the passed CUDA version number to the local variable cuda_version, outputs the path of the environment variables being configured, uses the echo command to add CUDA-related environment variables to the user's.bashrc file, where the environment variables include PATH and LD_LIBRARY_PATH, and uses the source ~ / .bashrc command to reload the.bashrc file to make the environment variables take effect immediately. Then, the main function of the script, the main function, calls the get_gpu_info function to obtain the GPU model and stores it in the variable gpu_name, and outputs the detected GPU model information. Then, it calls the get_gpu_architecture function to obtain the compute architecture of the GPU and stores it in the variable architecture. If the architecture is not detected, it outputs the unknown GPU model and exits the program. Then, it calls the get_cuda_version_for_architecture function to obtain the recommended CUDA version based on the architecture and stores it in the variable recommended_cuda_version, and at the same time outputs the recommended CUDA version. Also, it calls the get_cudnn_version_for_cuda function to obtain the recommended cuDNN version based on the recommended CUDA version and stores it in the variable recommended_cudnn_version, and at the same time outputs the recommended cuDNN version. Then, it calls the install_cuda function to install the recommended CUDA version, and calls the download_cudnn function to download the recommended cuDNN version, and calls the install_cudnn function to install this version. Then, it calls the configure_environment function to configure the environment variables, and uses the nvcc --version and nvidia-smi commands to verify the installation of CUDA and cuDNN, and outputs the information indicating that the installation and configuration are complete.

[0066] It should be noted that through the install_cuda and install_cudnn functions, the present invention can automatically identify the GPU model and architecture, download and install compatible CUDA and cuDNN versions, achieving full automation without user intervention, significantly reducing the operation complexity and error rate. Moreover, through the configure_environment function, the environment variables are automatically configured to ensure that the installed environment is immediately available without the user manually editing the configuration file.

[0067] In some embodiments, the present invention executes a custom matrix operation algorithm, which is divided into multiple steps such as memory allocation, matrix initialization, GPU video memory allocation, data copying to video memory, setting thread blocks and grids, starting matrix multiplication, error checking, and resource cleaning, so as to comprehensively test the computing power and error correction ability of the GPU. If the hardware is damaged, this program will report an error. See Figure 4 , which includes the steps:

[0068] S410. Initialize the matrix. The program first allocates memory on the host and initializes two matrices A and B, where the size of each matrix is N x N, and N is the defined matrix size. Further, in this example, the size of the matrix is 2048.

[0069] S420. Inject errors. To simulate hardware failures or memory corruption, the program randomly injects some errors into the initialized matrices A and B. Among them, these errors are implemented through the injectError function, which adds random values to certain elements in the matrix with a certain probability. The above probability is defined by INJECTION_RATE, and the probability in this example is 10%.

[0070] S430. Allocate device memory. The program allocates memory for matrices A, B, and result matrix C on the GPU.

[0071] S440. Data transfer. Copy the matrix data on the host from the host memory to the device memory.

[0072] S450. Execute the matrix multiplication kernel. The program starts an optimized matrix multiplication kernel function matMulOptimized, which uses shared memory to improve the computing efficiency. Further, the kernel function multiplies matrices A and B and stores the result in matrix C.

[0073] S460. Simulate memory corruption. To further simulate memory corruption, after the matrix multiplication is completed, the program uses another kernel simulateMemoryCorruption to randomly inject some errors into the result matrix C.

[0074] S470, Error checking. The program uses cudaGetLastError to check whether there are any errors in CUDA calls.

[0075] S480, Resource cleanup. The program releases the memory resources on the device and the host.

[0076] Specifically, first, a CUDA kernel function named matMulOptimized is defined to optimize matrix multiplication operations. This function defines a shared memory array sharedMem, which is used to store the sub-block data of matrices A and B during the execution of the kernel function. Then, three floating-point pointers sharedA, sharedB, and C are defined, which point to the corresponding positions of the sub-blocks of matrix A, matrix B, and the result matrix C in the shared memory respectively. Then, by calculating the starting row row and column col of the current thread block in the global matrix, it prepares for the subsequent access and positioning of matrix elements. Among them, row is calculated by multiplying the y-dimension index blockIdx.y of the thread block by the y-dimension size blockDim.y of the thread block, and then adding the y-dimension index threadIdx.y of the thread. And col is calculated by multiplying the x-dimension index blockIdx.x of the thread block by the x-dimension size blockDim.x of the thread block, and then adding the x-dimension index threadIdx.x of the thread.

[0077] It should be noted that through the simulateMemoryCorruption function that simulates memory corruption, the present invention can introduce artificial corruption at the software level to test the robustness and error handling ability of the system.

[0078] It should be recognized that the method steps in the embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or computer instructions stored in a non-transitory computer-readable memory. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, for this purpose, the program can run on a dedicated integrated circuit programmed for this purpose.

[0079] In addition, the operations of the processes described herein can be performed in any suitable order, unless otherwise indicated herein or otherwise clearly contradicted by the context. The processes described herein (or variations and / or combinations thereof) can be performed under the control of one or more computer systems configured with executable instructions and can be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executed jointly on one or more processors, by hardware, or by a combination thereof. The computer program includes a plurality of instructions executable by one or more processors.

[0080] Further, the method can be implemented in any type of computing platform operably connected to a suitable one, including but not limited to personal computers, minicomputers, mainframes, workstations, network or distributed computing environments, separate or integrated computer platforms, or communicating with charged particle tools or other imaging devices, etc. Aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into the computing platform, such as a hard disk, optical read and / or write storage medium, RSM, ROM, etc., such that it can be read by a programmable computer and, when the storage medium or device is read by the computer, can be used to configure and operate the computer to perform the processes described herein. In addition, the machine-readable code, or portions thereof, can be transmitted via a wired or wireless network. When such media include instructions or programs that implement the steps described above in combination with a microprocessor or other data processor, the inventions described herein include these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention can also include the computer itself.

[0081] The computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the transformed data represents physical and tangible objects, including a specific visual depiction of the physical and tangible objects generated on the display.

[0082] As described above, this is only a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. As long as it achieves the technical effects of the present invention by the same means, any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention. Within the scope of protection of the present invention, its technical solutions and / or implementation manners can have various different modifications and variations.

Claims

1. An automated method for configuring the CUDA environment and GPU stress testing, characterized in that, The method includes the following steps: S100. Construct a mapping table for the model and architecture of the GPU, cuda version, and cudnn version; S200. Input account information; connect to the Linux server via SSH protocol according to the configured operating system account and password, and then transfer the Shell script via SFTP protocol; S300. Obtain the model of the GPU and return it. According to the query requirements for the obtained GPU model, query the predefined mapping table to determine the architecture, cuda, and cudnn versions corresponding to the GPU model, and automatically execute download, installation, and verification to obtain automatically configured environment variables; S400. Allocate memory and initialize the matrix, start the matrix operation algorithm, and comprehensively test the computing power and error correction ability of the GPU; Among them, the step S400 includes: S410. Allocate memory on the host and initialize matrices A and B; S420. Randomly inject some errors into matrices A and B; among them, the randomly injected errors are implemented through the injectError function, which adds random values to certain elements in the matrix with a certain probability; S430. Allocate video memory on the GPU for matrices A, B, and result matrix C; S440. Copy matrices A and B initialized and injected with errors on the host from the host memory to the GPU video memory; S450. Start the first kernel function of matrix operation on the GPU, perform multiplication operation based on matrices A and B in the GPU video memory, and store the result in matrix C in the GPU video memory; S460. After the matrix operation is completed, use the second kernel function to randomly inject some errors into the result matrix C; S460. Check whether there is an error in the CUDA call; S470. Release the video memory of the GPU and the memory resources on the host; Among them, the access position of matrix elements is located by calculating the starting row row and column col of the current thread block in the global matrix; Among them, row is calculated as follows: multiply the y-dimension index blockIdx.y of the thread block by the y-dimension size blockDim.y of the thread block, and then add the y-dimension index threadIdx.y of the thread; Among them, col is calculated as follows: multiply the x-dimension index blockIdx.x of the thread block by the x-dimension size blockDim.x of the thread block, and then add the x-dimension index threadIdx.x of the thread.

2. The method according to claim 1, wherein The step S200 includes: S210. Obtain the input information of the front-end web server; the input information includes IP address, account, and password; S220. Pass the input information to the back-end server and start the SSH service by starting a thread in the Python server; S230. Log in via SSH using the configured operating system account and password, connect to the Linux system via SSH protocol, and transfer the automatic installation script via SFTP protocol.

3. The method according to claim 1, wherein The step S300 includes: S310. The SSH executes a Shell, which connects to a remote server via SSH and executes a Shell script. S320. In the Shell script, call exec_command to execute the command nvidia-smi to output the model information. S330. According to the extracted model, query the predefined mapping relation table to obtain the CUDA and cuDNN version information corresponding to different models. S340. According to the queried CUDA version, automatically download and install CUDA, and according to the queried cuDNN version, automatically download and install cuDNN. S350. After the installation is completed, automatically configure the environment variables to ensure that CUDA and cuDNN can be correctly recognized and used. S350. Verify whether the CUDA environment is configured correctly.

4. The method according to claim 3, characterized in that The step S340 includes: Find the supported CUDA version range from the predefined mapping relation table, and by setting the internal field separator IFS to a space, read the minimum and maximum CUDA version numbers of the corresponding entry in the mapping table, and output the maximum version number to determine the CUDA version range suitable for this computing architecture.

5. The method according to claim 4, wherein In the step S340, Assign the incoming cuDNN version number and CUDA version number to local variables cudnn_version and cuda_version respectively, output the cuDNN version information being downloaded, construct the download link of cuDNN, store it in the variable cudnn_url, and then download the link to the specified file. Use the curl command to log in and download with the cookies file. After logging in to the NVIDIA developer website with the curl command and saving the cookies information to the cookie_file file, use the saved cookies information to download the cuDNN library from the constructed link to the specified cudnn_path path. In the install_cudnn function, assign the incoming cuDNN version number and CUDA version number to local variables cudnn_version and cuda_version respectively, construct the decompression path of cuDNN, and use the tar command to decompress the downloaded cuDNN compressed package to the specified directory to complete the installation of the cuDNN library.

6. A computer-readable storage medium, characterized in that, It stores program instructions, and when the program instructions are executed by a processor, the method described in any one of claims 1 to 5 is implemented.

7. An automated CUDA environment configuration and GPU stress testing system, characterized in that, It includes: A computer device, and the computer device includes the computer-readable storage medium according to claim 6.

Citation Information

Patent Citations

  • Deployment method and device of deep learning platform cluster, medium and electronic equipment

    CN111459506A

  • Automatic test method for GPU systematization

    CN116089181A