Relaxed Allocation Limit in Level Zero

未关闭
#89 9 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp
领域
api

调研方向

使用链接的 levelZeroAlloc.cpp 示例,通过 zeMemAllocDevice 和 ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE 标志复现分配行为。将报告的 DEVICE_MEMORY_PROPERTIES totalSize 和 0x78000009 结果与多缓冲区崩溃进行比较。预期行为以及任何所需的 API 指导或更改都已记录,并由适当的测试覆盖后,即视为完成。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
C++
星标
335
派生
140
平均合并
12 小时 32 分钟
30 天内合并 PR
5

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

oneapi-src/level-zero 的其他 Issue

查看 oneapi-src/level-zero 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。