FREE_MEMORY_OF_GPU ioctl could fail, e.g., if memory is still mapped
to GPU. Handle this failure by return error in fmm_release/HsaKmtFreeMemory
Change-Id: I5461db39964f733cf97376d50e44906a9b4c0f13
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
If CPACK_PACKAGING_INSTALL_PREFIX is not set, it's safer to assume it's the
same as CMAKE_INSTALL_PREFIX, incase only the latter is set.
Change-Id: I70727ebbc50f21f8d6e3add10d7f9f2d5e747dee
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
This will facilitate the need of halting the execution during debugging.
Change-Id: I058c81bbc9f655bbc477b2b542d6b43aa423324c
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
The tests are useful to triage the fundamental queue submission
functionality by excluding the packet format variable from the equation.
Change-Id: I2c7fcda811f93bdefc1b62396233559416be44e7
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
The class is very useful for triaging complex SDMA issues.
Change-Id: Ib5de729f7fc62f41e894ef98d3967e7e1745d454
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
The new filter can be used by "./run_kfdtest.sh -p core_sws".
Change-Id: I1c43669cfc07c09ccafb9fa2e2851932ac59307d
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
We are still working on those tests for gfx1010, so disable them
temporarily.
Change-Id: I5d51b4b02bc753137014684859cc033f759b2899
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
CMAKE_INSTALL_PREFIX would give incorrect result for packages
build by CPack.
Change-Id: Iaeb4d30eb44080b7924ecf892de011ed6e365f5f
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Without this change, the failure was hard to notice when it happened.
Change-Id: I99c3e8cea0d0cbd3bcfe79069410e6e870e225bf
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
When CONFIG_NUMA is not enabled in the kernel config, only one CPU node
presents on the system and /sys/devices/system/node/nodeX directories
don't exist. Read CPU cache information from /sys/devices/system/cpu in
this situation.
Change-Id: I017ff17dd72678a0551edcc77446664501aa42ca
Signed-off-by: Amber Lin <Amber.Lin@amd.com>
When large bar is not available, we can use
xgmi to do p2p tests.
Change-Id: Ib7b59fb8a4d41f605739a0428973f6b2f1a3450f
Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>
The debug trap accesses the data0/data1 registers, so we do not
want the userspace to write values to it. We remove the calls to
set the data0/data1 register values.
Change-Id: Iaba842a4c445f339f16a39fe1994526ff78a2f3c
Signed-off-by: Philip Cox <Philip.Cox@amd.com>
Need to check the kfd debugger version of the kernel before
calling kfd debugger tests in kfdtest. If they are out of sync,
the tests may fail.
Change-Id: I1df5e89fb1199304e6fbe8973c60b76062514c03
Signed-off-by: Philip Cox <Philip.Cox@amd.com>
To support adding new features to the kfd debugger, and not break
functionality, we need to be able to check the kfd debugger support
version info from the kernel.
Change-Id: Icd88e4edab8430c35eaed588e62d892c1b5c62ec
Signed-off-by: Philip Cox <Philip.Cox@amd.com>
To check the KFD debugger API support, we need to be able to check
the major/minor version of the kfd debugger version, so we need to
expose this function from the kernel.
Change-Id: I8a3dc617607e2efa9e65306d08b8583b8b1a2172
Signed-off-by: Philip Cox <Philip.Cox@amd.com>
The KFD debugger is only supported on gfx9 platforms, so we need to
restrict it from running on gfx10 platforms until it is supported.
Change-Id: I500f0e20fda71021f2cce70a67fc8d9d042209fe
Signed-off-by: Philip Cox <Philip.Cox@amd.com>
The memory need to be mapped for both local and remote GPU access
Change-Id: I4aeaffc0851b6107fc91e9eaa6150764b06f5ca9
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
This is some data fabric/vbios issue that causing system hard hang
while running this test. Will enable it after the HW/vibos fix.
Change-Id: Ic0753c2d92e9e4863c310da9a595b2af302f17f8
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
When fail to get CPU dirs from //sys/devices/system/node/nodeX directory,
the error message should print node_dir, not path.
Change-Id: If76a51918c8dd55fa6605a62f3d29f9efc6fadb3
Signed-off-by: Amber Lin <Amber.Lin@amd.com>
numa_max_node() return the highest node number available on the current
system, number of NUMA nodes should be numa_max_node() + 1.
Change-Id: I20a6c17af071e73e853cb5ea6d0304c8aca52681
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Allocate system memory from node id 0 will fail on NUMA system which has
no memory on node 0. Change to use new flag NoNUMABind to allocate
system memory from NUMA nodes which have free memory.
Change-Id: I8ef9ca28fc2ab5dd31d07a2d3eaf1d5886e798a0
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
on NUMA system, node 0 may have no memory, application pass node id
0 to hsaKmtAllocMemory will fail because mbind to specify the allocation
from node 0 return EINVAL.
Add new flag NoNUMABind for application to pass it to hsaKmtAllocMemory
to skip mbind.
hsaKmtCreateEvent and hsaKmtCreateQueue specify the new flag NoNUMABind
to allocate system memory for event page and CWSR area, don't bind the
system memory to a specific NUMA node.
Change-Id: I854e5a57502c7807c4c5ff2e441d499ae515c309
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Docker seccomp by default blocks mbind system call, so mbind return
failed on docker. thunk should not fail this otherwise application
cannot allocate system memory on docker.
Use pr_warn_once and pr_err_once to avoid duplicate same error messages
Change-Id: I61a7c0e4abaa3dcfe7abf2ea48db90f669f9638a
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
This will emilinate the need of updating the run_kfdtest.sh every time
a new platform is added.
Change-Id: I584d65b462de36a685fa2d29d43962078ba511dc
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Force all the GPUs to a certain type, use the below command:
HSA_FORCE_ASIC_TYPE="10.1.0 1 gfx1010 14"
meaning major.minor.step dgpu asic_name asic_id
This will faciliate the cooperation across the teams for bringing up
ASICs which reuse existing device IDs.
Change-Id: I40fe4c9b46d3ccb3e38ea52250e80e82fb50fb0f
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Those tests are actually did not function up to its expectation because
some underlying functions such as suspend/resume and disable/enable KFD
were not implemented. Those interfaces would never be implemented, so
delete them.
Change-Id: Ib5872ba2f35e307221e43791cda1782c6b6bb4d1
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
A number of tests are no longer broken on gfx802.
Change-Id: If70c77423f8f14de59490ab8ca156b0c4e7b5cf1
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
The memory size alignment workaround for a TLB bug on gfx802 was
breaking userptrs because it would attempt to get_user_pages beyond
the end of a VMA. Refine this workaround based on our understanding
of the HW bug. It only affects L2 cacheline allocation, which is
decided by the last page in the cache line (8 entries = 32KB of
address space). Thus aligning memory allocation so that the last
page falls on the end of a 8 entry TLB cache line allows caching
to work correctly.
Imported images require specific alignments. If their size is not
naturally aligned with 8 cache lines, it may have bad TLB cache
performance.
This patch will only have the desired effect if redundant size
padding in KFD is also removed.
Change-Id: I984cbe7fa61fec04d70fa387aaf9aab370eabeb9
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
hsakmt-dev should not install include/linux/* (currently just kfd_ioctl.h)
as those are linux kernel headers provided by the linux kernel header
packages (`linux-headers-*` on Debian/Ubuntu or `kernel-headers-*` on
Red Hat / Fedora)
Change-Id: Ib6e62ca2f3582c5ad7351225f5827081bf8e05c0
Signed-off-by: Craig Andrews <candrews@integralblue.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
pkgconfig files should be installed to /usr/share/pkgconfig/, not /usr/libhsakmt/
Change-Id: Ifd08f612addb375de1d00282ee9e7c257528bf74
Signed-off-by: Craig Andrews <candrews@integralblue.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
LICENSE.md should be installed to the DOCDIR, not /usr/libhsakmt
Change-Id: I2020547b3174b9d91c1f800d9db2d73f627a6ce3
Signed-off-by: Craig Andrews <candrews@integralblue.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Instead of the installed hsakmt header files, use the ones from the
source tree, since they are in the same git repository. This allows
using kfd_ioctl.h even when we don't install this file with an
upcoming change.
Change-Id: I9a30abd5445806d2141bdb1ccd88d3794a74ed20
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Made changes in the CMakeLists.txt
1) Detects the OS of the system
2) Accordingly setsup the runtime dependencies
Change-Id: Ief9a0217caae77d4be4850167e2a9b8387f639e4
Signed-off-by: Lad, Aditya <aditya.lad@amd.com>
snprintf throws a warning from -Wformat-truncation where the string
could be truncated. We address this by referencing the maximum size that
can be returned from a file according to MAXNAMLEN . This should safely
guard us from truncating the path value.
Change-Id: If1d208990d8775e9494835b0deb890d2616fd15b
Signed-off-by: Kent Russell <kent.russell@amd.com>