Pytorch uses different versions of cuda to compile the extension library. In fact, TensorFlow is the same, compiling the Dcn v2 example. Upgrade GCC

When using pytorch, we may need to expand some functions, such as DcnV2 of near random convolution . At this point, we need to choose the appropriate version of cuda to install and compile the extension. Since multiple versions of cuda may have been installed on our computer, at this time we can switch the cuda version used by setting environment variables at will. Install multiple versions of the computer as follows
Insert picture description here

  1. Why do I need to install the cuda library if I compile the extension library after installing pytorch.
    Whether we install pytorch such as the depth of the frame by when we can find pytorch will be with cudatoolkit, as shown below: the attachment of cudatoolkit with CUDA Toolkit we provide through the official Nvidia is not the same. Specifically, the cuda package officially provided by Nvidia contains many drivers, cuda dependent libraries, examples, etc., as well as various library files and their header files corresponding to the functions supported by CUDA, the compiler of CUDA programs. For the composition of CUDA Toolkit Major Components , please refer to CUDA Toolkit Major Components. In fact, the CUDA Toolkit officially installed by Nvidia includes all the components related to the process of compiling and debugging CUDA-related program development. But for deep learning frameworks such as Pytorch, it only needs to use the CUDA dynamic link library to support the running of the program in most cases that require the use of GPU (Pytorch itself and CUDA-related parts are compiled in advance), just Like the common practicable
    Insert picture description here

Guess you like

Origin blog.csdn.net/yangdashi888/article/details/103840968