user236012
user236012

Reputation: 265

CUDA: get required compute capabilities from binary

Is there a way to get the required compute capabilites from a binary file which uses CUDA? I know the application works with a specific graphics card (which has compute capabilities 2.1).

Upvotes: 1

Views: 274

Answers (1)

jepio
jepio

Reputation: 2281

Running cuobjdump should help you out here. It will tell you what ptx (code for jit compiling at runtime) is available in a compiled file and what sass (real code that gets executed on a specific device) has been precompiled as well. Below an example output for device code compiled with -arch=sm_20:

$ cuobjdump quick

Fatbin elf code:
================
arch = sm_20
code version = [1,7]
producer = <unknown>
host = linux
compile_size = 64bit
identifier = quick.cu

Fatbin elf code:
================
arch = sm_20
code version = [1,7]
producer = cuda
host = linux
compile_size = 64bit
identifier = quick.cu

Fatbin ptx code:
================
arch = sm_20
code version = [4,1]
producer = cuda
host = linux
compile_size = 64bit
compressed
identifier = quick.cu
ptxasOptions =  --generate-line-info

Upvotes: 3

Related Questions