oneapi-src / oneapi-src/level-zero

device memory allocations required to have mappings/be dereferenceable?

Open
#13 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
335
Forks
140
Avg merge
12h 32m
Merged PRs (30d)
5

Description

Looking at the device memory allocation API,

__ze_api_export ze_result_t __zecall
zeDriverAllocDeviceMem(
ze_driver_handle_t hDriver, ///< [in] handle of the driver instance
const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device mem alloc descriptor
size_t size, ///< [in] size in bytes to allocate
size_t alignment, ///< [in] minimum alignment in bytes for the allocation
ze_device_handle_t hDevice, ///< [in] handle of the device
void** pptr ///< [out] pointer to device allocation
);

It looks like it always passes back a (void *). Is this expected to be a mapped pointer accessible from the CPU?

There are GPUs out there (maybe not yet from Intel) that have limited access to the VRAM from the CPU, by forcing that *pptr is a mapped address for all allocation this will limit the amount of mapped accessible objects you can have.

This why Vulkan has VkDeviceMemory objects, and Map/Unmap APIs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the zeDriverAllocDeviceMem declaration shown in the issue and read the surrounding device-memory allocation API documentation. Determine whether the returned pointer is required to be CPU-mapped and dereferenceable, then define the API or documentation change needed to support devices with limited CPU access, considering the Vulkan Map/Unmap comparison.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.