Cuda cross-compilation questions

Hello.

After compiling CUDA CORSS with the environment target below, the size of the generated object file is different from the size of the compiled object file on the target board is different from the size of the compiled object file, and it doesn’t work.

  • Environment
    target : jetpack 5.1.2 / jetson orin nx 8gb
    host : JetPack Cross Compilation container( 5.1.2 )

To troubleshoot the issue, I compared the target and host environments and found that the build versions of nvcc are different.

target nvcc : 
  nvcc: NVIDIA (R) Cuda compiler driver
  Copyright (c) 2005-2022 NVIDIA Corporation
  Built on Sun_Oct_23_22:16:07_PDT_2022
  Cuda compilation tools, release 11.4, V11.4.315
  Build cuda_11.4.r11.4/compiler.31964100_0
  
host nvcc :
  nvcc: NVIDIA (R) Cuda compiler driver
  Copyright (c) 2005-2021 NVIDIA Corporation
  Built on Mon_Oct_11_21:27:02_PDT_2021
  Cuda compilation tools, release 11.4, V11.4.152
  Build cuda_11.4.r11.4/compiler.30521435_0

The nvcc version used by target is 11.4.315,
host is 11.4.152, and cuda-nvcc-cross-aarch64-11-4 installed on host is 11.4.315.

  • cuda-nvcc-cross-aarch64-11-4/stable,now 11.4.315-1 all [installed,automatic]

I think unifying the host’s NVCC to 11.4.315 will solve the problem, but the deployed package does not exist.
Is there any way to get the package?
If I can’t get it, I would like to know other solutions.

Thanks.

Hi,

What kind of error do you meet when you run the binary built from the cross-compiling container?

Thanks.

There are no externally exposed symptoms of the error.

  • No error logs and no crashes

It seems to simply skip the behavior of the CUDA kernel.

Additional information.

The Cuda kernel used for compilation is the sample code found in jetson_multimedia_api.

/usr/src/jetson_multimedia_api/samples/common/algorithm/cuda
-rw-r--r-- 1 root root 2694 Aug 1 2023 Makefile
-rw-r--r-- 1 root root 4607 Aug 1 2023 NvAnalysis.cu
-rw-r-r--r-- 1 root root 2174 Aug 1 2023 NvAnalysis.h
-rw-r-r--r-- 1 root root 6122 Aug 1 2023 NvCudaProc.cpp
-rw-r--r--r-- 1 root root 2128 Aug 1 2023 NvCudaProc.h

Hi,

Does the binary can run normally on the target?
If yes, is this issue only related to the binary size?
If not, could you share what kind of error you met with us?

Thanks.

Hi,

The cross compiled binaries are running in target.
As far as I can find, there is nothing unusual about the situation other than the difference in binary size.
Also, there are no error messages at all.

Thanks.

Hi

Thanks, we will give it a try and then provide more info to you.
Thanks.

Hi,

We are not able to reproduce this issue.
Could you double-check it again?

1. OrinNX 8G setup with JetPack 5.1.2

nvidia@tegra-ubuntu:/usr/src/jetson_multimedia_api/samples/common/algorithm/cuda$ ll
total 88
drwxr-xr-x 2 root root  4096 Nov 20 09:27 ./
drwxr-xr-x 4 root root  4096 Nov 20 09:16 ../
-rw-r--r-- 1 root root  2694 Aug  1  2023 Makefile
-rw-r--r-- 1 root root  4607 Aug  1  2023 NvAnalysis.cu
-rw-r--r-- 1 root root  2174 Aug  1  2023 NvAnalysis.h
-rw-r--r-- 1 root root 43824 Nov 20 09:27 NvAnalysis.o
-rw-r--r-- 1 root root  6122 Aug  1  2023 NvCudaProc.cpp
-rw-r--r-- 1 root root  2128 Aug  1  2023 NvCudaProc.h
-rw-r--r-- 1 root root  5008 Nov 20 09:27 NvCudaProc.o

2. nvcr.io/nvidia/jetpack-linux-aarch64-crosscompile-x86:5.1.2 container:

root@*****:/l4t/targetfs/usr/src/jetson_multimedia_api/samples/common/algorithm/cuda# ll
total 88
drwxr-xr-x 2 root root  4096 Nov 21 00:31 ./
drwxr-xr-x 4 root root  4096 Aug  3  2023 ../
-rw-r--r-x 1 root root  2694 Aug  3  2023 Makefile*
-rw-r--r-x 1 root root  4607 Aug  3  2023 NvAnalysis.cu*
-rw-r--r-x 1 root root  2174 Aug  3  2023 NvAnalysis.h*
-rw-r--r-- 1 root root 43824 Nov 21 00:31 NvAnalysis.o
-rw-r--r-x 1 root root  6122 Aug  3  2023 NvCudaProc.cpp*
-rw-r--r-x 1 root root  2128 Aug  3  2023 NvCudaProc.h*
-rw-r--r-- 1 root root  5008 Nov 21 00:31 NvCudaProc.o

Thanks.

Hi.

I rebuilt the environment and reproduced it and it works fine.

Thanks for your help.

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