Skip to content
Open
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ install ( TARGETS ${HSAKMT_TARGET}
#install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT devel )

# Install public headers
install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${HSAKMT_TARGET}
install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/${HSAKMT_TARGET} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${HSAKMT_TARGET}
COMPONENT devel PATTERN "linux" EXCLUDE )

# Option to build header path migration helpers.
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions include/hsakmttypes.h → include/hsakmt/hsakmttypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,21 @@ typedef struct _HsaMemoryAccessFault
HSA_EVENTID_MEMORYFLAGS Flags; // event flags
} HsaMemoryAccessFault;

typedef enum _HSA_EVENTID_HW_EXCEPTION_CAUSE
{
HSA_EVENTID_HW_EXCEPTION_GPU_HANG = 0, // GPU Hang
HSA_EVENTID_HW_EXCEPTION_ECC = 1, // SRAM ECC error
} HSA_EVENTID_HW_EXCEPTION_CAUSE;

// data associated with HSA_EVENTID_HW_EXCEPTION
typedef struct _HsaHwException
{
HSAuint32 NodeId; // Node Id where the memory exception occured
HSAuint32 ResetType;
HSAuint32 MemoryLost;
HSA_EVENTID_HW_EXCEPTION_CAUSE ResetCause;
} HsaHwException;

typedef struct _HsaEventData
{
HSA_EVENTTYPE EventType; //event type
Expand All @@ -1062,6 +1077,8 @@ typedef struct _HsaEventData
// data associated with HSA_EVENTTYPE_MEMORY
HsaMemoryAccessFault MemoryAccessFault;

// data associated with HSA_EVENTTYPE_HW_EXCEPTION
HsaHwException HwException;
} EventData;

// the following data entries are internal to the KFD & thunk itself.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

#include "libhsakmt.h"
#include "linux/kfd_ioctl.h"
#include "hsakmt/linux/kfd_ioctl.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
Expand Down
12 changes: 11 additions & 1 deletion src/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <unistd.h>
#include <sys/mman.h>
#include <stdio.h>
#include "linux/kfd_ioctl.h"
#include "hsakmt/linux/kfd_ioctl.h"
#include "fmm.h"

static HSAuint64 *events_page = NULL;
Expand Down Expand Up @@ -428,6 +428,16 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtWaitOnMultipleEvents_Ext(HsaEvent *Events[],
((event_data[i].memory_exception_data.ErrorType == 1) || (event_data[i].memory_exception_data.ErrorType == 2)) ? 1 : 0;
Events[i]->EventData.EventData.MemoryAccessFault.Flags = HSA_EVENTID_MEMORY_FATAL_PROCESS;
analysis_memory_exception(&event_data[i].memory_exception_data);
} else if (Events[i]->EventData.EventType == HSA_EVENTTYPE_HW_EXCEPTION &&
event_data[i].hw_exception_data.gpu_id) {

result = gpuid_to_nodeid(event_data[i].hw_exception_data.gpu_id, &Events[i]->EventData.EventData.HwException.NodeId);
if (result != HSAKMT_STATUS_SUCCESS)
goto out;

Events[i]->EventData.EventData.HwException.ResetType = event_data[i].hw_exception_data.reset_type;
Events[i]->EventData.EventData.HwException.ResetCause = event_data[i].hw_exception_data.reset_cause;
Events[i]->EventData.EventData.HwException.MemoryLost = event_data[i].hw_exception_data.memory_lost;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/fmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "libhsakmt.h"
#include "fmm.h"
#include "linux/kfd_ioctl.h"
#include "hsakmt/linux/kfd_ioctl.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion src/fmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#ifndef FMM_H_
#define FMM_H_

#include "hsakmttypes.h"
#include "hsakmt/hsakmttypes.h"
#include <stddef.h>

typedef enum {
Expand Down
4 changes: 2 additions & 2 deletions src/libhsakmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#ifndef LIBHSAKMT_H_INCLUDED
#define LIBHSAKMT_H_INCLUDED

#include "linux/kfd_ioctl.h"
#include "hsakmt.h"
#include "hsakmt/linux/kfd_ioctl.h"
#include "hsakmt/hsakmt.h"
#include <pthread.h>
#include <stdint.h>
#include <limits.h>
Expand Down
2 changes: 1 addition & 1 deletion src/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

#include "libhsakmt.h"
#include "linux/kfd_ioctl.h"
#include "hsakmt/linux/kfd_ioctl.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion src/perfctr.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <sys/syscall.h>
#include "libhsakmt.h"
#include "pmc_table.h"
#include "linux/kfd_ioctl.h"
#include "hsakmt/linux/kfd_ioctl.h"
#include <unistd.h>
#include <sys/ioctl.h>
#include <errno.h>
Expand Down
5 changes: 3 additions & 2 deletions src/queues.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "libhsakmt.h"
#include "fmm.h"
#include "linux/kfd_ioctl.h"
#include "hsakmt/linux/kfd_ioctl.h"
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
Expand Down Expand Up @@ -509,7 +509,8 @@ static int handle_concrete_asic(struct queue *q,
q->total_mem_alloc_size = (q->ctx_save_restore_size +
q->debug_memory_size) * node.NumXcc;

svm_api = node.Capability.ui32.SVMAPISupported;
svm_api = node.Capability.ui32.SVMAPISupported &&
(node.EngineId.ui32.Major < 11 || node.DeviceId == 0x7461);

/* Allocate unified memory for context save restore
* area on dGPU.
Expand Down
2 changes: 1 addition & 1 deletion src/spm.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

#include "libhsakmt.h"
#include "linux/kfd_ioctl.h"
#include "hsakmt/linux/kfd_ioctl.h"
#include <stdlib.h>
#include <stdio.h>

Expand Down
2 changes: 1 addition & 1 deletion src/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

#include "libhsakmt.h"
#include "linux/kfd_ioctl.h"
#include "hsakmt/linux/kfd_ioctl.h"

HSAKMT_STATUS HSAKMTAPI hsaKmtGetClockCounters(HSAuint32 NodeId,
HsaClockCounters *Counters)
Expand Down
2 changes: 1 addition & 1 deletion src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "libhsakmt.h"
#include <stdlib.h>
#include <string.h>
#include "linux/kfd_ioctl.h"
#include "hsakmt/linux/kfd_ioctl.h"

HsaVersionInfo kfd_version_info;

Expand Down
2 changes: 2 additions & 0 deletions tests/kfdtest/scripts/kfdtest.exclude
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ BLACKLIST_GFX10_NV2X=\
"$BLACKLIST_GFX10:"\
"KFDPerfCountersTest.*"

# KFDQMTest.MultipleCpQueuesStressDispatch - SWDEV-409990
# KFDMemoryTest.FlatScratchAccess - SWDEV-329877
# KFDGWSTest.*: GFX11 will no longer use global wave sync
BLACKLIST_GFX11=\
"KFDQMTest.CreateAqlCpQueue:"\
"KFDQMTest.MultipleCpQueuesStressDispatch:"\
"KFDCWSRTest.InterruptRestore:"\
"KFDPerfCountersTest.*:"\
"KFDMemoryTest.FlatScratchAccess:"\
Expand Down
2 changes: 1 addition & 1 deletion tests/kfdtest/src/KFDSVMRangeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ TEST_P(KFDSVMRangeTest, SetGetAttributesTest) {
{HSA_SVM_ATTR_PREFERRED_LOC, (HSAuint32)defaultGPUNode},
{HSA_SVM_ATTR_SET_FLAGS,
HSA_SVM_FLAG_HOST_ACCESS | HSA_SVM_FLAG_GPU_EXEC | HSA_SVM_FLAG_COHERENT},
{HSA_SVM_ATTR_GRANULARITY, 0xFF},
{HSA_SVM_ATTR_GRANULARITY, 0x3F},
{HSA_SVM_ATTR_ACCESS, (HSAuint32)defaultGPUNode},
};

Expand Down