Relaxed Allocation Limit in Level Zero

Đang mở
#89 9 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
api

Hướng nghiên cứu

Tái hiện hành vi cấp phát bằng mẫu levelZeroAlloc.cpp được liên kết, sử dụng zeMemAllocDevice và cờ ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE. So sánh totalSize của DEVICE_MEMORY_PROPERTIES được báo cáo và kết quả 0x78000009 với sự cố crash khi dùng nhiều buffer. Được xem là hoàn tất khi hành vi dự kiến và mọi hướng dẫn hoặc thay đổi API cần thiết đã được ghi lại và được kiểm thử bằng một test phù hợp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
C++
Star
335
Fork
140
Merge trung bình
12 giờ 32 phút
Pull request đã merge (30 ngày)
5

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oneapi-src/level-zero

Tất cả issue của oneapi-src/level-zero

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.