Relaxed Allocation Limit in Level Zero
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the allocation behavior with the linked levelZeroAlloc.cpp sample, using zeMemAllocDevice and the ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE flag. Compare the reported DEVICE_MEMORY_PROPERTIES totalSize and 0x78000009 result with the multi-buffer crash. Done means the expected behavior and any required API guidance or change are documented and covered by an appropriate test.
Written by the indexing model from the issue text.
Description
When playing around with the ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE flag for buffer allocation I noticed the following:
If I request a buffer to be allocated with a size larger than my system allows (in my case 26GB), I get an error with 0x78000009 (size argument is not supported by the device ). Which is expected.
For context, this is the output of the device memory properties of my system:
stype : DEVICE_MEMORY_PROPERTIES
pNext : 0x0
flags : Device::{ ? }
maxClockRate : 0 <-- Not sure why this value is 0
maxBusWidth : 64
totalSize : 26706980864 <<- ~ 26GB
name : DDR
However, I am able to execute the allocate functions (e.g., zeMemAllocDevice) with for example, 3 buffers of 20 GB each (in total is using 60GB in global memory, which I should not be allowed to do this), So, each alloc call is requesting a buffer size smaller than the maximum global memory available but combined, it is much larger. But instead of getting an error code, I get directly a crash.
You can reproduce this using this sample code: https://github.com/jjfumero/codeBlogArticles/blob/master/april2022/levelZeroAlloc/levelZeroAlloc.cpp
Is this behaviour expected? Or have you considered/ is there anything in the Level Zero API similar to this call?
bool canBeAllocated = zeCanDeviceBufferSizeBeAllocated(context, deviceDesc, alignment, device, &buffer);
So a function that we can query for available space for a given buffer before the actual allocation.
Hardware/ Software details:
- Intel Driver: 21.38.21026
- Total RAM: 32 GB
- OpenCL 3.0
- GPU: Intel HD Graphics from i9-10885H
- Dominant language
- C++
- Stars
- 335
- Forks
- 140
- Avg merge
- 12h 32m
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from oneapi-src/level-zero
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
oneapi-src/level-zero#495 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oneapi-src/level-zero#485 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
oneapi-src/level-zero#447 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
oneapi-src/level-zero#482 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
oneapi-src/level-zero#419 ·
All issues in oneapi-src/level-zero
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·