Commit Graph

75 Commitit

Tekijä SHA1 Viesti Päivämäärä
David Yat Sin 3f97bbda93 Support extended scope fine-grained memory
Add display flag for extended scope fine-grained memory

Change-Id: I73f965e12a7a68afcd71f93a7b6a1af453de0510
2023-07-20 22:30:16 +00:00
Mark Searles c8db38ede2 Removing __linux__ definition in CMake
Removing this definition as this should already be defined by compiler.
This is causing compile errors on newer versions of llvm because the
macro is being redefined.

Change-Id: I3bf03617970d4b76dabce36ed980523673afadc5
2023-06-02 16:39:42 -07:00
David Yat Sin 2d34dc31f2 Add query to check DMABuf support
Add query to check whether DMAbuf export is supported on this system

Change-Id: I28caa87b67135d67ffcc94695e4656e7b691d259
2023-05-29 17:38:10 +00:00
David Yat Sin eb1283f377 Add query for mwaitx support
Change-Id: I775234ff570e3cedacd68adb4617e62dce76bd9e
2023-03-28 12:11:55 -04:00
Mark Searles 34cc693bef Fix parsing of rocminfo output for ISAs with no features defined
Patch is an internal port of
 https://github.com/RadeonOpenCompute/rocminfo/pull/59

Change-Id: Iea84f49a60abce73716a7451960c20ee0d2b7bca
2023-03-27 08:56:00 -07:00
David Yat Sin 2c92e790f0 Add display for IOMMU Support
Change-Id: I5af127ef1f9c1ae4b3b86b9e38272eb4f032191a
2023-01-20 02:56:45 +00:00
David Yat Sin c6b1707d0e Add fields for CP firmware and SDMA engine ucode
Change-Id: I796b5a1c1e8be7fedda6207bcb740e3956aef8b2
2023-01-05 23:42:03 +00:00
Johannes Dieterich 94b4b3f0a6 Fix rocminfo when run within docker environments
Currently, rocminfo will fail when executed inside a docker container
due to being unable to lsmod inside docker. This has impacts on
rocprofiler use.

Fix this behavior by querying initstate of the amdgpu module from
/sys/module/amdgpu instead. If initstate is marked "live" everything if
fine - error out with either "not loaded" (initstate file does not
exist) or "not live" (initstate file does not contain "live" string).

Change-Id: I6f2e9655942fd4cf840fd3f56b7d69e893fa84d7
2022-11-21 18:11:31 +00:00
Mike Li 3a4d533a1e Check permission and handle PermissionError exception
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: If7cb8464d0b761e4be45c85eb7147ceed609da61
2022-08-17 12:23:30 -04:00
David Salinas d8f236cd81 Handle case with no GPUs
Change-Id: I35b8d4d0c0b6e63d9851d56163686794c7bb8c1e
2022-06-17 14:40:44 -04:00
Ranjith Ramakrishnan 0b270afafc SWDEV-321112: Use GNUInstallDir variable DOCDIR
Replaced install path 'share/doc/project_name' with gnuinstalldir variable CMAKE_INSTALL_DOCDIR

Change-Id: Id9fc7599e6893a604f9d965b952ab27413e1c0d6
2022-05-24 23:29:54 -07:00
Sean Keely 4f1b5ed4b8 Correct include paths for new directory layout.
Depends-On: I5e11e72848633dcc749d1e92705a8e3be67f793d
Change-Id: If743d015bb9c7c6fb179e259e2d4eb69be60e383
2022-05-06 01:15:21 -04:00
Mike Li b6dc27f0b3 Add ASIC revision
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: I8f6bbf39e4cf85bb03fd6c0de7afe5f9e6666ba5
2022-03-16 00:51:33 -05:00
Shweta Khatri cf92f649ab Fixed some errors in rocminfo reported by lint tool
Change-Id: Ie7852c2003c10847226a5df23c4e85fbe89dad43
2022-02-16 17:05:21 -05:00
Ashutosh Mishra 6b4d69d011 changeing major_ver of targetlist to decimal
Change-Id: Iada6cf9d2ba3bce4c042dffbf97f1588ffe10a8a
2022-02-03 23:38:24 +05:30
Nirmal Unnikrishnan 31e6575e9f Adding license file to rocminfo package
Change-Id: Ibc3b53922c366944a404982ed977ede50c6f36c7
2022-01-15 06:32:38 -06:00
Sean Keely b83efe00a4 Update README.
Document use of sysfs for gfx arch lookup.

Change-Id: Ic326769be3e23d627e16fb1aae56c0d16ce99d78
2021-10-29 20:24:11 -05:00
Sean Keely 7766360dd6 Close /dev/kfd after access check.
Cleanup dangling file handle.

Change-Id: I37bc42a2ffb7122f441cbf8a09c141d4396db928
2021-10-29 20:23:32 -05:00
Sean Keely b57c02d131 Handle high levels of concurrency in rocm_agent_enumerator.
rocm_agent_enumerator may invoke rocminfo.  Rocminfo opens the
GPU device which allocates limited resource.  Beyond 254
concurrent processes this resource will be exhausted and rocminfo
will return an error.

This patch loops rocm_agent_enumerator when recieving a failure
message from rocminfo indicating KFD is out of memory.

Change-Id: I8637e214f5fa012642975c28578ae6bf9200eda8
2021-10-29 20:22:19 -05:00
Joseph Greathouse f419b81bdf Add capability to pull gfx architecture from KFD topology
New versions of amdkfd include the gfx architecture version number
for all GPUs surfaced in the HSA topology. This patch adds this as
the preferred way for rocm_agent_enumerator to check for supported
gfx architecture numbers.

Kernels that are missing this feature will not have the value in
the topology. rocm_agent_enumerator will fall back to checking
against the PCI IDs in this case. If PCI IDs fail, we fall back
to the heavyweight rocminfo method.

Change-Id: I5cf22e1069114675092e97ae52331b829cfafb04
2021-10-29 20:20:04 -05:00
Joseph Greathouse e9b7de43be Switch order of lspci and rocminfo for gfx arch query
rocminfo is a very heavyweight mechanism for learning a lot of
information about the GPUs that are attached to the system.
It opens up the limited /dev/kfd resource to gather lots of
information about each device, while rocm_agent_enumerator really
only wants the gfx number of AMD devices attached to the system.

To avoid this heavyweight lookup in most cases, this patch switches
the order of tests. Rather than starting with rocminfo and then
falling back to a poorly-maintained PCI ID list, this patch changes
the agent enumerator to start by checking in the PCI ID list (fast
case) and then falling back to rocminfo (slow case) if the PCI ID
list is out of date.

Change-Id: If24b8bc3baeeb6adad362abbb288ef3728383bce
2021-10-29 20:16:22 -05:00
Joseph Greathouse 0e1807c72d Update cmake to include pciutils dependencies
When building packages, add in pciutils as a dependency because
rocm_agent_enumerator uses this as a mechanism for looking up
what GPUs exist on the system.

Change-Id: I10ac088c461c6d0bca435b61fbc90b685556fdf4
2021-10-29 18:45:32 -05:00
Joseph Greathouse ea5ce46fb4 Add better PCI ID backup in rocm_agent_enumerator
The PCI ID backup method in rocm_agent_enumerator, where the
tool uses lspci to find all AMD GPU devices in the system and
manaully match them to gfx version, is extremely outdated. The
PCI ID list did not include anything after Vega 10, and the
actual call to lspci no longer returned anything due to some
missing conversions.

The patch adds all GPUs that might be needed by ROCr up through
Navy Flounder. The PCI ID to gfx matching pulls from the amdgpu
driver and libhsakmt.

Change-Id: I58b77bb6aa631f575352fc444d2542f265909706
2021-10-29 18:45:23 -05:00
Sean Keely 2b4b0c8862 Add dependency on kmod.
rocminfo uses lsmod to check for loaded drivers.  Use of sysfs is
possible but sysfs' stable interface does not allow for easy parsing.
Use of lsmod avoids needing to walk the sysfs tree and avoids issues
of permissions to examine sysfs.

Both Debian and Fedora list lsmod under kmod.  Presumption is that
CentOS and RHEL also follow this.

Change-Id: Ic5033e0b780100c54d2fe0b4f501c40acbc237fb
2021-10-29 16:23:01 -05:00
Sean Keely 86560046de Correct and simplify package dependencies.
Package should depend on hsa-rocr, not hsa-rocr-dev.  Also
Remove negative path for dependency rocm-core (unconditional add +
conditional remove simplified to conditional add).

Change-Id: I6ead202f4f3f2f77b1da2ffed77feee956caf2e9
2021-10-29 16:23:01 -05:00
Sean Keely e32a4d9bed Don't touch CMAKE_CXX_FLAGS.
Cmake manages CMAKE_CXX_FLAGS in standard ways from user inputs,
env vars, and target properties.  Use target properties for our
options and let cmake handle the rest.

Change-Id: I20ef738e4df7880258d770f4ec13c09d8b323fba
2021-10-29 16:23:01 -05:00
Yi Qian e1df81cb8f Add a new rocm_agent_enumerator option '-name' which lists target names obtained from the output of rocminfo.
Change-Id: Iea366c744e2f03a46fd5c902ae4faa94b96f6942
2021-10-29 16:23:01 -05:00
Ashutosh Misra 2bd7657503 Adding package dependency
SWDEV-260294:Rocminfo shall explicitly depend on hsa-rocr for package installation

Signed-off-by: Ashutosh Mishra <ashutosh.mishra@amd.com>
Change-Id: I9a6d1691cd5a821f135a1d1cff599e9a2c40d06f
2021-10-29 16:23:01 -05:00
Chris Freehill 102f22f974 Append CXXFLAGS env. variable to CMAKE_CXX_FLAGS
This facilitates address sanitizer builds via env. variable.

Change-Id: I69fc9a5782ca80d7bdbf2b1ec0c89cccc4a5ca11
2021-10-29 16:23:01 -05:00
Icarus Sparry 1452f8fa24 Add dependency on rocm-core
Signed-off-by: Icarus Sparry <icarus.sparry@amd.com>
Change-Id: I2b0e330698ed19a2474734e33a1215644ec6f1cc
2021-07-19 21:25:55 +00:00
Chris Freehill 10da0a71da Exit earlier if prerquisites are not met
Change-Id: I1c861234986013742ce606ecffb5d9a7db697d05
2020-11-11 20:49:26 -05:00
Ashutosh Mishra e7b43b970f Standardizing Package name
Enables standards compliant package naming for debian and rpm

Signed-off-by: Ashutosh Mishra <ashutosh.mishra@amd.com>
Change-Id: I38af7b31f0c17d0c38ea7c2eb143770e7f1d74b2
2020-10-24 10:08:00 +05:30
Ashutosh Mishra 605b3a5105 Adapting to latest HSA changes
JIRA : SWDEV-234471
With this change rocminfo exe shall be created using using hsa-runtime64::hsa-runtime64 which
internally decides whether static or shared libs based on its cmake build options

S. Keely:
Update patch to use find_package for rocr dependency.

Removed deadcode now supported by find_package.

Removed "hsa/" prefix from include statements since find_package
points to the target (ie rocr) include directory.

Removed typedef on structs due to new clang-11 warning.

Adapting to the comments : Removed PATHS for hsa find_package

Change-Id: I1ec65cdbce3085e44f1839da196eb4ae5c9ff30d
2020-07-09 18:38:46 +05:30
Matt Arsenault 5d6be5b808 Refer explicitly to python3 in shebang line
On Ubuntu 20.04, there is no more python or python2. Currently I get
this: /usr/bin/env: ‘python’: No such file or directory

Change-Id: Ib310b8aa7c1bd62973ef3cc8bcaf571831ad4435
2020-05-04 09:40:11 -04:00
Chris Freehill 7624cc1008 Correct spelling of output message
Change-Id: Id7789e622ea76cc53c3be719798c3c1f90ede6e2
2020-05-01 13:22:50 -04:00
Matt Arsenault cd4b7cea85 Change check for /dev/kfd permissions
On newer kernels, it seems the group was changed from "video" to
"render". The check for video group misled me for quite some time, so
relax this check. Rather than specifically checking for video group
ownership, first see if /dev/kfd can be open as read-write. Then
diagnose whether the user belongs to the group that owns it, rather
than hardcoding the video group.

Change-Id: I9e65427363e9a5cdba802e09cee2f40fb80520ed
2020-05-01 10:14:21 -04:00
Chris Freehill 373d8abdec Fix rocm_agent_enumerator on RHEL
This fixes SWDEV-231760

Change-Id: If704c8ff76548e10ddbda1b5c1ad0c28df7ab6f0
2020-04-16 16:39:51 -05:00
Ramesh Errabolu a1b4a580fc Extend rocminfo to print UUID of ROCm devices
Change-Id: I258962046e6d05dda91a8c48af646e50500b2d53
2020-04-13 20:42:43 -05:00
Chris Freehill 70ebe13a89 Fix ennumerator id parser.
Fixes SWDEV-226018

Change-Id: I14144cdd316c19fe29dcd70b406a52aac8a741cd
2020-03-06 19:50:35 -05:00
Wilfried Holzke a134847069 Added documentation for the new env var.
Change-Id: I0407a5dd36e91a1ea205ce4dda9a7fca906e1266
2019-12-16 10:38:47 -06:00
Wilfried Holzke 12736c6fd8 Added env var to set target.lst
Change-Id: Ie6aefba6ef79360e65d4a64a6be1ec50e59b5741
2019-12-16 10:37:33 -06:00
Chris Freehill 9b0cd9e428 Fix for running rocminfo on wider variety of CPUs
Change-Id: I7acc46d2fec97ae1026643f79e59dd632444ce2e
2019-12-09 14:59:57 -06:00
Chris Freehill 831f3ab124 Update README to include instruction to fetch git tags
Also, slight reformatting.

Change-Id: I7c35343556e48cadccd266b41465fb5ea04ace29
2019-12-09 14:51:53 -06:00
Chris Freehill 2afaae2fbe Require >= CMake3.5 instead of 2.8
Change-Id: I5e0045fad2ecc028c2dcb9fd78805dfb42a9e2ed
2019-12-09 11:57:09 -06:00
Craig Andrews f1181e0569 Install to standard locations using GNUInstallDirs
Change-Id: I6bafae15d2a0dfb70389673e03b6f72737786501
2019-08-22 23:02:30 -05:00
Chris Freehill 9842beb770 Update versioning to new uniform standards
Change-Id: I93eb3170fedeee98caf7b3fd8f63a8c0fef5fd78
2019-08-22 12:01:49 -05:00
Craig Andrews 04dc08664e Use CACHE variables, allow overriding ROCR_LIB_DIR/ROCR_INC_DIR
CACHE variables allow for variables to be documented, and
ROCR_LIB_DIR/ROCR_INC_DIR should be overridable as they'll
have different values on different Linux distributions.

Change-Id: I0bba633c184df2da55bdbe6aabbd53346d098b83
2019-08-22 08:02:31 -05:00
Craig Andrews 9f5349806a Messages indicating fatal errors should be fatal
Change-Id: Ib071d3f6ed216c817daa637fc784680ef9d123f8
2019-08-21 22:28:54 -05:00
Wilfried Holzke 6f140e5391 Fixed sizeof(err_val) to return the number of characters in the array
Change-Id: I7e4f04d10b2f9cc9dbed2431e53b5ebc540acf56
2019-08-21 16:12:55 -05:00
Chris Freehill 141592e4f3 Correct check for video group membership
* Continue with rocminfo even if video and kfd check fail.
* Color code informational lines (white) and warnings (red)

Change-Id: I739034c932fffca0924abc93ae9a929664a3e182
2019-07-15 23:14:12 -05:00