Results 1 to 2 of 2

Thread: Problem creating cl_context

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    1

    Problem creating cl_context

    Hi everybody. I'm experimenting with OpenCL and I faced the following problem: inside my code I have a function that is performed on the GPU using OpenCL. Every time the function is called I perform the whole OpenCL environment setup with the context and command queue creation, the program build and so on. Right now I don't care about performance, I know it is very slow. The problem is that after 15 calls to the function I cannot create a new context. The error number is -6, CL_OUT_OF_HOST_MEMORY but I don't see any problem with the local host memory, I'm not working with big data sets.
    At the end of the function I release the context and in theory I would not face any problem. The GPU I'm using is the Nvidia GTX480, and curiously the number of Streaming Multiprocessor is 15 as the number of function I context I can create before the memory error. Can anybody explain me this behavior? Thanks

    Tommy

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Problem creating cl_context

    My best bet would be that you are releasing the context but you are forgetting to release some other resource, like the command queue, or some memory object, or a kernel.

    That CL_OUT_OF_HOST_MEMORY error is almost certainly trying to say "out of some resource in the host, not necessarily memory". It could be out of mutexes for all we know.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. Replies: 5
    Last Post: 05-24-2012, 12:05 AM
  2. Why is 'cl_mem' associated to 'cl_context'?
    By tanakamura in forum OpenCL
    Replies: 2
    Last Post: 09-16-2009, 03:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •