Cuda cannot be called by Python programs

The Jetson nano is installed with Ubuntu 18.04 system and Jetpack 4.6.1. I have configured the PATH path of cuda and created a virtual environment called myenv using venv. After activating the virtual environment, I run nvcc - V, and it can be seen that the version is 10.2. The YOLOv5 project is running, and the Python installation version is 3.9.13. According to the official documentation, Torch-1.12.0 and Torchvision-0.13.0 are installed. After running the program normally, it shows that the CPU is being called, and no matter what, GPU cannot be called to run the program. What is the problem with my manipulation? Additionally, the command ‘nvidia smi’ returns no response after running it. The instruction cannot be found, and no information about this instruction on the system can be found through the ‘find’ instruction.


Is your Torch and TorchVision built with CUDA support?