Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7795593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:06:52+00:00 2026-06-01T23:06:52+00:00

My First Question is How to get registers used information for OpenCL kernel code

  • 0

My First Question is How to get registers used information for OpenCL kernel code on Nvidia GPU, as nvcc complier gives the same using nvcc --ptxas-options=-v flag for CUDA kernel code.

I also got the same information on AMD GPU for OpenCL kernel, from .isa file generated while running the program, after exporting GPU_DUMP_DEVICE_KERNEL=3. Same thing i also tried on Nvidia GPU but it did not get .isa file. My second question is that why Nvidia GPU not generating .isa file ?

After googling I found the way to get registers and shared memory used information for OpenCL kernel on Nvidia GPU is to use cl-nv-verbose string flag into the clBuildProgram() function call. And then read “binaries” information of complied kernel code.
My third question Is it correct way to get registers used information on Nvidia GPU? What are the others way to get same ?

//Building the program…

clBuildProgram(program, 1, &device_id, "-cl-nv-verbose", NULL, NULL);

after building the program i used two constants CL_PROGRAM_BINARY_SIZES and CL_PROGRAM_BINARIES into the clGetProgramInfo() function to get binaries of compiled kernel code.

// Printing Binaries of complied kernel code…

cl_uint program_num_devices, ret;
    size_t t;
    ret = clGetProgramInfo(program, CL_PROGRAM_NUM_DEVICES, sizeof(cl_uint), &program_num_devices, NULL);
    if(program_num_devices == 0) {
            printf("No valid device was found \n");
            return ;
    }
    size_t binary_sizes[program_num_devices];
    char **binaries = (char **) malloc(program_num_devices * sizeof(char* ));
    //first call to get size of ISA binary file...
    ret = clGetProgramInfo(program, CL_PROGRAM_BINARY_SIZES, program_num_devices * sizeof(size_t), &binary_sizes, NULL);
    for(t = 0; t < program_num_devices; t++) {
            binaries[t] = (char *) malloc((binary_sizes[t] + 1) * sizeof(char));
    }
    //second call to get ISA info....
    ret = clGetProgramInfo(program, CL_PROGRAM_BINARIES, program_num_devices * sizeof(size_t), binaries, NULL);
    for(t = 0; t < program_num_devices; t++) {
            binaries[t][binary_sizes[t]] = '\0';
            printf("Binary ISA Info%s : %lu \n", binaries[t], binary_sizes[t]);
    }
    printf("ProgramNumDevices:: %u\n", program_num_devices);
    for(t = 0; t < program_num_devices; t++) {
            free(binaries[t]);
    }

This is printing “binaries” of my complied OpenCl kernel code. But it is not displaying registers and shared memory used information. Why?

Please share some useful informations .

Thanks in Advance !!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:06:53+00:00Added an answer on June 1, 2026 at 11:06 pm

    From a quick search, it looks like that after building the program with -cl-nv-verbose, you get the verbose output with clGetProgramBuildInfo(...,CL_PROGRAM_BUILD_LOG,...).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So this question will get technical – eventually – but first check out Hanselminutes
First shot at throwing a question on these boards so hopefully I can get
This is very basic magento question i guess. I want to first get all
First off, I'd love to post some real code for this question, but I
first question here. I'm developing a program in C# (.NET 3.5) that displays files
First question on here so please be nice :) I know very little about
First question on Stackoverflow (.Net 2.0): So I am trying to return an XML
First question here: it is a very short yet fundamental thing in Java that
First question from me; I'm currently fixing a graphing service that uses XSLFO to
First question is, given a url to an mp4 video, how can I save

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.