Results 1 to 7 of 7

Thread: opencl ! too much leak memory problem

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    10

    opencl ! too much leak memory problem

    one of the most important thing in programming is to debug your application , so we need a debugger to do this , ( i am using intel inspector XE 2011 ) .

    i am writing few programs and i debug them . but my problem is when i use opencl i found that i have more than 100 memory leaks and i surprised because i am just get platforms and device and their information and print every thing , so i try an other example come with AMD APP SDK , HelloCL.exe i tested with intel inspector XE 2011 so her is the report


    Code :
    ID		Problem	Sources	Modules	Object Size	State
    P1		Missing allocation	[Unknown]	tbb.dll		New
    P2		Mismatched allocation/deallocation	[Unknown]	OclCpuBackEnd.dll		New
    P3		Mismatched allocation/deallocation	[Unknown]	OclCpuBackEnd.dll		New
    P4		Mismatched allocation/deallocation	[Unknown]	OclCpuBackEnd.dll		New
    P5		Mismatched allocation/deallocation	[Unknown]	OclCpuBackEnd.dll		New
    P6		Mismatched allocation/deallocation	[Unknown]	OclCpuBackEnd.dll		New
    P7		Mismatched allocation/deallocation	[Unknown]	OclCpuBackEnd.dll		New
    P8		Mismatched allocation/deallocation	[Unknown]	intelocl.dll		New
    P9		Memory leak	[Unknown]	OclCpuBackEnd.dll	16104	New
    P10		Memory leak	[Unknown]	OclCpuBackEnd.dll	50040	New
    P11		Memory leak	[Unknown]	OclCpuBackEnd.dll	89108	New
    P12		Memory leak	[Unknown]	OclCpuBackEnd.dll	2400	New
    P13		Memory leak	[Unknown]	OclCpuBackEnd.dll	3072	New
    P14		Memory leak	[Unknown]	OclCpuBackEnd.dll	256	New
    P15		Memory leak	[Unknown]	OclCpuBackEnd.dll	88	New
    P16		Memory leak	[Unknown]	OclCpuBackEnd.dll	15840	New
    P17		Memory leak	[Unknown]	OclCpuBackEnd.dll	456	New
    P18		Memory leak	[Unknown]	OclCpuBackEnd.dll	3840	New
    P19		Memory leak	[Unknown]	OclCpuBackEnd.dll	26968	New
    P20		Memory leak	[Unknown]	OclCpuBackEnd.dll	1120	New
    P21		Memory leak	[Unknown]	OclCpuBackEnd.dll	14608	New
    P22		Memory leak	[Unknown]	OclCpuBackEnd.dll	3700	New
    P23		Memory leak	[Unknown]	OclCpuBackEnd.dll	56	New
    P24		Memory leak	[Unknown]	OclCpuBackEnd.dll	344	New
    P25		Memory leak	[Unknown]	OclCpuBackEnd.dll	1536	New
    P26		Memory leak	[Unknown]	OclCpuBackEnd.dll	2048	New
    P27		Memory leak	[Unknown]	OclCpuBackEnd.dll	120	New
    P28		Memory leak	[Unknown]	OclCpuBackEnd.dll	648	New
    P29		Memory leak	[Unknown]	OclCpuBackEnd.dll	540	New
    P30		Memory leak	[Unknown]	OclCpuBackEnd.dll	7168	New
    P31		Memory leak	[Unknown]	OclCpuBackEnd.dll	1576	New
    P32		Memory leak	[Unknown]	OclCpuBackEnd.dll	360	New
    P33		Memory leak	[Unknown]	OclCpuBackEnd.dll	216	New
    P34		Memory leak	[Unknown]	OclCpuBackEnd.dll	256	New
    P35		Memory leak	[Unknown]	OclCpuBackEnd.dll	128	New
    P36		Memory leak	[Unknown]	OclCpuBackEnd.dll	108	New
    P37		Memory leak	[Unknown]	OclCpuBackEnd.dll	9216	New
    P38		Memory leak	[Unknown]	OclCpuBackEnd.dll	776	New
    P39		Memory leak	[Unknown]	OclCpuBackEnd.dll	1696	New
    P40		Memory leak	[Unknown]	OclCpuBackEnd.dll	512	New
    P41		Memory leak	[Unknown]	OclCpuBackEnd.dll	428	New
    P42		Memory leak	[Unknown]	OclCpuBackEnd.dll	268	New
    P43		Memory leak	[Unknown]	OclCpuBackEnd.dll	1536	New
    P44		Memory leak	[Unknown]	OclCpuBackEnd.dll	544	New
    P45		Memory leak	[Unknown]	OclCpuBackEnd.dll	116	New
    P46		Memory leak	[Unknown]	OclCpuBackEnd.dll	2048	New
    P47		Memory leak	[Unknown]	OclCpuBackEnd.dll	3072	New
    P48		Memory leak	[Unknown]	OclCpuBackEnd.dll	36732	New
    P49		Memory leak	[Unknown]	OclCpuBackEnd.dll	304	New
    P50		Memory leak	[Unknown]	OclCpuBackEnd.dll	112	New
    P51		Memory leak	[Unknown]	OclCpuBackEnd.dll	208	New
    P52		Memory leak	[Unknown]	OclCpuBackEnd.dll	368	New
    P53		Memory leak	[Unknown]	OclCpuBackEnd.dll	352	New
    P54		Memory leak	[Unknown]	OclCpuBackEnd.dll	1280	New
    P55		Memory leak	[Unknown]	OclCpuBackEnd.dll	2560	New
    P56		Memory leak	[Unknown]	OclCpuBackEnd.dll	524288	New
    P57		Memory leak	[Unknown]	OclCpuBackEnd.dll	7680	New
    P58		Memory leak	[Unknown]	amdocl.dll	486	New
    P59		Memory leak	[Unknown]	intelocl.dll	16	New
    P60		Memory leak	[Unknown]	intelocl.dll	8	New
    P61		Memory leak	[Unknown]	intelocl.dll	48	New
    P62		Memory leak	[Unknown]	intelocl.dll	48	New
    P63		Memory leak	[Unknown]	intelocl.dll	48	New
    P64		Memory leak	[Unknown]	task_executor.dll	4	New
    P65		Memory leak	[Unknown]	OpenCL.dll	8	New
    P66		Memory leak	[Unknown]	OclCpuBackEnd.dll	56940	New
    P67		Memory leak	[Unknown]	OclCpuBackEnd.dll	55368	New
    P68		Memory leak	[Unknown]	OclCpuBackEnd.dll	23688	New
    P69		Memory leak	[Unknown]	OclCpuBackEnd.dll	27048	New
    P70		Memory leak	[Unknown]	OclCpuBackEnd.dll	26124	New
    P71		Memory leak	[Unknown]	OclCpuBackEnd.dll	11024	New
    P72		Memory leak	[Unknown]	OclCpuBackEnd.dll	15120	New
    P73		Memory leak	[Unknown]	OclCpuBackEnd.dll	25984	New
    P74		Memory leak	[Unknown]	OclCpuBackEnd.dll	9240	New
    P75		Memory leak	[Unknown]	OclCpuBackEnd.dll	1760	New
    P76		Memory leak	[Unknown]	OclCpuBackEnd.dll	46368	New
    P77		Memory leak	[Unknown]	OclCpuBackEnd.dll	144	New
    P78		Memory leak	[Unknown]	OclCpuBackEnd.dll	1560	New
    P79		Memory leak	[Unknown]	OclCpuBackEnd.dll	116	New
    P80		Memory leak	[Unknown]	OclCpuBackEnd.dll	2640	New
    P81		Memory leak	[Unknown]	OclCpuBackEnd.dll	4	New
    P82		Memory leak	[Unknown]	OclCpuBackEnd.dll	36	New
    P83		Memory leak	[Unknown]	OclCpuBackEnd.dll	8	New
    P84		Memory leak	[Unknown]	OclCpuBackEnd.dll	2880	New
    P85		Memory leak	[Unknown]	OclCpuBackEnd.dll	304	New
    P86		Memory leak	[Unknown]	OclCpuBackEnd.dll	348	New
    P87		Memory leak	[Unknown]	OclCpuBackEnd.dll	10752	New
    P88		Memory leak	[Unknown]	OclCpuBackEnd.dll	3584	New
    P89		Memory leak	[Unknown]	OclCpuBackEnd.dll	128	New
    P90		Memory leak	[Unknown]	OclCpuBackEnd.dll	768	New
    P91		Memory leak	[Unknown]	OclCpuBackEnd.dll	512	New
    P92		Memory leak	[Unknown]	OclCpuBackEnd.dll	288	New
    P93		Memory leak	[Unknown]	OclCpuBackEnd.dll	8	New
    P94		Memory leak	[Unknown]	OclCpuBackEnd.dll	1024	New
    P95		Memory leak	[Unknown]	OclCpuBackEnd.dll	4096	New
    P96		Memory leak	[Unknown]	OclCpuBackEnd.dll	1024	New

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

    Re: opencl ! too much leak memory problem

    You may want to report this issue to your hardware vendor's customer support forum. There's nothing we can do here to help.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3

    Re: opencl ! too much leak memory problem

    Please post your leaking program here. I'd like to run it on my implementation. Thanks.

  4. #4
    Junior Member
    Join Date
    Aug 2011
    Posts
    10

    Re: opencl ! too much leak memory problem

    OK MySource code is :


    Code :
    #include <cstdio>
    #include <cstdlib>
    #include <iostream>
    #include <SDKFile.hpp>
    #include <SDKCommon.hpp>
    #include <SDKApplication.hpp>
     
    #define __NO_STD_STRING
     
    #include <CL/cl.hpp>
    int
    main()
    {
        cl_int err;
     
    	 cl_platform_id pPlatforms[10] = { 0 };
    	cl_uint pl = 0 ; 
     
    	err = ::clGetPlatformIDs ( 0 , NULL ,&pl ) ; 
     
    	cl_platform_id *platform = (cl_platform_id *)alloca(sizeof(platform)); 
     
    	err = ::clGetPlatformIDs ( pl , pPlatforms ,&pl ) ; 
     
     
    	char name [100] ; 
    	::clGetPlatformInfo ( pPlatforms[1] , CL_PLATFORM_NAME , sizeof(name) ,name , NULL); 
     
     
     
    	std::cout << name ;  
     
     
        // Platform info
        std::vector<cl::Platform> platforms;
        std::cout<<"HelloCL!\nGetting Platform Information\n";
        err = cl::Platform::get(&platforms);
        if(err != CL_SUCCESS)
        {
            std::cerr << "Platform::get() failed (" << err << ")" << std::endl;
            return SDK_FAILURE;
        }
     
        std::vector<cl::Platform>::iterator i;
        if(platforms.size() > 0)
        {
            for(i = platforms.begin(); i != platforms.end(); ++i)
            {
                if(!strcmp((*i).getInfo<CL_PLATFORM_VENDOR>(&err).c_str(), "Advanced Micro Devices, Inc."))
                {
                    break;
                }
            }
        }
        if(err != CL_SUCCESS)
        {
            std::cerr << "Platform::getInfo() failed (" << err << ")" << std::endl;
            return SDK_FAILURE;
        }
     
        /* 
         * If we could find our platform, use it. Otherwise pass a NULL and get whatever the
         * implementation thinks we should be using.
         */
     
        cl_context_properties cps[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties)(*i)(), 0 };
     
        std::cout<<"Creating a context AMD platform\n";
        cl::Context context(CL_DEVICE_TYPE_CPU, cps, NULL, NULL, &err);
        if (err != CL_SUCCESS) {
            std::cerr << "Context::Context() failed (" << err << ")\n";
            return SDK_FAILURE;
        }
     
        std::cout<<"Getting device info\n";
        std::vector<cl::Device> devices = context.getInfo<CL_CONTEXT_DEVICES>();
        if (err != CL_SUCCESS) {
            std::cerr << "Context::getInfo() failed (" << err << ")\n";
            return SDK_FAILURE;
        }
        if (devices.size() == 0) {
            std::cerr << "No device available\n";
            return SDK_FAILURE;
        }
     
        std::cout<<"Loading and compiling CL source\n";
    	streamsdk::SDKFile file;
        if (!file.open("HelloCL_Kernels.cl")) {
             std::cerr << "We couldn't load CL source code\n";
             return SDK_FAILURE;
        }
    	cl::Program::Sources sources(1, std::make_pair(file.source().data(), file.source().size()));
     
    	cl::Program program = cl::Program(context, sources, &err);
    	if (err != CL_SUCCESS) {
            std::cerr << "Program::Program() failed (" << err << ")\n";
            return SDK_FAILURE;
        }
     
        err = program.build(devices);
        if (err != CL_SUCCESS) {
     
    		if(err == CL_BUILD_PROGRAM_FAILURE)
            {
                cl::string str = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(devices[0]);
     
                std::cout << " \n\t\t\tBUILD LOG\n";
                std::cout << " ************************************************\n";
    			std::cout << str.c_str() << std::endl;
                std::cout << " ************************************************\n";
            }
     
            std::cerr << "Program::build() failed (" << err << ")\n";
            return SDK_FAILURE;
        }
     
        cl::Kernel kernel(program, "hello", &err);
        if (err != CL_SUCCESS) {
            std::cerr << "Kernel::Kernel() failed (" << err << ")\n";
            return SDK_FAILURE;
        }
        if (err != CL_SUCCESS) {
            std::cerr << "Kernel::setArg() failed (" << err << ")\n";
            return SDK_FAILURE;
        }
     
        cl::CommandQueue queue(context, devices[0], 0, &err);
        if (err != CL_SUCCESS) {
            std::cerr << "CommandQueue::CommandQueue() failed (" << err << ")\n";
        }
     
        std::cout<<"Running CL program\n";
        err = queue.enqueueNDRangeKernel(
            kernel, cl::NullRange, cl::NDRange(4, 4), cl::NDRange(2, 2)
        );
     
        if (err != CL_SUCCESS) {
            std::cerr << "CommandQueue::enqueueNDRangeKernel()" \
                " failed (" << err << ")\n";
           return SDK_FAILURE;
        }
     
        err = queue.finish();
        if (err != CL_SUCCESS) {
            std::cerr << "Event::wait() failed (" << err << ")\n";
        }
     
        std::cout<<"Done\nPassed!\n" << std::endl;
        return SDK_SUCCESS;
    }

  5. #5
    Junior Member
    Join Date
    Aug 2011
    Posts
    10

    Re: opencl ! too much leak memory problem

    her is my platform and device information

    Code :
    CL_DEVICE_VENDOR	"GenuineIntel"	
    CL_DEVICE_VERSION	"2.0"	
    CL_DEVICE_NAME   	"Intel(R) Core(TM)2 Duo CPU     P8700  @ 2.53GHz"	
    CL_DEVICE_PROFILE	"FULL_PROFILE"	
     
    CL_PLATFORMS_PRFILE   "FULL_PROFILE"
    CL_PLATFORM_NAME       "OpenCL 1.1 AMD-APP-SDK-v2.5 (684.213)"
    CL_PLATFORM_VENDOR  "AMD Accelerated Parallel Processing"

  6. #6

    Re: opencl ! too much leak memory problem

    Thanks, I'm not seeing the leaks with my implementation. P.S. I had to make a number of changes, because you used a number of AMD specifics. Oh, and you also didn't provide the kernel source so I provided an empty kernel.

  7. #7
    Junior Member
    Join Date
    Aug 2011
    Posts
    10

    Re: opencl ! too much leak memory problem

    thank you any way ! i really don't know the problem but i think its sdk problem ( or may be driver problem )

Similar Threads

  1. Memory leak problem in nVidia driver
    By Aki in forum OpenCL
    Replies: 4
    Last Post: 01-18-2013, 08:18 PM
  2. conformes-1.1r1-2005-07-08 memory leak problem.
    By ultragamza in forum Cross API and window system integration
    Replies: 2
    Last Post: 10-17-2007, 05:07 PM

Posting Permissions

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