Getting cubin file from cg


CUDA 2.0 Beta nvcc document talks about cubin file generation from cg code.

I tried the same with command line option, -usecg as mentioned in the document.

nvcc gives an error “Unknown option ‘usecg’”.

Document mentions about a tool “cudacg”. But, I am not getting this tool with CUDA toolkit 2.0.

This feature is very important for me, as I am not very much familiar with CUDA language, but I am comfortable with cg.

Can anybody explain if I am making any mistake?

  • Gaurav

A search for cudacg in the forums returns

In short, CG stands for code generation and not the shader language.

Is there a way I can get cubin file from a shading languages (HLSL/GLSL/cg)?

Getting IL assembly for CAL (AMD’s GPGPU language) is possible with HLSL.

No, CUDA programs execute in a separate “compute” mode on the GPU, which is very different from pixel shaders.

CUDA programs can’t use shader features like vertex or pixel attributes, interpolation, derivatives or texture LOD. On the other hand, CUDA adds global load/stores and shared memory, which are very powerful features.

It’s usually pretty easy to port HLSL/Cg code to CUDA.