Unable to run python app with yolov5 pytorch on GPU on jetson nano


We are trying to run a python app with Yolov5. We are using pytorch 1.8.0 and torchvision 0.9.1 with python 3.6. The app functions on CPU successfully but we haven’t been able to make it work on GPU.

We activated cuda and converted the model to tensorRT.

When we run the app and put the device parameter to 0 ( CUDA as a running device) we get the following message that the app gets killed:

detector: yolo_weights=/home/linkers/people-counter/weights/Best-stream1-agegenderv06.pt, save_data=False, reid_weights=/home/linkers/people-counter/weights/osnet_x0_25_msmt17.pt, tracking_method=strongsort, source=streams.txt, imgsz=[640, 640], conf_thres=0.5, iou_thres=0.5, max_det=1000, device=0, show_vid=False, save_txt=False, save_track=True, save_conf=False, save_crop=False, save_vid=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs/track, name=exp, exist_ok=False, line_thickness=2, hide_labels=False, hide_conf=False, hide_class=False, half=False, dnn=False, vid_stride=1
WARNING ⚠️ Python 3.7.0 is required by YOLOv5, but Python 3.6.9 is currently installed
YOLOv5 🚀 2023-1-10 Python-3.6.9 torch-1.8.0 CUDA:0 (NVIDIA Tegra X1, 3964MiB)


Also when we run: torch.rand(10).to(0) it gets killed, and the result for torch_cuda_is_available is True.

Could you help us make it function on GPU to enhance our inference time?