psw
April 13, 2009, 10:27am
1
Hello,
after compiling .cu file to .obj, I noticed that .obj file contains .cubin code and ptx source code, like
[codebox]bincode {
0xd0800205 0x00400780 0x10004409 0x0023c780
0xa000020d 0x04000780 0x10004205 0x0023c780
}[/codebox]
[codebox]_10 .version 1.3
.target sm_10, map_f64_to_f32
// compiled with D:\Visual\CUDA\bin/../open64/lib//be.exe
// nvopencc built on 2008-12-14
.reg .u32 %ra<17>;
.reg .u64 %rda<17>;
.reg .f32 %fa<17>;
.reg .f64 %fda<17>;
[/codebox]
I understand that cubin binary code is needed to run on device, but why the ptx code is here?
How to strip object file from it?
Thanks/
psw
April 13, 2009, 5:25pm
2
In addition of a previous post, I noticed that this is CUDA 2.1 issue.
You may look into two files from distributed.net :
http://http.distributed.net/pub/dcti/prere …-x86-cuda20.zip
This is CUDA 2.0 file, no cubin, nor ptx code into .exe. Ths size of exe is 180K.
http://http.distributed.net/pub/dcti/prere …-x86-cuda21.zip
This is CUDA 2.1, the half of the .exe files contains cubin and ptx code. The size is 720K! External Image
I doubt this is CUDA 2.1 feature, most likely is a bug.
Is this with debug mode on?
I seem to recall that CUDA 2.1 changed the default compilation mode to include both GPU assembly and PTX. There are command line options to change this.
nvcc -c -arch compute_xx -code=sm_xx file.cu
where xx=10,11,12,13
will generate no ptx code in the object file
psw
April 13, 2009, 6:37pm
6
Thanks.
Option “-int” controls the embedded code behavior.