oneapi-src / oneapi-src/level-zero
Relaxed Allocation Limit in Level Zero
Nessuno ha ancora preso questa issue.
- Lingua principale
- C++
- Stelle
- 335
- Fork
- 140
- Merge medio
- 12h 32m
- PR unite (30g)
- 5
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riprodurre il comportamento di allocazione con l'esempio levelZeroAlloc.cpp collegato, utilizzando zeMemAllocDevice e il flag ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE. Confrontare il totalSize di DEVICE_MEMORY_PROPERTIES riportato e il risultato 0x78000009 con il crash relativo a più buffer. Il lavoro è completato quando il comportamento previsto e qualsiasi indicazione o modifica API necessaria sono documentati e coperti da un test appropriato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- api
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100