This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Contiguous memory map to Malis

We have two Malis on our board Odroid XU4 .  We wish to create a large image, with one Mali creating half the image and the other Mali creating the other half.  We also want the image to be memory mapped, as it is quite large.  Can we map the image in such a way so that both Malis see at least the part they are working on, and, of course, the memory for the whole image is contiguous for the Cpu?

A rephrasing of the question might be:  May different devices see the same shared memory with the host?

One possible way (but would like to confirm before moving forward), involves using buffers instead of images:

1. Create entire buffer  in the context with CL_MEM_ALLOC_HOST_PTR

2. Create two disjoint sub-buffers. (did not see a way to create sub-images)

3. Map each sub-buffer on its own command queue.

However, this depends on when the memory gets allocated on the host:

Is memory allocated in step 1. or in step 3.?  If in step 1, the memory will be contiguous on the host.  If in step 3, ... ?  I suspect in step 3, since that is when the host ptr becomes available.

Message was edited by: Norman Goldstein

Parents
  • Everything for Mali is memory mapped; there is no dedicated graphics RAM and everything is stored in system memory. The two logical Mali GPUs in your system for OpenCL share the same MMU, so they will both be able to see all GPU related data in your application process.

    There are two points to watch out for.

    Firstly note that the two OpenCL devices are not memory coherent, so if you have two parallel parts trying to modify the same cache line it won't work and you will get data corruption. Provided you partition the work so that each core gets a unique set of cache lines then it should all be OK.

    Secondly note that the two GPU partitions are not the equal in terms of performance (the first is 4 GPU cores, the second is 2 GPU cores), so you will want to factor that in to your problem partitioning.

    HTH,
    Pete

Reply
  • Everything for Mali is memory mapped; there is no dedicated graphics RAM and everything is stored in system memory. The two logical Mali GPUs in your system for OpenCL share the same MMU, so they will both be able to see all GPU related data in your application process.

    There are two points to watch out for.

    Firstly note that the two OpenCL devices are not memory coherent, so if you have two parallel parts trying to modify the same cache line it won't work and you will get data corruption. Provided you partition the work so that each core gets a unique set of cache lines then it should all be OK.

    Secondly note that the two GPU partitions are not the equal in terms of performance (the first is 4 GPU cores, the second is 2 GPU cores), so you will want to factor that in to your problem partitioning.

    HTH,
    Pete

Children