Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OpenCL program uses only 1 core from 192 cuda cores

OpenCL program uses only 1 core from 192 cuda cores

Scheduled Pinned Locked Moved C / C++ / MFC
asp-netgraphicsquestionannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Javier Luis Lopez
    wrote on last edited by
    #1

    I made following program to use opencl library supplied with Nvidia cuda 7.5. As result I obtained: Num of devices=1 Device name= quadro K600 Device vendor=NVIDIA Corporation Device Version=OPENCL 1.2 CUDA Driver Version= 353.90 DEVICE_MAX_COMPUTE_UNITS = 1 !!!!!!!!!!!!!!!!!!!!!!!!!! DEVICE_MAX_CLOCK_FREQUENCY = 875 MHZ DEVICE_GLOBAL_MEM_SIZE= 1073741824 Only 1 compute unit at 875 Mhz???? I read that K600 has 192

    #include
    #define __CL_ENABLE_EXCEPTIONS
    #pragma warning(disable:4996)
    #include
    #include
    #include
    #include
    #include

    #define LOCAL_SIZE 512
    #define WIDTH_A (4096*2)
    #define HEIGHT_A (4096*2)

    float *matrix_A;
    float *vector_B;
    float *result_vector;
    float *result_vector_host;

    #define MAX_SOURCE_SIZE (0x100000)

    int main()
    {
    cl_platform_id platform_id = NULL;
    cl_device_id device_id = NULL;
    cl_context context = NULL;
    cl_command_queue command_queue = NULL;
    cl_mem Amobj = NULL;
    cl_mem Bmobj = NULL;
    cl_mem Cmobj = NULL;
    cl_program program = NULL;
    cl_kernel kernel = NULL;
    cl_uint ret_num_devices;
    cl_uint ret_num_platforms;
    cl_int ret;

    int i, j;
    
    /\* Get Platform/Device Information\*/
    ret = clGetPlatformIDs(1, &platform\_id, &ret\_num\_platforms);
    ret = clGetDeviceIDs(platform\_id, CL\_DEVICE\_TYPE\_DEFAULT, 1, &device\_id, &ret\_num\_devices);
    
    /\* Create OpenCL Context \*/
    context = clCreateContext(NULL, 1, &device\_id, NULL, NULL, &ret);
    
    
    char buffer\[10240\];
    cl\_uint buf\_uint;
    cl\_ulong buf\_ulong;
    printf("Num of devices=%i", ret\_num\_devices);
    for (i = 0; i < ret\_num\_devices; i++)
    {
    	printf("  -- %d --\\n", i);
    	clGetDeviceInfo(device\_id, CL\_DEVICE\_NAME, sizeof(buffer), buffer, NULL);
    	printf("  DEVICE\_NAME = %s\\n", buffer);
    	clGetDeviceInfo(device\_id, CL\_DEVICE\_VENDOR, sizeof(buffer), buffer, NULL);
    	printf("  DEVICE\_VENDOR = %s\\n", buffer);
    	clGetDeviceInfo(device\_id, CL\_DEVICE\_VERSION, sizeof(buffer), buffer, NULL);
    	printf("  DEVICE\_VERSION = %s\\n", buffer);
    	clGetDeviceInfo(device\_id, CL\_DRIVER\_VERSION, sizeof(buffer), buffer, NULL);
    	printf("  DRIVER\_VERSION = %s\\n", buffer);
    	clGetDeviceInfo(device\_id, CL\_DEVICE\_MAX\_COMPUTE\_UNITS, sizeof(buf\_uint), &buf\_uint, NULL);
    	printf("  DEVICE\_MAX\_COMPUTE\_UNITS = %u\\n", (unsigned int)buf\_uint);
    	clGetDeviceInfo(device\_id, CL\_DEVICE\_MAX\_CLOCK\_FREQUENCY, sizeof(buf\_uint), &buf\_uint, NULL);
    	printf("  DEVICE\_MAX\_CLOCK\_FREQUENCY = %u\\n", (unsigned int)buf\_uint);
    	clGetDeviceIn
    
    D 1 Reply Last reply
    0
    • J Javier Luis Lopez

      I made following program to use opencl library supplied with Nvidia cuda 7.5. As result I obtained: Num of devices=1 Device name= quadro K600 Device vendor=NVIDIA Corporation Device Version=OPENCL 1.2 CUDA Driver Version= 353.90 DEVICE_MAX_COMPUTE_UNITS = 1 !!!!!!!!!!!!!!!!!!!!!!!!!! DEVICE_MAX_CLOCK_FREQUENCY = 875 MHZ DEVICE_GLOBAL_MEM_SIZE= 1073741824 Only 1 compute unit at 875 Mhz???? I read that K600 has 192

      #include
      #define __CL_ENABLE_EXCEPTIONS
      #pragma warning(disable:4996)
      #include
      #include
      #include
      #include
      #include

      #define LOCAL_SIZE 512
      #define WIDTH_A (4096*2)
      #define HEIGHT_A (4096*2)

      float *matrix_A;
      float *vector_B;
      float *result_vector;
      float *result_vector_host;

      #define MAX_SOURCE_SIZE (0x100000)

      int main()
      {
      cl_platform_id platform_id = NULL;
      cl_device_id device_id = NULL;
      cl_context context = NULL;
      cl_command_queue command_queue = NULL;
      cl_mem Amobj = NULL;
      cl_mem Bmobj = NULL;
      cl_mem Cmobj = NULL;
      cl_program program = NULL;
      cl_kernel kernel = NULL;
      cl_uint ret_num_devices;
      cl_uint ret_num_platforms;
      cl_int ret;

      int i, j;
      
      /\* Get Platform/Device Information\*/
      ret = clGetPlatformIDs(1, &platform\_id, &ret\_num\_platforms);
      ret = clGetDeviceIDs(platform\_id, CL\_DEVICE\_TYPE\_DEFAULT, 1, &device\_id, &ret\_num\_devices);
      
      /\* Create OpenCL Context \*/
      context = clCreateContext(NULL, 1, &device\_id, NULL, NULL, &ret);
      
      
      char buffer\[10240\];
      cl\_uint buf\_uint;
      cl\_ulong buf\_ulong;
      printf("Num of devices=%i", ret\_num\_devices);
      for (i = 0; i < ret\_num\_devices; i++)
      {
      	printf("  -- %d --\\n", i);
      	clGetDeviceInfo(device\_id, CL\_DEVICE\_NAME, sizeof(buffer), buffer, NULL);
      	printf("  DEVICE\_NAME = %s\\n", buffer);
      	clGetDeviceInfo(device\_id, CL\_DEVICE\_VENDOR, sizeof(buffer), buffer, NULL);
      	printf("  DEVICE\_VENDOR = %s\\n", buffer);
      	clGetDeviceInfo(device\_id, CL\_DEVICE\_VERSION, sizeof(buffer), buffer, NULL);
      	printf("  DEVICE\_VERSION = %s\\n", buffer);
      	clGetDeviceInfo(device\_id, CL\_DRIVER\_VERSION, sizeof(buffer), buffer, NULL);
      	printf("  DRIVER\_VERSION = %s\\n", buffer);
      	clGetDeviceInfo(device\_id, CL\_DEVICE\_MAX\_COMPUTE\_UNITS, sizeof(buf\_uint), &buf\_uint, NULL);
      	printf("  DEVICE\_MAX\_COMPUTE\_UNITS = %u\\n", (unsigned int)buf\_uint);
      	clGetDeviceInfo(device\_id, CL\_DEVICE\_MAX\_CLOCK\_FREQUENCY, sizeof(buf\_uint), &buf\_uint, NULL);
      	printf("  DEVICE\_MAX\_CLOCK\_FREQUENCY = %u\\n", (unsigned int)buf\_uint);
      	clGetDeviceIn
      
      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      How is this: printf(" DEVICE_MAX_CLOCK_FREQUENCY = %u\n", (unsigned int)buf_uint); printing this: DEVICE_MAX_CLOCK_FREQUENCY = 875 MHZ Perhaps the code you are using and the code you pasted are not the same? Have you tried asking your question here?

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

      J 1 Reply Last reply
      0
      • D David Crow

        How is this: printf(" DEVICE_MAX_CLOCK_FREQUENCY = %u\n", (unsigned int)buf_uint); printing this: DEVICE_MAX_CLOCK_FREQUENCY = 875 MHZ Perhaps the code you are using and the code you pasted are not the same? Have you tried asking your question here?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        J Offline
        J Offline
        Javier Luis Lopez
        wrote on last edited by
        #3

        I edited it after reading to make it more easy to understand. I have seen that the old video card is not very good improving the performance of the CPU.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups