The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

In order to demonstrate this error we have made a simple program with a loop that maps and unmaps a mmaped buffer. While running the program please run dmesg and examine /proc/mem_info. We are using the AMD implementation of OpenCL: Driver linux_x64 13.4.

Right now there is no OpenCL kernel in the example, to rule out that there is a problem with it. I believe that if there were a kernel launch before clEnqueueUnmapMemObject you would need the enqueue writebuffer to process valid data on the gpu....

Anyway: Even If comment the clEnqueueWriteBuffer I still get the "Could not lock memory into GART space" error and the Slab keeps rising....

Not sure exactly why you're doing the mmap yourself. Pinning the memory won't necessarily gain the performance you require. To get it working, just let the runtime allocate the memory for you - AMD should be pinning it if you do CL_MEM_ALLOC_HOST_PTR (they'll create the space). The point, is that to gain advantages from pinned memory it needs to be pinned && DMA Host Accessible.

Also, you don't need the clEnqueueWriteBuffer as clint said. You just map -> edit -> Unmap.

In my real application I am using a framegrabber. That framegrabber places the frames on a memory mapped area. I dont want to copy those frames to other pinned memory, I want to use it straight from the framegrabber.When I try to do that I see the gart error on the syslog and the driver leaks memory.

This error happens with every memory mapped area, not only with that particular framegrabber. We made that program so everyone could experience with the error, it is cheaper than buying a framegrabber .

The program that I propose shows the gart error and you can monitor that the Slab section keeps rising on an AMD implementation.

In nvidia the test application seems to work fine. No error message on syslog and the Slab section does not increase. Unfortunately I have to use AMD hardware for the real application.

The driver seems to work fine on any memory allocated with malloc, so I believe that the hardware is capable of accessing the whole RAM, it has some troubles accesing memory that has been mmaped, so I guess there is something wrong in AMDs implementation.

I have already created a post there, (thread 166692 on devgurus, I cannot post the url) Seems that they are working on it, althought I didnt give any feedback in 10 days :S. It is a pity, because this bug is really blocking our project.