nvprof is not in the default path for root, and thus I’d need to add the full path
my program actually wants to run with the environment and user ID of a particular user
I can work around both of these in my code, but it would be better if you fixed it, instead of just documenting it.
Specifically, you would want to:
set the suid bit on the nvprof executable, so it always runs as root even when called from a regular user
make sure to call seteuid(getuid()) and setegid(getgid()) before starting the debugged program, so that the debugged program is run using regular user privileges
you’ll need to set up whatever is needed for the debugger in the wrapping nvprof tool, so that it can run with regular privileges once the normal program starts
The root cause is much more complicated.
There are some security issue of our CUDA toolkit and you will have to run nvprof as root in the near future.
Sorry that we cannot illustrate too much about the real cause.
But we are working on fixing it and will share with you once the root authority is no more required.