Interleaving source in ptx broken in CUDA 6? (Linux)

Hello, I’m trying to use the option --source-in-ptx to generate annotated code with ptx. Using the nvcc that came with CUDA 6, there are no annotations in the generated ptx file:

nvcc --source-in-ptx -ptx -I/usr/local/cuda/include -arch=compute_30 -code=sm_30 -c

However, using the same command with nvcc from CUDA 5.5 produced the expected results.

I’m running Ubuntu 12.04 x64.

Has there been a change to this option in CUDA 6?


Try adding -G and I think you’ll see it works in CUDA 6. I suspect that the compiler optimization/reordering is so aggressive in CUDA 6, that it’s difficult for the compiler to associate lines of source with lines of PTX. If you can find a case where almost the same PTX is emitted between CUDA 5.5 and CUDA 6, but CUDA 6 lacks the annotations, I suggest filing a bug.

Yes, that was it. -G made it work. Thanks.