Jetson AGX Xavier - No CUDA-capable device is detected

Hi,
I tried to run my application on Jetson AGX Xavier and have this error:

Importing library darknet for YOLO AlexeyAB
    Loading YOLO model
     Try to load cfg: /.../file1.cfg, weights: /.../file2.weights, clear = 0 
    CUDA status Error: file: ./src/dark_cuda.c : () : line: 499 : build time: Jul 22 2020 - 09:42:45 

     CUDA Error: no CUDA-capable device is detected
    python3: Segmentation fault (core dumped)

I am running the application as a normal user
I tried to add the user to the group “video” as suggested here but that doesn’t resolve my problem

I installed the Jetson AGX Xavier Using JetPack 4.4

CUDA version:

$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_21:14:42_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89

Tegra version:

$ cat /etc/nv_tegra_release
# R32 (release), REVISION: 4.3, GCID: 21589087, BOARD: t186ref, EABI: aarch64, DATE: Fri Jun 26 04:34:27 UTC 2020

Sample test to detect CUDA and GPU Driver as suggested here:

$ sudo docker run --runtime=nvidia devicequery:latest
./deviceQuery Starting...
 CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "Xavier"
  CUDA Driver Version / Runtime Version          10.2 / 10.2
  CUDA Capability Major/Minor version number:    7.2
  Total amount of global memory:                 15823 MBytes (16591314944 bytes)
  ( 8 ) Multiprocessors, ( 64) CUDA Cores/MP:     512 CUDA Cores
...
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.2, CUDA Runtime Version = 10.2, NumDevs = 1
Result = PASS

Any help would be very appreciated!

Hi,

The error indicates that you didn’t build the binary with correct GPU architecture.
For Xavier, please use sm_72 architecture.

The architecture need to be specified in Makefile as below here and recompile the project with the new configure:
https://github.com/AlexeyAB/darknet/blob/master/Makefile#L20

diff --git a/Makefile b/Makefile
index 63e15e6..9a7471d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,11 @@
-GPU=0
-CUDNN=0
-OPENCV=0
+GPU=1
+CUDNN=1
+OPENCV=1
 OPENMP=0
 DEBUG=0
 
-ARCH= -gencode arch=compute_30,code=sm_30 \
-      -gencode arch=compute_35,code=sm_35 \
-      -gencode arch=compute_50,code=[sm_50,compute_50] \
-      -gencode arch=compute_52,code=[sm_52,compute_52]
+ARCH= -gencode arch=compute_72,code=sm_72 \
+      -gencode arch=compute_72,code=[sm_72,compute_72]
 #      -gencode arch=compute_20,code=[sm_20,sm_21] \ This one is deprecated?
 
 # This is what I use, uncomment if you know your arch and want to specify

Thanks.