Struggling to cross-compile on target

Hi everyone,

I want to develop some applications with nsightEE and execute them on the NX, i recently installed all of the CUDA components with SDK Manager.
I was able to build and execute a CUDA sample locally, but i couldn’t got it to work on my NX and i had the “permission denied” error so i followed these steps on my NX :

1. Setup root password

$ sudo passwd root

2. Edit /etc/ssh/sshd_config and modify these lines

+PermitRootLogin yes

+PermitEmptyPasswords no

3. Reboot

$ sudo reboot

It didn’t work and nsight hit me with the
Unable to find full path for “nvcc”
Indeed, nvcc --version was an unknown command.
Installing the toolkit with sudo apt install nvidia-cuda-toolkit, gave me an error code (1) :
dpkg-deb: erreur: coller subprocess was killed by signal (Broken pipe)

but nvcc was still installed :

 $ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85

sudo apt --fix-broken install doesn’t do anything.
Should i purge the nvidia-cuda-toolkit package and reinstall it ? Will it damage other CUDA components ?

Now my application can’t locally build and it give me :

Console return

11:48:10 **** Incremental Build of configuration Debug for project sample_cuda ****
make all
Building file: …/src/imageDenoising.cu
Invoking: NVCC Compiler
/usr/bin/nvcc -I"/usr/local/cuda-11.1/samples/3_Imaging" -I"/usr/local/cuda-11.1/samples/common/inc" -I"/home/louis/cuda-workspace/sample_cuda" -G -g -O0 -gencode arch=compute_35,code=sm_35 -odir “src” -M -o “src/imageDenoising.d” “…/src/imageDenoising.cu”
cc1plus: fatal error: cuda_runtime.h: Aucun fichier ou dossier de ce type
compilation terminated.
src/subdir.mk:36: recipe for target ‘src/imageDenoising.o’ failed
make: *** [src/imageDenoising.o] Error 1

11:48:10 Build Finished (took 58ms)

Please be aware that i’m not used to configure IDEs and i’m beginning with Jetson products.

Hi,

Do you want to cross-compile an app or remote-compile it?
If you only want an IDE environment, use remote-compile will be easier since fewer dependencies.

Here is a tutorial for your reference.
Please noted that you would need to use JetPack4.4 instead, although the topic is for JetPack4.3:

Thanks.

Do you want to cross-compile an app or remote-compile it?
If you only want an IDE environment, use remote-compile will be easier since fewer dependencies.

I want to develop an application based on a Nvidia sample from VPI (Vision Programming Interface) and run it on target.
So based on your explanations my terms was incorrect and i only want to remote-compile.

I went through your tutorial, but i couldn’t get past these steps :

  • Please install OpenJDK 8 from this document .
  • Launch nsight with this commnad:
    $ /usr/local/cuda-10.0/bin/nsight -vm /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
  1. Create a vectorAdd project
    File -> New -> CUDA C/C++ Project -> Type project name -> Import CUDA sample -> Next

I couldn’t launch the command that you provided even when i ajusted the cuda version (i have cuda 11.1) and try with OpenJDK8 or OpenJDK11. I have Jetpack 4.4.1 (Seen on SDKmanager).

I can launch the nsight command on terminal but i can’t choose Import CUDA Sample when i am in the project selection.

More informations :
I can’t choose Import CUDA Sample on the project creator probably because i don’t have nvcc :
Terminal is throwing Unable to find full path for “nvcc” while i’m using nsight.
Checked installation with SDKM, it seems fine. and running whereis nvcc returns nothing.

The last time i tried to install nvcc with this command : sudo apt install nvidia-cuda-toolkit, the installation went wrong and i could only purged it.

I also noticed that in this step :

  1. Create a vectorAdd project
    File -> New -> CUDA C/C++ Project -> Type project name -> Import CUDA sample -> Next
    vectorAdd -> Next
    Generate PTX code -> select 5.3(Nano), 6.2(TX2), 7.2(Xavier)
    Generate GPU code ->select 5.3(Nano), 6.2(TX2), 7.2(Xavier)

I can’t select the correct PTX and GPU code which should be 7.2, i have a NX Xavier and my compute capability is 3.5 (which is related to my graphic card)

At this point I uninstall everything cuda-related and i did the following :

  • Install gcc version 7.5.
  • Followed these instructions with my setup : Linux ; x86_64 ; Ubuntu ; 18.04 ; deb (local).
  • I also did sudo apt-get -f install after the installation of the .deb files.

I then noticed that nsightEE didn’t show any of the cuda samples in the create project option. But i could get over it with exporting path :
export PATH=/usr/local/cuda-11.2/bin${PATH:+:${PATH}}

export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

But these path would reset every time i logout/login.
I saw that ssh packages sometimes causes issues when loading the ~/.profile file
so i did this and put those two path in my ~/.profile file
sudo sed -i ‘s/use-ssh-agent/no-use-ssh-agent/’ /etc/X11/Xsession.options

Now NsightEE find cuda samples, but building samples gives me this error :
/usr/local/cuda-11.2/samples/common/inc/helper_gl.h:23:14: fatal error: GL/gl.h: No such file or directory
src/subdir.mk:28: recipe for target ‘src/imageDenoisingGL.o’ failed
I will now check this.

Did these two commands :
sudo apt-get install freeglut3
sudo apt-get install freeglut3-dev
And my application worked locally and remotely !!

For others people having those kind of issues with nsightEE, solution is in post 5 and this one.