Installing the CUDA Toolkit
You acknowledge and agree that you need to download and integrate the open source and third-party dependency software for using the Compiler and Debugger to debug CUDA programs. Huawei does not assume any responsibility for the software vulnerabilities and security issues.
CUDA-GDB supports debugging of 32-bit and 64-bit CUDA C/C++ applications. It provides full control over the execution of the CUDA application including breakpoints and single-stepping. You can examine variables, read/write memory and registers, and inspect the GPU status when the application is suspended. GPU and CPU code can be called simultaneously in the same application. The CUDA-GDB and cuda-gdbserver must be installed when the CUDA program is used for debugging.
As an example, the following steps explain how to install the CUDA Toolkit on Linux.
Pre-installation Operations
- Check whether the system has a CUDA GPU.
1lspci | grep -i nvidia
If the command output shows that the GPU is from NVIDIA and listed in https://developer.nvidia.com/cuda-gpus, the GPU supports CUDA. If no result is displayed, the GPU does not support CUDA. See Figure 1.
- The CUDA development tool is supported only on certain Linux distributions. Verify whether the system is running a Linux version that supports the tool.
1uname -m && cat /etc/*release
If the result is in the Linux distribution list, the system is running a supported Linux version and supports the CUDA installation. If it is not in the distribution list, CUDA cannot be installed.
- Though a compiler is not required for running CUDA applications, it is necessary for development using CUDA. A compiler is usually installed in the Linux OS. In most cases, the GCC version installed using a supported Linux version works properly. Check whether GCC is installed on the system.
1gcc --versionIf an error message is displayed, find the corresponding GCC version from the Linux distribution list and install it.
- The kernel header file and development package supported by the running kernel are required to be installed when the CUDA driver is installed and rebuilt. To ensure the correct kernel header file and development package are installed, run the following command to search for the running kernel version:
1uname -rFind the kernel version and run the following command to install the kernel header file and development package corresponding to the kernel version (RHEL 7/CentOS 7 is used as an example):
1sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)
- Install the NVIDIA driver. Download the NVIDIA driver based on the graphics card type. See Figure 2.
Click SEARCH to find the corresponding driver. Download it, and run it on the console.

