Граф коммитов

919 Коммитов

Автор SHA1 Сообщение Дата
Philip Yang 35f00d04ff Revert "libhsakmt: fix multiple threads register userptr race"
This reverts commit f94be2078c.

Change-Id: I954326d9a291280de7c9b7ef49a8cce0cd9dd9ad
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: a809a5bf32]
2021-09-14 12:36:36 -04:00
Philip Yang 84c5489f39 Revert "libhsakmt: Fix deadlock in map_mmio"
This reverts commit 559bb50c6a.

Change-Id: Ibd32ac36bcb9ee418957d25b240ef9dd9172fbd3
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 91b0fce535]
2021-09-14 12:36:36 -04:00
Philip Yang 7f7a7dfd3d Revert "libhsakmt: Fix deadlocks in __fmm_release"
This reverts commit 14d821391e.

Change-Id: Idf636655ac01f569d8e92e9c0e100e5db7d1cb61
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 445fcd803b]
2021-09-14 12:36:36 -04:00
Philip Yang 6e0aa72a89 kfdtest: add KFDSVMRangeTest ReadOnlyRangeTest
Map readonly range to GPU, test GPU can read range but write to
range trigger GPU vm fault.

Change-Id: Id2ce106055a353f21f4c34fa7f562d546523bc49
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: f9648c5014]
2021-09-14 12:36:35 -04:00
Philip Yang 2d80a00201 kfdtest: add KFDSVMRangeTest MigrateFileBackedRangeTest
To test if SVM support address mmap on file backed memory.

Change-Id: I227cc0b44d167c4fa2e63257e13a481aefa4f750
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: d91f92669b]
2021-09-14 11:59:23 -04:00
Kent Russell fa6f6e94b4 Revert "Revert "Get Marketing name from libdrm-amdgpu""
This reverts commit 8f735fb9d5.

Reason for revert: aqlprofile has merged

Change-Id: Iee0fbe8ac1e475123273b328949f68f10490d3ca


[ROCm/ROCR-Runtime commit: 268bb1ae84]
2021-09-01 07:44:23 -04:00
changzhu 13c2ad6508 libhsakmt: fix KFDOpenCloseKFDTest.OpenAlreadyOpenedKFD Segmentation fault on gfx902
g_props is intialized in topology_take_snapshot which needs to call
hsaKmtAcquireSystemProperties. In hsaKmtOpenKFD, it doesn't call hsaKmtAcquireSystemProperties.
So it needs to change parameter of topology_is_svm_needed from node_id
to EngineId to avoid Segmentation fault on gfx902.

Signed-off-by: changzhu <Changfeng.Zhu@amd.com>
Change-Id: Iba8d20a9142510c70927454d26bdcaf579ad5574


[ROCm/ROCR-Runtime commit: 978028d3f6]
2021-08-31 22:57:24 -04:00
Kent Russell 8f735fb9d5 Revert "Get Marketing name from libdrm-amdgpu"
This reverts commit d919321fd4.

Reason for revert: aqlprofiler hasn't promoted yet

Change-Id: I9e6a4169f014a6181f43ee8ef4810be2667d98bd


[ROCm/ROCR-Runtime commit: 89c9d6a3b9]
2021-08-31 09:11:51 -04:00
Chengming Gui 5adfb1fe5e libhsakmt: Add new DIDs for gfx1030/gfx1031/gfx1032
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: Iddb27ce2bedda9a57944eca1e2bb93001e61f733


[ROCm/ROCR-Runtime commit: bcd49af8bb]
2021-08-30 23:17:45 -04:00
Jinzhou Su 79438fea3b libhsakmt: Add another gfx90c DID
Add pci device ID.

Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Change-Id: Idcf8e99583fc9991a0d71d1e0d7e741a132ed730


[ROCm/ROCR-Runtime commit: 294086096a]
2021-08-30 22:49:02 -04:00
Kent Russell 9a063d7e6e CMakeLists: Make sure package provides hsakmt-roct for RPM
RPMs were missed initially

Change-Id: Id9d3fdcb41a25db90c9de71e2035de61928e9a32


[ROCm/ROCR-Runtime commit: af31e9364a]
2021-08-27 07:47:20 -04:00
Mike Li d919321fd4 Get Marketing name from libdrm-amdgpu
Use the database provided by libdrm-amdgpu,as this is maintained by AMD

Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: I319a46d833cb23173a77fdff1deae69ea58588b8


[ROCm/ROCR-Runtime commit: cb1c84d99b]
2021-08-26 16:43:31 -04:00
Kent Russell eb7a1eea27 CMakeLists: Combine binary and devel packages
Consolidate all thunk components into a single development package
Also declare build dependencies via find_package/library and report the
location of said dependencies during build time

Change-Id: I8524ad1a2d9a664accd93471abacc4bac82b9a7c
Signed-off-by: Kent Russell <kent.russell@amd.com>


[ROCm/ROCR-Runtime commit: 79d00a35f9]
2021-08-26 14:38:10 -04:00
Tony Tye e173a57a05 Update HSA_RUNTIME_ENABLE_MIN_MAJOR to 10
The major version of the debug ioctl functions has been updated to 10.

Change-Id: Iddc8656ad07c92aa30c6a7a99add28ab3a3f5a80


[ROCm/ROCR-Runtime commit: d0ae4b1f3f]
2021-08-21 21:47:09 +00:00
Mukul Joshi b0c12655b0 kfdtest: Update KFDCWSRTest for software scheduler and MES
Update KFDCWSRTest.BasicTest to run CWSR test with legacy HWS,
MES, and software scheduler.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Change-Id: I09af904507109c2bbbace6ff616a57fa2b1b8aa9


[ROCm/ROCR-Runtime commit: acd5eda54f]
2021-08-20 16:37:50 -04:00
Kent Russell 7cc3211f13 kfdtest.exclude: Remove KFDEvictTest.BurstyTest on all ASICs
This is reported as failing on pretty much every ASIC, so move it to the
temporary exclude list for all ASICs until the test can be fixed.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I2973feb5705c178db32009e4603376d1f5e94a2f


[ROCm/ROCR-Runtime commit: 52f5b666d6]
2021-08-17 08:27:13 -04:00
Graham Sider e12ae580bb libhsakmt: Hotfix for incorrect hex gfx versions
Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Ic67b7a3e1649288c8fdef85fef875327ffc50948


[ROCm/ROCR-Runtime commit: 9745c58d40]
2021-08-11 16:59:44 -04:00
Chengming Gui 0bb3052e1a libhsakmt: Add DIDs for Beige_Goby
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: Iff82aa0ab70df49ffc6d8004e40b5cccd637da44


[ROCm/ROCR-Runtime commit: cff8e4992c]
2021-08-09 11:32:11 +08:00
Graham Sider 67e7a73dc4 libhsakmt: Retrieve gfx version from sysfs
If lookup is successful, device info from find_hsa_gfxip_device() is
used to populate props->EngineId.ui32 gfx version fields and node CAL
name (props->AMDName).

If unsuccessful, uses gfx_target_version sysfs field if present
(otherwise results in error), and sets the node CAL name to
"GFX<GFX_VERSION>" (e.g. 9.0.8 -> GFX090008).

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Id39c521b769aebbe40c934f19e03150a66884cce


[ROCm/ROCR-Runtime commit: bb8deeae11]
2021-08-05 15:19:57 -04:00
Graham Sider dd6fc61c2d libhsakmt: Remove redundant checks, small bug fixes
Some g_system and Node ID checks already performed by validate_nodeid().
Fixes bug where hsaKmtGetNodeProperties() would return on
validate_nodeid() error without releasing lock. Switches some
conditionals to return INVALID_NODE_UNIT instead of INVALID_PARAMETER if
NodeId >= NumNodes. Removes some g_system assertions to return error
code rather than trigger a hard fault.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Id1604b20c2cef8808b98cdad61bd47aa7ea3d229


[ROCm/ROCR-Runtime commit: 29369753f5]
2021-08-05 15:00:58 -04:00
Graham Sider 2dff9494db libhsakmt: Remove asic_family vars/helpers
Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I1bd054d8f9ffc56e2c48a5df4899966918f26e1b


[ROCm/ROCR-Runtime commit: 1ad1a2a817]
2021-08-05 15:00:58 -04:00
Graham Sider 875e9b9994 libhsakmt: Replace asic_family with gfx version
All conditional logic previously dependent on asic_family now dependent
on gfx version. As such, HSA_FORCE_ASIC_TYPE is now deprecated and
HSA_OVERRIDE_GFX_VERSION should be used instead.

device_info structs containing asic_family, eop_buffer_size, and
doorbell_size removed (alongside dev_lookup_table[]). eop_buffer_size
and doorbell_size now determined via macro, with eop_buffer_size and
full gfx version field being added to queue struct.

Certain funcs previously dependent on DID or GPU ID now dependent on
Node ID (due to use of get_gfxv_by_node_id()).

Fixes sleeper bug where ctl_stack_size and debug_memory_size were being
incorrectly programmed on gfx90a.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Iaabdc5c73920ad83b4b379cd6086992357b8ff10


[ROCm/ROCR-Runtime commit: 8f883d0830]
2021-08-05 15:00:26 -04:00
Graham Sider 74cf1f0b88 libhsakmt: Use gfx version conditions in pmc_table.c
get_block_properties() switch statement now based on major GFX version
instead of asic_family. Addition for NPI bringup only needed on major
GFX revisions unless differing perf_counter_block assignment necessary.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Ia02676d2a3a8f968b67feeafbab534ef4c01c0dd


[ROCm/ROCR-Runtime commit: 0b46d418c3]
2021-08-05 14:54:58 -04:00
Graham Sider 1aa103c629 libhsakmt: Use node_id in topology_is_svm_needed()
Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I7773ccb959e60e43b816477c5659f1fe835ecbbd


[ROCm/ROCR-Runtime commit: bc4aca039c]
2021-08-05 14:52:09 -04:00
Graham Sider eb66b1108c libhsakmt: Deprecate is_gfx700()
Condition generalized by
(get_gfxv_by_node_id(NodeId) == GFX_VERSION_KAVERI)

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: Iff4f77043e3ce8e48a9e84fbf257ebf59abf5bbb


[ROCm/ROCR-Runtime commit: 2f261a8dab]
2021-08-05 14:50:07 -04:00
Graham Sider 54eaccf072 libhsakmt: Add gfx version defines, helpers
Add defines for converting between full gfx version (in decimal) to
major/minor/stepping values, and major/minor/stepping values to full gfx
version (in hex). The first is to be used when grabbing the gfx version
from sysfs, the second when returning the gfx version in
get_gfxv_by_node_id() for comparisions in Thunk.

Add enum for defines of full gfx versions for various cards. These are
to be used in conditionals to replace CHIP_*/asic_family comparisons. On
NPI bringup, addition to this enum will not be required for
functionality unless explicitly needed for a conditional. Most ASICs in
this enum simply for completeness.

Add get_gfxv_by_node_id(): returns full gfx version in hex.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Change-Id: I9d1dba7fdd4a587a000eea2f4141a1d301bf4776


[ROCm/ROCR-Runtime commit: 8880610265]
2021-08-05 14:48:07 -04:00
Kent Russell f1404ea392 CMakeLists: Re-enable pkgconfig, require libdrm
This was an implicit requirement, but the change to needing libdrm/drm.h
means we should be explicitly looking for this package during the build

Change-Id: I75064bf6f5477cb1ca99318681afca76c0060f72


[ROCm/ROCR-Runtime commit: 6778da4460]
2021-07-30 18:20:12 -04:00
Aaron Liu c451710944 libhsakmt: expand control stack size limit for all gfx103x
Expand check control stack size for Beige Goby, Van Gogh and Yellow Carp.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: I6c8345bbb751eb9179fc740fe1674504b4295a5f


[ROCm/ROCR-Runtime commit: fc216a3668]
2021-07-30 10:24:25 -04:00
Aaron Liu 1b7bb8646c libhsakmt: reorder the list of GPUs in enum asic_family_type
Put CHIP_gfx90a next to CHIP_gfx908 to keep all the GFXv9
chips together.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: I32b4b7f7746ae4bdaff7e178f13307c1bcfa93e1


[ROCm/ROCR-Runtime commit: 80e4cb6261]
2021-07-30 10:23:56 -04:00
Philip Yang 41b4ff5170 libhsakmt: update query pointer info document
Query pointer info return HsaPointerInfo with MemFlags for all pointer
type now.



Change-Id: I3c02b7b71ba0af953035e3ed9cd6bb6435bb9b65
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 991cde0656]
2021-07-29 21:10:38 -04:00
Philip Yang e826288132 kfdtest: fix KFDIPCTest on gfx1xxx
hsaKmtAllocMemory with mflags.HostAccess=1 will fail on desktop gfx1xxx GPU
because it's small bar PCIe. Remove this flag.

Child process exit status should use current_test_info, not unit test
info.



Change-Id: I060f23aa98a42251921d003878e70a409c92a4de
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 413979c319]
2021-07-29 21:10:17 -04:00
chen gong 820e03bd4c libhsakmt: add cyan skillfish support
Signed-off-by: chen gong <curry.gong@amd.com>
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Change-Id: Ie26c2e156c9c4e68a6b36fe699adccf3f808b5e7


[ROCm/ROCR-Runtime commit: 860931557c]
2021-07-29 16:44:16 -04:00
changzhu 5456bde2e2 kfdtest: blacklist some SVM test cases for gfx902 iommu path
Change-Id: I77f734df7ca65f2aa176548fd02ddac6036fe138
Signed-off-by: changzhu <Changfeng.Zhu@amd.com>


[ROCm/ROCR-Runtime commit: 3600cdfa01]
2021-07-29 00:02:57 -04:00
changzhu 0e9cdfecb9 kfdtest: take back SVM test cases for gfx90c
Change-Id: I28627f6eeaf9d213d7740849c6fadcccd91733c0
Signed-off-by: changzhu <Changfeng.Zhu@amd.com>


[ROCm/ROCR-Runtime commit: 1fe2225f52]
2021-07-28 15:44:02 +08:00
Philip Yang 0869422f81 kfdtest: KFDIPCTest BasicTest query shared memory
Parent process alloc memory with specific HsaMemFlags, child process
import the memory handle exported by parent process, query shared memory
pointer info, verify it has same HsaMemFlags.

If child process test failed, exit with error code to notify parent
process.

Change-Id: I5c9534e931b4565186d27124868799b893504c81
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 426b94015c]
2021-07-23 10:08:28 -04:00
Philip Yang 7100af1b99 kfdtest: query userptr pointer alloc flags
Test if query userptr pointer info return correct alloc flags,
CoarseGrain by default.

Test if query hsaKmtAllocMemory pointer info return correct alloc
CoarseGrain flags.



Change-Id: If3a1175645717e5d7c475d6ff35b02d6876a1f7c
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: c3c1618db7]
2021-07-22 21:14:46 -04:00
Philip Yang f11efa6ee2 kfdtest: RegisterGraphicsHandle check CoarseGrain set
Register graphics memory should always coarse grain.



Change-Id: I9d056b41287fa63247a042e5530ba29d535173ea
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: db288df695]
2021-07-22 21:14:46 -04:00
Philip Yang c26f323d51 libhsakmt: Qyery pointer info flags for registered memory
hsaKmtQueryPointerInfo return vm_obj flags for all below registered
memory types other than hsaKmtAllocMemory, and set the CoarseGrain flag
correctly for:

Graphics: always coarse grain.

Shared: hsaKmtShareMemory pass mflags with export handle to KFD to store
in KFD objs, hsaKmtRegisterSharedHandle get mflags from KFD with import
handle.

Userptr: it is already coarse-grain by default, or based on mflags
provided in hsaKmtRegisterMemoryWithFlags call.



Change-Id: Idc23e8b0cf599b02580737639da2f9ef4ccd0c0d
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: fa7b4a6268]
2021-07-22 21:14:46 -04:00
Philip Yang 178c985a8b libhsakmt: Query pointer info returns HsaMemFlags
Query pointer info returns KFD_IOC_ALLOC_MEM_FLAGS_* flags, it should
return HsaMemFlags, fix it by renaming vm_obj->flags to mflags and
always saving HsaMemFlags.

Use consistent function parameter and variable name to avoid confusion:
mflags for HsaMemFlags and ioc_flags for KFD_IOC_ALLOC_MEM_FLAGS_*
flags.

AMDKFD_IOC_GET_DMABUF_INFO return ioc_flags, translate it to mflags
using new helper fmm_translate_ioc_to_hsa_flags.



Change-Id: If9e117c507139c0166abb1ab0df8c233ef7e48a1
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: 2c796e62be]
2021-07-22 21:14:46 -04:00
Aaron Liu e709fed186 libhsakmt: add yellow carp DID
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Change-Id: If798dc733bc8d65c67922fb5d2e32aa1dada8381


[ROCm/ROCR-Runtime commit: 3d12437f1b]
2021-07-22 21:18:42 +08:00
Kent Russell 8d90ef172c libhsakmt: Add gfx1032 DID
0x73E3 DID was missing, add it.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: Id1ae2f268e0e8b5cfec5ae2065153fe73854b93a


[ROCm/ROCR-Runtime commit: ed62c7aa1c]
2021-07-22 07:37:19 -04:00
Philip Yang 6a15d17257 libhsakmt: update to KFD ioctl version 1.6
sync with KFD ioctl version 1.6:

1.6 - Query clear flags in SVM get_attr API

Change import export handle args pad field to flags, to pass memory
alloc flags from alloc process to import process.

Change-Id: I69360b244651947e885c4a8da9f64a1163101d20
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: dee9c023a2]
2021-07-21 21:48:18 -04:00
Icarus Sparry e97ebfd200 Add dependency on rocm-core
Signed-off-by: Icarus Sparry <icarus.sparry@amd.com>
Change-Id: I5f99114e9186679585862f05db8a508663b74b0d
Signed-off-by: Icarus Sparry <icarus.sparry@amd.com>


[ROCm/ROCR-Runtime commit: b63dde24d0]
2021-07-21 15:57:54 -04:00
Kent Russell 77588e8159 Fix drm.h include path
kernel-headers provides the drm/drm.h path, while libdrm-dev[el]
provides the libdrm/drm.h path, which is what we want to use. Fix the
path so we use the newer drm.h header, as well as fixing SLES, which
doesn't provide drm.h in their kernel-headers.

Change-Id: Icb2b6643698d356169e3baeef17527a1b4e05483


[ROCm/ROCR-Runtime commit: 4f3440a8ac]
2021-07-20 12:49:15 -04:00
Jonathan Kim de34fa23ed libhsakmt: add drm.h header dependency for sles
Update to thunk API introduced dependency on drm.h in commit
1001f27cb5 libhsakmt: update thunk api for exception handling
so update dependency list in SLES builds.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Change-Id: I6d987fac07612e3eca7b6087205d76df50dc13d9


[ROCm/ROCR-Runtime commit: 303c0748ce]
2021-07-19 12:48:13 -04:00
Jonathan Kim 6c4717ae7a libhsakmt: add runtime enable and disable calls
Add hsaKmtRuntimeEnable and disable.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Change-Id: I083f9293948e975546a1b3c1334cb41499b9ab1f


[ROCm/ROCR-Runtime commit: 1ce548829b]
2021-07-16 18:37:41 -04:00
Jonathan Kim 1001f27cb5 libhsakmt: update thunk api for exception handling
The debugger and debug agent no longer use the Thunk API.
Remove all deprecated functions and keep commented
references for future KFD tests.

Update and the keep the version checks for future use
and hsaKmtRuntimeEnable/Disable.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Signed-off-by: Laurent Morichetti <laurent.morichetti@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Change-Id: Ia2f10d82f5ac36d0bd1bda233810f26e8a154d55


[ROCm/ROCR-Runtime commit: 31ac82617c]
2021-07-16 18:36:18 -04:00
Jonathan Kim fe03b35c8e libhsakmt: update create queue for exception handling
Update hsaKmtCreateQueue to initialize the new save area header with the
exception payload and event ID.

Signed-by-off: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Sean Keely <sean.keely@amd.com>
Change-Id: Icd38062dc982cb29b30644699014eeb0b3e26d00


[ROCm/ROCR-Runtime commit: 96c7a5c9dc]
2021-07-16 18:34:35 -04:00
Felix Kuehling 14d821391e libhsakmt: Fix deadlocks in __fmm_release
__fmm_release is sometimes called with the aperture lock, and sometimes
without. Consistently call it with the aperture lock held and remove the
lock/unlock calls from this function.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: I80dddc64cc0703e5eed8e9f1eb65b75a2c7ae2eb


[ROCm/ROCR-Runtime commit: 5fac7dcc3b]
2021-07-12 18:27:55 -04:00
Felix Kuehling 559bb50c6a libhsakmt: Fix deadlock in map_mmio
Unlock mutex if MMIO mapping fails. This happens on all GFXv8 GPUs.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: I1dee1cbddefd9185c24ea79377f49f8ae2c5ff57


[ROCm/ROCR-Runtime commit: 19536080a8]
2021-07-09 17:07:42 -04:00