Unable to use GPU with pytorch yolov5 on jetson nano


We are using Pytorch Yolov5 with Strongsort on jetson nano with jetpack 4.5.1

We used PyTorch 1.10 with python3.6. We installed PyTorch using these links;

We notice that wherever we start the app, only the CPU is being used and we were not able to activate GPU. Also, when we run torch.cuda.is_available(), we get False.

Could you help us figure out a solution?

Hi @janet, are you sure that a generic PyTorch package didn’t get installed when installing the YOLO dependencies? You might want to try doing pip3 uninstall torch, and then re-install the PyTorch 1.10 wheel for Jetson (that wheel was built with CUDA enabled)

Then try running this to confirm that PyTorch detects your GPU:

python3 -c 'import torch; print(torch.cuda.is_available())'

If that still returns false, then I recommend to try running the CUDA deviceQuery sample to make sure that the GPU driver is working:

cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.