/bin/sh -c XXXXXXXXX Permission denied

Last login: Tue Apr 11 22:28:58 2017 from 192.168.8.206
echo $PWD’>’
/bin/sh -c “cd "/home/ubuntu";export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64":${LD_LIBRARY_PATH};"/home/ubuntu/Templates"”;exit
ubuntu@tegra-ubuntu:~$ echo $PWD’>’
/home/ubuntu>
ubuntu@tegra-ubuntu:~$ /bin/sh -c “cd "/home/ubuntu";export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64":${LD_LIBRARY_PATH};"/home/ubuntu/Templates"”;exitt
/bin/sh: 1: /home/ubuntu/Templates: Permission denied
logout

Could you help me solve “Permission denied”?

start like https://devblogs.nvidia.com/parallelforall/remote-application-development-nvidia-nsight-eclipse-edition/

If this is on a TK1 then the other thread would be the place to reply…are you saying this is an issue on both a TX1 and a TK1?

This is on tx1 , but using the method like on tk1. The problem appeared in 2015,not be solved which I find in other reply。

ssh keys and logins do work the same way regardless of TK1 or TX1, but since I can’t use JetPack with my host there isn’t a lot I can do to see what it is if you refer to something from JetPack or what JetPack configures. If ssh permissions are not correct, then the issue is unrelated to whether it is a Jetson, whether it is Ubuntu, or Fedora. JetPack does set up networking, so JetPack has an influence on this…but understand that ssh keys are generated in an installation, and that if your keys change, this is a problem. Each flash the keys will probably change.

There is also the problem that error messages may be overly cryptic. Supposing you need sudo to run a command, but you haven’t enabled the mechanism for a password popup (the ssh “askpass” mechanism)…you could see a message like above, it would be because you didn’t enter a password (with no popup, you couldn’t enter a password…you’d never even know it asked for one). Or files themselves could be invalid permission. Maybe you’re executing GPU code requiring membership in group video, but not actually in that group…you’d get the same error message.

A lot more information is needed on exact steps. I can’t use the JetPack instructions because I can’t use JetPack (and have a Fedora host). What was the command which led to the error? Has the board been flashed before? Does command line ssh work? Can your user execute or run some part of the command without nsight?

Thank you for your reply.
The steps are following:

  1. start nsight ,not sudo nsight, because when I run this command it will remind me not install;
    wy@wy:~$ nsight
    Java HotSpot™ 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
    CompilerOracle: exclude java/lang/reflect/Array.newInstance

Excluding compile: static java.lang.reflect.Array::newInstance

  1. “File->New->CUDA C/C++ Project” and import an existing CUDA sample to start the Project Creation wizard. For the project name, enter “test” and select “Import CUDA Sample” in the project type and and select the supported “CUDA Toolkit 8.0” in the toolchain.
    3.Next, choose the Boxfilter sample->particles;
    4.Device linker mode: Gennerate PTX code :5.0 and Gennerate GPU code :5.0;
    5.Target Systems → manager, add ubuntu@192.168.8.121, enter ssh key ,everything is right enter → finish;
    6.Choose “AArch64” for Jetson TX1 and delete local systems, because my host hasn’t a nvidia gpu;
    7.point “next” → Debug and Release are chosed → finish;
    8.Right click on the project and navigate to Properties->Build->Settings->Tool Settings->NVCC Linker->Libraries and edit and enter the “Library search path(-L)” to point to linux/aarch64;
  2. run configure → C/C++ Remote->Remote Connection is right:ubuntu@192.168.8.121 , and Remote toolkit → manage → Detect the right place :/usr/local/cuda-8.0/bin , and enter the ssh keys ->finish , choose run remote executable , and Browse → /home/ubuntu/Templates (in the TX1);
  3. point Run ,waiting, this follows:
    Last login: Fri Apr 14 10:52:58 2017 from 192.168.8.206
    echo $PWD’>’
    /bin/sh -c “cd "/home/ubuntu";export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64":${LD_LIBRARY_PATH};"/home/ubuntu/Templates"”;exit
    ubuntu@tegra-ubuntu:~$ echo $PWD’>’
    /home/ubuntu>
    ubuntu@tegra-ubuntu:~$ /bin/sh -c “cd "/home/ubuntu";export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64":${LD_LIBRARY_PATH};"/home/ubuntu/Templates"”;exitt
    /bin/sh: 1: /home/ubuntu/Templates: Permission denied
    logout

what can i do? Thx

nsight eclipse is your debug tool or vim ? If not tell me the better methods to debug in the host connecting TX1 or directly in the TX1 ,Thx a lot!!

plus: 192.168.8.206 is my host ip

can you contact me by email: 109443322@163.com ? Maybe your crushed guidances are big steps for me ,Thx

other try

cuHook Sample
cuHook sample builds both the library and the executable. cuHook sample should be imported as the “makefile” project using the following steps.
From the main menu, open the new project wizard - File > New… > CUDA C/C++ Project
Select project type “Makefile project” and choose “Empty Project”
Specify the project name and project files location.
Complete the wizard. The project will be shown in the Project Explorer view.
Right click on the project - Import… > General > File System
On the next wizard page, select the location of cuHook sample(Samples/7_CUDALibraries/cuHook)
Select all the source files and makefile and Finish the wizard
Build the project by clicking on the hammer button on the main toolbar.
To run the sample, from the main menu - Run > Run Configurations… > Select the executable > Go to Environment tab > New… > enter Name=LD_PRELOAD, Value=./libcuhook.so.1 > Run will execute the sample

the result is following

Last login: Fri Apr 14 15:45:59 2017 from 192.168.8.206
echo $PWD’>’
/bin/sh -c “cd "/media/ubuntu/addition";export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64":${LD_LIBRARY_PATH};export LD_PRELOAD="/home/wy/cuda-workspace/test1";"/media/ubuntu/addition/workspace"”;exit
ubuntu@tegra-ubuntu:~$ echo $PWD’>’
/home/ubuntu>
ubuntu@tegra-ubuntu:~$ /bin/sh -c “cd "/media/ubuntu/addition";export LD_LIBRARY_PATH="/usr/local/cuda-8.0/lib64":${LD_LIBRARY_PATH};export LD_PRELOAD="/home/wy/cuda-workspace/test1";"/media/ubuntu/addition/workspace"”;exit
/bin/sh: 1: /media/ubuntu/addition/workspace: Permission denied
logou

Read more at: http://docs.nvidia.com/cuda/nsight-eclipse-edition-getting-started-guide/index.html#ixzz4eD8zDrSz
Follow us: @GPUComputing on Twitter | NVIDIA on Facebook

I experienced the same " Permission denied" by 3.3 and 3.4 in link :

http://docs.nvidia.com/cuda/nsight-eclipse-edition-getting-started-guide/#unique_21418070

I see in the error that something is being attempted on the Jetson which is something the Jetson doesn’t allow. It then exits, but is spelled “exitt”. It’s kind of a long shot, but I’m wondering if this being spelled wrong actually occurred (perhaps it wasn’t really “exitt” and is just a case of typing error)…if it did, then missing the command through misspelling might result in permission denied messages over ssh.

The other thing to look at is everything within “/home/ubuntu/Templates/”. What are permissions shown for “ld -ld /home/ubuntu/Templates” “ls -ld /home/ubuntu/Templates”? Can user ubuntu manually cd into that directory? If so, what is the output of “ls -ld *”?

Also, if the permission denied was execute permission (versus file access permission), then the user doing the execution of anything requiring GPU means the user must be in group “video”. This applies to the login of the machine which provides the GPU (which in turn can be unexpectedly different if doing remote display from a Jetson to a different host). I see “/home/wy/” at one point…if this is on the host it won’t hurt anything…if there is a user “wy” on the Jetson, then user “wy” must be added to group “video” before GPU execution is allowed.

ubuntu@tegra-ubuntu:~$ ld -ld /home/ubuntu/Templates
ld: cannot find -ld
ld: cannot find /home/ubuntu/Templates: File format not recognized

ubuntu@tegra-ubuntu:~/Templates$ ls -ld /home/ubuntu/Templates
drwxrwxrwx 2 ubuntu ubuntu 4096 May 6 2016 /home/ubuntu/Templates

and,
how can i do add “wy” to group “video” before GPU execution?

i cannot add “wy” to group “video” before GPU execution, it turns to “ubuntu” itself…
and I cannot change the "Others "to Read and write in “permissions for enclosed files” ,Owner and Group are both Read and write

Sorry, my original command had a typo…instead of “ld -ld” “ls -ld” (edited in original…you guessed correctly this was what I meant).

My brain is a bit fuzzy, been sick for the last week, but I’m not sure what you mean about it turning into ubuntu. If your commands are from user “ubuntu” then “ubuntu” is already part of group video. To add user “wy” to video try:

sudo usermod --groups video wy

Verify with “grep video /etc/group” and see if “wy” is in the list.