-cl-nv-verbose blank output build log is empty

All,

I am trying to use the OpenCL compiler flag “-cl-nv-verbose” to get the runtime register usage.

However, the only output I get is blank.

What’s going on here?

const char* clflags = "-cl-nv-verbose";

program = clCreateProgramWithSource(context, 1, (const char **) &src_str, &src_sz, &errNum);

    checkErr(errNum, "clCreateProgramWithSource");

errNum = clBuildProgram(program, numDevices, deviceIDs, clflags, NULL, NULL);

    checkErr(errNum, "clBuildProgram"); 

cl_build_status build_status;

    errNum = clGetProgramBuildInfo(program, deviceIDs[0],CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status), &build_status, NULL);

    checkErr(errNum, "clGetProgramBuildInfo");

char *build_log;

    size_t ret_val_size;

errNum = clGetProgramBuildInfo(program, deviceIDs[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size);

    checkErr(errNum, "clGetProgramBuildInfo");

build_log = malloc(ret_val_size+1);

    errNum = clGetProgramBuildInfo(program, deviceIDs[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL);

    checkErr(errNum, "clGetProgramBuildInfo");

// to be carefully, terminate with 

const char* clflags = “-cl-nv-verbose”;

program = clCreateProgramWithSource(context, 1, (const char **) &src_str, &src_sz, &errNum);

checkErr(errNum, "clCreateProgramWithSource");

errNum = clBuildProgram(program, numDevices, deviceIDs, clflags, NULL, NULL);

checkErr(errNum, "clBuildProgram"); 

cl_build_status build_status;

errNum = clGetProgramBuildInfo(program, deviceIDs[0],CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status), &build_status, NULL);

checkErr(errNum, "clGetProgramBuildInfo");

char *build_log;

size_t ret_val_size;

errNum = clGetProgramBuildInfo(program, deviceIDs[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size);

checkErr(errNum, "clGetProgramBuildInfo");

build_log = malloc(ret_val_size+1);

errNum = clGetProgramBuildInfo(program, deviceIDs[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL);

checkErr(errNum, "clGetProgramBuildInfo");

// to be carefully, terminate with \0

// there's no information in the reference whether the string is 0 terminated or not

build_log[ret_val_size] = '\0';

printf("%s\n", build_log);

return 0;

// there's no information in the reference whether the string is 0 terminated or not

    build_log[ret_val_size] = '

const char* clflags = “-cl-nv-verbose”;

program = clCreateProgramWithSource(context, 1, (const char **) &src_str, &src_sz, &errNum);

checkErr(errNum, "clCreateProgramWithSource");

errNum = clBuildProgram(program, numDevices, deviceIDs, clflags, NULL, NULL);

checkErr(errNum, "clBuildProgram"); 

cl_build_status build_status;

errNum = clGetProgramBuildInfo(program, deviceIDs[0],CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status), &build_status, NULL);

checkErr(errNum, "clGetProgramBuildInfo");

char *build_log;

size_t ret_val_size;

errNum = clGetProgramBuildInfo(program, deviceIDs[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size);

checkErr(errNum, "clGetProgramBuildInfo");

build_log = malloc(ret_val_size+1);

errNum = clGetProgramBuildInfo(program, deviceIDs[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL);

checkErr(errNum, "clGetProgramBuildInfo");

// to be carefully, terminate with \0

// there's no information in the reference whether the string is 0 terminated or not

build_log[ret_val_size] = '\0';

printf("%s\n", build_log);

return 0;
';

printf("%s\n", build_log);

    return 0;

Hello,

According to https://devtalk.nvidia.com/default/topic/472539/bug-cl-nv-verbose/,there is a way around.
Check this link, https://github.com/3upperm2n/ptxas_for_opencl_kernel