CUDA Applications
The following resources are available to help you build and run CUDA sample
applications:
- The installations of CUDA Host x86 and Linux AArch64 are in the
/usr/local/cuda-11.4/
folder. - The source code files of all CUDA samples are in the
/usr/local/cuda-11.4/samples
folder. - For more information about CUDA toolkit, see CUDA Toolkit Documentation v11.4.1.
Building CUDA Sample Applications for the Linux Target
Host cross-compile is supported for DRIVE OS releases only. After you finish installing CUDA x86 and cross-compile packages, perform the following steps:
- Install the CUDA sample sources to a directory where you do not need root
privileges to write, such as the $HOME directory as shown in the following example:
$ cd ~/
- If you installed the driveos-oobe-desktop filesystem, use the following
command to run the
cuda-install-samples-11.4.sh
script from the CUDA installation in the target file system:$ <$NV_WORKSPACE>/drive-linux/filesystem/targetfs/usr/local/cuda-11.4/bin/cuda-install-samples-11.4.sh .
- If you installed the default Debian local repo, install from the host CUDA
directory and remove the
nvJPEG
folders:$ /usr/local/cuda-11.4/bin/cuda-install-samples-11.4.sh . $ cd ~/NVIDIA_CUDA-11.4_Samples/7_CUDALibraries/ $ rm -r nvJPEG* $ cd ~/NVIDIA_CUDA-11.4_Samples
- If you installed the driveos-oobe-desktop filesystem, use the following
command to run the
- Build the sample application.
$ make TARGET_ARCH=aarch64 TARGET_OS=linux SMS=87
Note: This command will build a sample application for the Orin GPU (SMS=87
). To build CUDA applications with other GPUs, replace theSMS
value with the corresponding target compute version.
Running CUDA Sample Applications
To run a CUDA sample application,
- Copy the sample files of your choice to the target.
- From the target, run the sample application.
$ cd ~/
$ rcp -r <username>@<host ip address>:/path/to/NVIDIA_CUDA-11.4_Samples/ .
$ cd NVIDIA_CUDA-11.4_Samples/1_Utilities/deviceQuery
$ ./deviceQueryDrv // you can launch any sample application