How to remove ASCII symbol names from CUDA generated binary?

I have a CUDA project in Visual Studio 2010. The .exe that gets generated has binary executable code for both the GPU and CPU. But it also has ASCII text with the full pathname of the CUDA file, and the constants, shared memory, and texture variable names defined in the CUDA .h file. In the Visual Studio properties for the project, and for the CUDA file specifically, I have disabled all debugging generation options for the CPU host and GPU device. I don’t want any ASCII names in the executable. Is there a way to remove them all?

Here’s the CUDA C/C++ Compiler Command Line:

set CUDAFE_FLAGS=–sdk_dir "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A"
“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin\nvcc.exe” --use-local-env --cl-version 2010 -ccbin “c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64” --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -o x64\Release%(Filename)%(Extension).obj “%(FullPath)”

set CUDAFE_FLAGS=–sdk_dir "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A"
“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin\nvcc.exe” --use-local-env --cl-version 2010 -ccbin “c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64” --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -use_fast_math -Xcompiler "/EHsc /nologo /O2 /Zi " -o x64\Release%(Filename)%(Extension).obj “%(FullPath)”

And here is the CUDA Linker Command Line:

“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin\nvcc.exe” -dlink -o x64\Release\Program.device-link.obj -Xcompiler "/EHsc /nologo /O2 /Zi "

Doing a quick check with a local build, it seems that even when I build an executable without embedded PTX some of the symbol names are visible. That is probably by design as CUDA allows to reference data by symbol name, e.g. for cudaMemcpyToSymbol(). The kernel names are probably retained for the same reason, as handles used during loading the code into the GPU.

I am not aware of any nvcc option that suppresses the symbol names where possible (that is, if not referenced by API calls). You may want to consider filing an enhancement request with NVIDIA, using the bug reporting form linked from the registered developer website.

I do not know the reason behind the desire to hide the symbol names. If the idea is to protect against reverse engineering attempts, I assure you the protection offered by hiding symbol names tends towards zero. You could try a code obfuscator to mangle symbol names beyond recognition.

Perhaps there is a CUDA C obfuscator, but we couldn’t find one. We are just going to write a code scrambler for the source and then feed the scrambled source into the compiler. For production level code, the compiler should have this capability built into it.

OP may find this helpful: https://www.thc.org/root/phun/unmaintain.html

@cudev91: CUDA development is very much customer driven, so I would recommend filing an RFE (request for enhancement) via the bug reporting form to get this on NVIDIA’s radar.