rusticl, radeonsi: Buffer is not released even when clReleaseMemObject is called
System information
- GPU:
- AMD Radeon RX 6600 8176MiB
- AMD Radeon Graphics (Cezanne APU) 512MiB
- Kernel version: v6.7-rc1
- Mesa version: Mesa 24.0.0-devel (git-827bbe48)
- ROCm version: v5.7.1
Describe the issue
When executing an OpenCL program on rusticl/radeonsi, the buffer is not released until the end of the process.
This causes problems like drm/amd#2912 (closed) .
Test program (fork of cl-mem): https://github.com/Umio-Yasuno/cl-mem/tree/debug-rusticl
MEMSIZE
is set to 256MiB.
Rusticl/RadeonSI
Before release:
0000:03:00.0 (AMD Radeon RX 6600), VRAM 1236/ 8176 MiB, GTT 61/ 7684 MiB
cl-mem ( 193905), VRAM 264 MiB ( 3%), GTT 4 MiB ( 0%)
Requested: VRAM 264 MiB, GTT 4 MiB
Evicted: VRAM 0 MiB
After release:
0000:03:00.0 (AMD Radeon RX 6600), VRAM 1243/ 8176 MiB, GTT 59/ 7684 MiB
cl-mem ( 193905), VRAM 264 MiB ( 3%), GTT 4 MiB ( 0%)
Requested: VRAM 264 MiB, GTT 4 MiB
Evicted: VRAM 0 MiB
Rusticl/Zink
Before release:
0000:03:00.0 (AMD Radeon RX 6600), VRAM 1376/ 8176 MiB, GTT 61/ 7684 MiB
cl-mem ( 196522), VRAM 391 MiB ( 4%), GTT 4 MiB ( 0%)
Requested: VRAM 391 MiB, GTT 4 MiB
Evicted: VRAM 0 MiB
After release:
0000:03:00.0 (AMD Radeon RX 6600), VRAM 1065/ 8176 MiB, GTT 60/ 7684 MiB
cl-mem ( 196522), VRAM 71 MiB ( 0%), GTT 3 MiB ( 0%)
Requested: VRAM 71 MiB, GTT 3 MiB
Evicted: VRAM 0 MiB
ROCm
Before release:
0000:03:00.0 (AMD Radeon RX 6600), VRAM 1385/ 8176 MiB, GTT 59/ 7684 MiB
cl-mem ( 201260), VRAM 398 MiB ( 4%), GTT 0 MiB ( 0%)
Requested: VRAM 398 MiB, GTT 0 MiB
Evicted: VRAM 0 MiB
After release:
0000:03:00.0 (AMD Radeon RX 6600), VRAM 1121/ 8176 MiB, GTT 59/ 7684 MiB
cl-mem ( 201260), VRAM 142 MiB ( 1%), GTT 0 MiB ( 0%)
Requested: VRAM 142 MiB, GTT 0 MiB
Evicted: VRAM 0 MiB