Grafik Komit

2959 Melakukan

Penulis SHA1 Pesan Tanggal
Harish Kasiviswanathan e35778ed4d kfdtest: Temporarily blacklist KFDMemoryTest.PtraceAccess
Possibly because of moving to gart table for vram access from Kernel.
This test failure shouldn't be a blocker. Temporarily blacklist till a
solution is found.

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I99725f368aced863188e30f619288ad4d033b9a6
2021-02-26 13:00:09 -05:00
Oak Zeng ae0e74095e Allocate coherent uncached memory when HSA_DISABLE_CACHE is set
Set the KFD_IOC_ALLOC_MEM_FLAGS_COHERENT flag  and
KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED flag to allocate
uncached coherent memory when HSA_DISABLE_CACHE
environment variable is set. At KFD driver,
Single KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED flag is
not sufficient to allocate uncached memory. We
have to use both two flags to allocate uncached
memory.

Change-Id: Ie490f37b2e696314e60048f5b1b57442431696e9
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2021-02-26 13:00:01 -05:00
Chengming Gui c21466d735 libhsakmt: add DID for gfx1031
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Change-Id: I1b890dda0ef9ee53c3950c17c106197167f210b9
2021-02-26 17:40:13 +08:00
Kent Russell 9311789398 rocrtst: Add packaging information to CMakeLists
This will create a deb and an rpm for rocrtst to make installing and
running it easier for non-ROCr devs.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I506baedc1471482e5808139cab5c28ae07ac8fb1
2021-02-24 12:22:31 -05:00
Yifan Zhang 5977eb554f rocrtst: fix a test case setup issue in iommuv2 for APU
APU doesn't have non-KERNARG memory pool for cpu agent or
a global memory pool for gpu agent. Current setup check
fails as below. Change to a APU specific check method.

[==========] Running 45 tests from 5 test cases.
[----------] Global test environment set-up.
[----------] 1 test from rocrtst
[ RUN      ] rocrtst.Test_Example

    #### TEST NAME ####
Test Case Example

    #### TEST DESCRIPTION ####
Put a description of the test case here. Line breaks will be taken care of
on output, not here.

    #### TEST SETUP ####
The gpu device name is gfx902
Target HW Profile is HSA_PROFILE_FULL
Test can run on any profile. OK.
/home/jenkins/hsa/runtime/rocrtst/common/base_rocr_utils.cc:180: Failure
Value of: rocrtst::ProcessIterateError(err)
  Actual: 4096
Expected: HSA_STATUS_SUCCESS
Which is: 0
HSA_STATUS_ERROR: A generic error has occurred.
/home/jenkins/hsa/runtime/rocrtst/suites/test_common/test_case_template.cc:195: Failure
Value of: HSA_STATUS_SUCCESS
  Actual: 0
Expected: err
Which is: 4096
rocrtst64: /home/jenkins/hsa/runtime/rocrtst/common/base_rocr_utils.cc:416: hsa_kernel_dispatch_packet_t* rocrtst::WriteAQLToQueue(rocrtst::BaseRocR*, uint64_t*): Assertion `test->main_queue()' failed.
../shunit2: line 977:  1382 Aborted                 (core dumped) ./rocrtst$ROCRTST_BLD_BITS "$ROCRTST_ARGS" --gtest_output=xml:"$gtest_xml"
failed (failed to run rocrtst)

Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Change-Id: I03691bd4171b6e622231baf3dce4db2211eb47e7
2021-02-23 20:14:40 -05:00
Eric Huang 9aa521d1ff KFDTest: add cache coherence tests for gfx90a
Three kfd subtests are added to verify new XGMI connection with
cache coherence HW link on A+A.

Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>
Change-Id: I6960ec91cbfb696c4e6acb3b79fd83107003acdd
2021-02-23 12:22:32 -05:00
Harish Kasiviswanathan 085005f07b kfdtest: Add gfx9_PollNCMemory function to support NC memory
In A+A all system memory is mapped as NC. So add a new function
gfx9_PollNCMemory which will support NC memory.

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I097b95fb156f73d6f480cd4fd262cc6fa5933f69
2021-02-23 12:20:29 -05:00
Eric Huang f7759df6e0 kfdtest: fix KFDQMTest.Atomics test failure on A+A
destBuf is mapped as cached, the intruction flat_atomic_add
operates on cache that cause test failed. Adding scc modifier
in the instruction will fix the issue.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I8e138f93ae4f5e23020e3ac1549ef924968a74c5
2021-02-23 12:20:29 -05:00
Eric Huang 3a378fcf0b kdftest: remove some kfdtests filtered for gfx90a
The three kfdtests have been fixed, so remove them from
filter list.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I101a72476970a9d105e8c0b5c022847757fdd316
2021-02-23 12:20:29 -05:00
Oak Zeng f132fb2cd0 Make GPU mapping of memory as uncached if HSA_DISABLE_CACHE is set
Before gfx90a, coherent memory is uncached. So it was reasonable
when environment variable HSA_DISABLE_CACHE is set, memory is mapped
as coherent. On gfx90a, coherent memory can be cached, so mapping
memory as coherent can't guarantee memory is uncached. When
HSA_DISABLE_CACHE is set, we have to map memory as uncached.

Change-Id: Ia5ed4cf0ad6aef5644dc8c9e6632b52d606f06f4
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2021-02-23 12:20:29 -05:00
Harish Kasiviswanathan 57f46b53ec kfdtest: A+A: CP writes to NC mem need flush
Refer to commit "Mark buffers accessed by CP as UC"

A+A buffers are mapped as NC. CP (PM4Writes) need ReleaseMem function to
ensure the write go through to the memory

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I4ee55a6e40fba078f5950d95c8fee7ee076260bf
2021-02-23 12:20:29 -05:00
Harish Kasiviswanathan 0e8500b886 kfdtest: A+A: Mark queue address as UC
Refer to commit: " Mark buffers accessed by CP as UC"

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I1816e035dbb3178f28f5e34b050c20ecca282060
2021-02-23 12:20:29 -05:00
Harish Kasiviswanathan 44adc3dafd kfdtest: Add Uncached flag to HsaMemoryBuffer constructor
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I14b0a73ffb04f4798547fe7003de1440736b413d
2021-02-23 12:20:29 -05:00
Harish Kasiviswanathan 10674916e4 libhsakmt: Explicitly mark AQL buffers as UC
This change might be redundant if ROCr takes care of it

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I7b67143a8ad21baa61b7eda7b8e5fe0ac1e33830
2021-02-23 12:20:29 -05:00
Harish Kasiviswanathan 7c05c5240f libhsakmt: A+A: Mark buffers accessed by CP as UC
This change is for the A+A bring-up branch as it needs to made more
generic to handle all ASICs.

For A+A all the system buffers are mapped as NC (non coherent) unless
explicitly marked as UC (uncached). The coherency is then expected to be
handled by shader by explicitly using acquire/release instructions.

However, CP doesn't have same feature. The buffers used by CP thus have
to UC. For now queue buffer and Signal handler memory is marked as UC.

This change shouldn't affect other ASICs since Uncached flag is not used
in those. However, this change still need to be made more generic.

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I56c37a809913f7f08c94d01b0572d0f4864939aa
2021-02-23 12:20:29 -05:00
Laurent Morichetti 4cf11c3a7e libhsakmt: Fix the ctrl stack size calculation
On gfx9, the maximum number of wavefronts per queue is the minimum of
40 waves per compute units, or 512 waves per shader engine.  On gfx10,
there can only be 32 waves per compute units.

Signed-off-by: Laurent Morichetti <laurent.morichetti@amd.com>
Change-Id: I148d1a4fe6c07cdbfaa1f77939eb29311c81c008
2021-02-23 12:20:29 -05:00
Laurent Morichetti a83f9b67ce Update the context save area size
Reserve some space in the context save area for the debugger's
use. There should be 32 bytes per wave for a given queue.

Change-Id: I65ddb6123d0f6afd3149844617ad19023009101d
2021-02-23 12:20:29 -05:00
Amber Lin e342c9c890 kfdtest: Temporarily blacklist some tests
Temporarily blacklist some tests on gfx90a until they are solved.

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Change-Id: I87cc3a996ea7d55ed8f20f5b4eecfd8bb691effd
2021-02-23 12:20:29 -05:00
Oak Zeng 1f05b54dc9 Delete device stepping check
On every new asic with new stepping, we need to manually relax this
checking. This check is not very helpful. Delete it.

Change-Id: I11f813023ca2566d82f6d11121d4be38c296674b
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2021-02-23 12:20:29 -05:00
Eric Huang ec7ba38b23 kfdtest: blacklist KFDMemoryTest.DeviceHdpFlush on gfx90a
Due to cache coherence change, the remote vram mapping is changed
to cached, the written value by remote shader will not be read by
local shader. So the test will fail.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I2b64e8a30bed0066e159bad9bb7febae5ebe84aa
2021-02-23 12:20:29 -05:00
Oak Zeng 50debca7e9 Support gfx90a real asic device id
Change-Id: Ib223b4e890899c3c4e468993a88f849bccc5d182
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2021-02-23 12:20:29 -05:00
Alex Sierra 3f45f602d4 libhsakmt: add XNACK API set/get mode
XNACK API for GPUs that support this mode. This API
makes calls to amdgpu driver to configure xnack mode.
It supports set xnack mode and query the current mode used.

Change-Id: If865fd0e3f900f008243dc49504e1a0694e1791a
Signed-off-by: Alex Sierra <alex.sierra@amd.com>
2021-02-23 12:20:29 -05:00
Alex Sierra 75e8fe383f libhsakmt: add SVM thunk implementation
Implement SVM (Shared Virtual Memory) in the thunk.

Change-Id: I0380150d1d3da48070f9389a06f416d6059d6948
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Sean Keely <Sean.Keely@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Sierra <alex.sierra@amd.com>
2021-02-23 12:20:29 -05:00
Alex Sierra a352639df5 libhsakmt: add API to support svm and xnack
Add function definitions to support SVM (shared virtual memory)
and xnack set.

Change-Id: Ia97ad9d0c449d8d500d799f702e1a58e87d65a56
Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2021-02-23 12:20:29 -05:00
Philip Yang 5ae49f2321 libhsakmt: add kfd_ioctl.h svm and xnack support
Add svm (shared virtual memory) range and xnack mode
APIs.

Change-Id: Ibd8d7fe566dc200730da0c892caa71aad7589ebd
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Alex Sierra <alex.sierra@amd.com>
2021-02-23 12:20:29 -05:00
Kent Russell 731a06c704 Fix GCC warning regarding strncpy in CPU info
strlen(src) should not be used as the length in strncpy. Use memcpy
since we know the length of the string, and ensure that we
NULL-terminate regardless of length

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I21cc6d106510c69464e7ac9d3fc7da3a1e6d1a68
2021-02-23 12:20:29 -05:00
Eric Huang 18ead8815c KFDTest: fix an exception bug in P2PTest
The largebar check will exit exceptionally from test
when destination node is not set.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I8bf0fed613250cc71468208e645fc562fb1a8757
2021-02-23 12:20:29 -05:00
Eric Huang 4b3b941bb3 libhsakmt: add device id(0x46) for gfx90a mGPU model in topology
Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I43f7c12906c408576e1eb55871d51e7a30569ede
2021-02-23 12:20:29 -05:00
Eric Huang 198b5bd450 kfdtest: add function to determine XGMI link to cpu
Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I7650f7857f0eecd2ad587634ae11c1cf5116bd97
2021-02-23 12:20:29 -05:00
Jonathan Kim f398d6d204 libhsakmt: add host trap send
Adding host trap send command.

Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
Change-Id: I291c13f5905e00bc6685a980284a6abd0c98da78
2021-02-23 12:20:29 -05:00
Oak Zeng 97ae33f9de Add gfx90a Gopher LSE DID (0x54)
Change-Id: Ic0a1e3d01373e0d6ba58e42188dced394423de82
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2021-02-23 12:20:29 -05:00
Mukul Joshi da3abfb0f8 Update build script for SP3 static library
Update build script and CMakeLists_sp3.txt file as SP3 directory
structure has changed.
The SP3 source code with gfx90a suport is merged into a
new branch mukjoshi/sp3_gfx90a.
Please make sure to checkout this branch before using the
build script to generate the static library.

Change-Id: I2bf0ade8b2d254cd7648cc8a6d69a83ee51344cd
2021-02-23 12:20:29 -05:00
Amber Lin 8c6dd3cbae libhsakmt: Add device ID used in Simnow
Simnow simulator uses 0x7400 as gfx90a's device ID

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Change-Id: I0022509ef643760bc906e537b4fc64f1523fd8bf
2021-02-23 12:20:29 -05:00
Mukul Joshi c861873dae Add SP3 assembler support for gfx90a.
Add updated SP3 static library with support for gfx90a and
also add initial corresponding changes in kfdtest.

Change-Id: I71bc6404ace7f9bf0dd74e712287136aa2b8a03d
2021-02-23 12:20:29 -05:00
Yong Zhao 690a148427 kfdtest: Add a simple test case to test local memory
Given the chance of local memory breakage is so high on emulators, we
should use this simple test to check the local memory function.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Change-Id: Ifc48c12e11d75cc777ed7ea13e03bf54c2458e12
2021-02-23 12:20:29 -05:00
Yong Zhao 33c34506fa kfdtest: Fix a path error in CMakeLists.txt
PKG_CONFIG_PATH environment variable should be set to
<rocm_path>/lib/pkgconfig, because the *.pc file is located there.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Change-Id: Iec503b1c2409987e52fd88fea160c70762686a28
2021-02-23 12:20:29 -05:00
Yong Zhao 87f62056f1 kfdtest: Move the package definitions to the beginning in CMakeLists.txt
This ensures that similiar logic stays together.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Change-Id: I32695d7d6a7366bcbf4169e22119d768d111c633
2021-02-23 12:20:29 -05:00
Eric Huang 2464bfc714 libhsakmt: add new flag for memory mapped as uncached
It is to provide an option to map specific memory as
uncached on A+A HW platform.

Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>
Change-Id: Ib665cb306a0e78aba3ea5ee2f0e46cb62ae139f8
2021-02-23 12:20:29 -05:00
Yong Zhao 8881075ab2 kfdtest: Improve the message when CWSR basic test does not pass
This will give out more info.

Change-Id: I407422b84bebdf39a886c57736093a035ff02118
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2021-02-23 12:20:29 -05:00
Yong Zhao 51b6bcf40d kfdtest: Support gfx90a
Change-Id: I879ea534729e7adca4892be897dc86f6153aa190
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2021-02-23 12:20:29 -05:00
Yong Zhao be09658247 Program mmCOMPUTE_PGM_RSRC3 on gfx90a
Change-Id: If387d137ebd388f5aea930a5f7bca3413dcbfcce
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2021-02-23 12:19:42 -05:00
Mike Li 93609fd3d4 Support for Custom Pitch for gfx103x
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: Ica83dff8bb382637010396781190f585754bd150
2021-02-22 22:05:25 -05:00
Jason Tang ec22afb8a8 Correct GetIsa() typo
Change-Id: Ia6b5a86bd035fb077f0da9d52160ec8d12987b87
2021-02-17 11:57:58 -05:00
Sean Keely 34ac62274a Correct legacy copy path.
Legacy p2p copy path incorrectly transfered in whole pages rather than
the requested size.

Change-Id: I9aa7337754f9e32f587a0cc5305f8ffeb6196f10
2021-02-10 19:53:02 -05:00
Sean Keely 01f42dbe46 Add hsa_amd_signal_value_pointer.
Enables partial signal interop with non-HSA devices.

Change-Id: Ic39bca84ed1709cbd2cc24b1eb0f4fc6cccb39cf
2021-02-10 18:47:54 -05:00
Jay Cornwall 0fc623e873 libhsakmt: Limit control stack size on gfx1032
Add to workaround list.

Change-Id: I01855d3404203760507879db5af23455407ac450
Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
2021-02-08 13:09:13 -05:00
Jay Cornwall 526afa8394 kfdtest: Add KFDCWSRTest.InterruptRestore
Test for HQD preemption during stalled context restore. Added for
regression testing against new microcode.

Change-Id: I13eb7d1c598062390e12cf8a5237e53b6489f232
Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
2021-02-08 13:05:42 -05:00
Laurent Morichetti 9ca79d072a New trap handler ABI (v4)
Replace the stop reasons ttmp11.trap_raised and ttmp11.excp_raised
with ttmp11.wave_stopped which indicates that the trap handler has
halted the wave as the result of an event (trap, single-step or
exception).

If the wave is stopped because of a trap, also record the trap_id in
ttmp11.saved_trap_id[7:0].

Save status.halt in ttmp11.saved_status_halt, so that it can be
restored when resuming a wave (changing a wave's state from stopped to
running or single-stepping).

Change-Id: I7322f59b60e8cc1b92bf5f067dba606a3109ef49
2021-02-05 09:56:01 -08:00
Evgeny c5aae30d08 adding gfx1030 blocks
Change-Id: Ide2576939c5321dbe928183a8d9984d5ef87a61b
2021-01-29 08:50:10 -06:00
Ori Messinger 46c94662b7 libhsakmt: Add Missing gfx1030 DID
The purpose of this patch is to add a missing device ID for gfx1030.
The missing ID "0x73A1" is now added to the "topology.c" file.

Signed-off-by: Ori Messinger <Ori.Messinger@amd.com>
Change-Id: I05a8a55e2c46f941a039fa72a6a5e76bf2a52736
2021-01-29 07:18:49 -05:00