Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ramalama/amdkfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

import glob

# Heap types in memory properties
#
# Imported from /usr/include/linux/kfd_sysfs.h
HEAP_TYPE_SYSTEM = 0
HEAP_TYPE_FB_PUBLIC = 1
HEAP_TYPE_FB_PRIVATE = 2
HEAP_TYPE_GPU_GDS = 3
HEAP_TYPE_GPU_LDS = 4
HEAP_TYPE_GPU_SCRATCH = 5


def parse_props(path):
"""Returns a dict corresponding to a KFD properties file"""
Expand Down
2 changes: 1 addition & 1 deletion ramalama/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def check_rocm_amd():
# See /usr/include/linux/kfd_sysfs.h for possible heap types
#
# Count public and private framebuffer memory as VRAM
if bank_props['heap_type'] in [1, 2]:
if bank_props['heap_type'] in [amdkfd.HEAP_TYPE_FB_PUBLIC, amdkfd.HEAP_TYPE_FB_PRIVATE]:
mem_bytes += int(bank_props['size_in_bytes'])

if mem_bytes > MIN_VRAM_BYTES and mem_bytes > gpu_bytes:
Expand Down
Loading