nvcc fatal: failed to open output file '/tmp/tmpxft_0000*****'

nvcc is a compiler driver and does a lot of steps “under the hood”. During this process it creates a variety of temporary files which by default get stored in the /tmp directory on linux.

Apparently whatever user account you are working from does not have the necessary privilege to access files in /tmp You can easily verify this with:

touch /tmp/test_file

and see if it succeeds or gives you an error message (from the non-root account). If you get an error message, you will need to sort out your user privileges.

as a possible work-around, you could specify

nvcc --keep ...

which will make a mess of your current directory, but will not use the default temporary directory.

http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#keeping-intermediate-phase-files