justxi / rocm

Ebuilds to install ROCM on Gentoo Linux
38 stars 23 forks source link

Status of ROCm v4.3 ebuilds... #199

Open preney opened 3 years ago

preney commented 3 years ago

I would like to ask what is the status of the ROCm v4.3.0 ebuilds. I currently have these ebuilds installed on my system:

OpenCL-related (non-ROCm):
  dev-util/opencl-headers-2021.06.30::gentoo

ROCm Core Components:
  sys-kernel/rocm-sources-4.3.1::local -build -symlink
  sys-kernel/rocm-sources-4.3.0-r1::local -build -symlink
  dev-libs/rocr-runtime-4.3.0::gentoo
  dev-libs/roct-thunk-interface-4.3.0::gentoo

ROCm Support Software:
  dev-util/rocm-cmake-4.3.0::gentoo
  dev-util/rocminfo-4.3.0::gentoo
  dev-util/rocm-bandwidth-test-4.3.0::rocm

ROCm Support Software (ebuilds Deprecated):
  NOT INSTALLED: dev-util/rocm-smi

ROCm Compilers:
  sys-devel/llvm-roc-4.3.0-r1::gentoo -debug runtime
  dev-libs/rocclr-4.3.0::gentoo
  dev-util/hip-4.3.0::local -debug -profile
  dev-util/rocm-clang-ocl-4.3.0::rocm

ROCm Device Libraries:
  dev-libs/rocm-device-libs-4.3.0::gentoo
  dev-libs/rocm-opencl-runtime-4.3.0::gentoo

ROCm Development ToolChain:
  dev-libs/rocm-debug-agent-4.3.0::rocm
  dev-libs/rocm-comgr-4.3.0::gentoo
  dev-util/rocprofiler-4.3.0::rocm -debug
  dev-util/roctracer-4.3.0::gentoo

ROCm Libraries:
  NOT INSTALLED: sci-libs/rocALUTION
  sci-libs/rocBLAS-4.3.0::gentoo -benchmark -test
  NOT INSTALLED: sci-libs/hipBLAS
  NOT INSTALLED: sci-libs/hipCUB
  NOT INSTALLED: sci-libs/rocFFT
  NOT INSTALLED: sci-libs/rocRAND
  sci-libs/rocSPARSE-4.3.0::gentoo -benchmark -test
  NOT INSTALLED: sci-libs/hipSPARSE
  dev-libs/rocm-smi-lib-4.3.0::rocm
  NOT INSTALLED: sci-libs/rocThrust
  NOT INSTALLED: sci-libs/miopen
  NOT INSTALLED: sci-libs/miopengemm
  NOT INSTALLED: dev-libs/rccl

Other ebuilds:
  media-libs/hsa-amd-aqlprofile-4.3.0::rocm
  dev-libs/amd-dbgapi-4.3.0::rocm
  NOT INSTALLED: dev-util/rcp
  NOT INSTALLED: dev-util/Tensile
  sci-libs/rocPRIM-4.3.0::gentoo -benchmark -test
  NOT INSTALLED: sci-libs/rocSOLVER
  NOT INSTALLED: dev-util/amd-rocm-meta

The ::local packages are:

The remaining not installed packages appear to be all in ::rocm with dev-util/rcp won't build and the rest all being v4.0 versions. (I have masked <4.3 and >=4.4 to keep everything to v4.3.) Are there working versions of the v4.0-only ebuilds somewhere that you know of or do they need to be created?

justxi commented 3 years ago

All what I have is in this repository and all ebuilds that I know in the Gentoo tree or the science overlay are mentioned in the README file. There are a few PRs in the github gentoo repository also. And there is a PR https://github.com/justxi/rocm/pull/195 for ROCm 4.2.

The ebuilds for ROCm 4.0 were fine in the past. What is missing?

preney commented 3 years ago

I was curious since a number of the packages do not have v4.3.0 ebuilds. So what you are saying is I can copy the v4.0.0 ebuilds (and have a look at the PR) to v4.3.0 and see what happens or not, etc.? :-)

justxi commented 3 years ago

Yes, you should first check the PR in Gentoo github, then the PR for 4.2 in this repo and I something is missing, then fall back to the 4.0 ebuilds. If you need help or/with a specific ebuild, let me know.

justxi commented 2 years ago

Do you currently miss any ebuild for ROCm 4.3? Otherwise I would close this.

preney commented 2 years ago

Sorry I missed your question earlier. Currently I have installed on my system (and items labelled NOT INSTALLED are indicated as well):

OpenCL-related (non-ROCm):
  dev-util/opencl-headers-2021.06.30::gentoo

ROCm Core Components:
  sys-kernel/rocm-sources-4.3.1::rocm -build -symlink
  sys-kernel/rocm-sources-4.3.0-r1::rocm -build -symlink
  dev-libs/rocr-runtime-4.3.0::gentoo
  dev-libs/roct-thunk-interface-4.3.0::gentoo

ROCm Support Software:
  dev-util/rocm-cmake-4.3.0::gentoo
  dev-util/rocminfo-4.3.0::gentoo
  dev-util/rocm-bandwidth-test-4.3.0::rocm

ROCm Support Software (ebuilds Deprecated):
  NOT INSTALLED: dev-util/rocm-smi

ROCm Compilers:
  sys-devel/llvm-roc-4.3.0-r1::gentoo -debug runtime
  dev-libs/rocclr-4.3.0::gentoo
  dev-util/hip-4.3.0::local -debug -profile
  dev-util/rocm-clang-ocl-4.3.0::gentoo

ROCm Device Libraries:
  dev-libs/rocm-device-libs-4.3.0::gentoo
  dev-libs/rocm-opencl-runtime-4.3.0::gentoo

ROCm Development ToolChain:
  dev-libs/rocm-debug-agent-4.3.0::rocm
  dev-libs/rocm-comgr-4.3.0::gentoo
  dev-util/rocprofiler-4.3.0::rocm -debug
  dev-util/roctracer-4.3.0::gentoo

ROCm Libraries:
  NOT INSTALLED: sci-libs/rocALUTION
  sci-libs/rocBLAS-4.3.0::gentoo -benchmark -test
  NOT INSTALLED: sci-libs/hipBLAS
  sci-libs/hipCUB-4.3.0::gentoo -benchmark -test
  sci-libs/rocFFT-4.3.0::gentoo -test
  sci-libs/rocRAND-4.3.0::gentoo -benchmark -test
  sci-libs/rocSPARSE-4.3.0-r1::gentoo -benchmark -test
  sci-libs/hipSPARSE-4.3.0::gentoo -test
  dev-libs/rocm-smi-lib-4.3.0::rocm
  sci-libs/rocThrust-4.3.0::gentoo -benchmark -test
  sci-libs/miopen-4.3.0::gentoo -debug -test
  NOT INSTALLED: sci-libs/miopengemm
  dev-libs/rccl-4.3.0::gentoo

Other ebuilds:
  media-libs/hsa-amd-aqlprofile-4.3.0::rocm
  dev-libs/amd-dbgapi-4.3.0::rocm
  NOT INSTALLED: dev-util/rcp
  NOT INSTALLED: dev-util/Tensile
  sci-libs/rocPRIM-4.3.0::gentoo -benchmark -test
  NOT INSTALLED: sci-libs/rocSOLVER
  NOT INSTALLED: dev-util/amd-rocm-meta

I intentionally have masks restricting everything to v4.3.0, e.g., ebuilds that do not yet have a v4.3.0 ebuild will not be installed (rocALUTION, hipBLAS, miopengemm, rocSOLVER, Tensile, amd-rocm-meta).

In particular:

preney commented 2 years ago

I would like to update my previous post concerning ROCm v4.3.0...

I still have masks restricting everything to v4.3.0, so ebuilds that do not have a v4.3 ebuild will not be installed (rocALUTION, miopengemm, amd-rocm-meta).

The rocm-smi library in this repository is deprecated in its source Git repo --but in the gentoo repository it is using the proper rocm-smi-lib repo, so one should install rocm-smi from the gentoo repository.

The dev-utils/rcp ebuild in this repository requires USE=static-libs for dev-libs/boost which isn't an available use flag, so it will not install.

Thus, except for rcp, rocALUTION, miopengemm, and amd-rocm-meta, everything for ROCm v4.3.0 can all be installed with nearly all of the packages being installed from the gentoo repo:

OpenCL-related (non-ROCm):
  dev-util/opencl-headers-2022.01.04::gentoo

ROCm Core Components:
  sys-kernel/rocm-sources-4.3.1::rocm -build -symlink
  sys-kernel/rocm-sources-4.3.0-r1::rocm -build -symlink
  dev-libs/rocr-runtime-4.3.0::gentoo
  dev-libs/roct-thunk-interface-4.3.0::gentoo

ROCm Support Software:
  dev-util/rocm-cmake-4.3.0::gentoo
  dev-util/rocminfo-4.3.0::gentoo
  dev-util/rocm-bandwidth-test-4.3.0::rocm

ROCm Support Software:
  dev-util/rocm-smi-4.3.0::gentoo python_targets_python3_10 python_targets_python3_8 python_targets_python3_9

ROCm Compilers:
  sys-devel/llvm-roc-4.3.0-r1::gentoo -debug runtime
  dev-libs/rocclr-4.3.0::gentoo
  dev-util/hip-4.3.0-r2::gentoo -debug -profile
  dev-util/rocm-clang-ocl-4.3.0::gentoo

ROCm Device Libraries:
  dev-libs/rocm-device-libs-4.3.0::gentoo
  dev-libs/rocm-opencl-runtime-4.3.0::gentoo

ROCm Development ToolChain:
  dev-libs/rocm-debug-agent-4.3.0::rocm
  dev-libs/rocm-comgr-4.3.0-r1::gentoo
  dev-util/rocprofiler-4.3.0::rocm -debug
  dev-util/roctracer-4.3.0-r1::gentoo

ROCm Libraries:
  sci-libs/rocBLAS-4.3.0-r1::gentoo -benchmark -doc -test
  sci-libs/hipBLAS-4.3.0::gentoo
  sci-libs/hipCUB-4.3.0::gentoo -benchmark -test
  sci-libs/rocFFT-4.3.0-r1::gentoo -test
  sci-libs/rocRAND-4.3.0::gentoo -benchmark -test
  sci-libs/rocSPARSE-4.3.0-r2::gentoo -benchmark -test
  sci-libs/hipSPARSE-4.3.0::gentoo -test
  sci-libs/rocThrust-4.3.0-r1::gentoo -benchmark -test
  sci-libs/miopen-4.3.0::gentoo -debug -test
  dev-libs/rccl-4.3.0::gentoo
  NOT INSTALLED: sci-libs/rocALUTION
  NOT INSTALLED: sci-libs/miopengemm

Other ebuilds:
  media-libs/hsa-amd-aqlprofile-4.3.0::rocm
  dev-libs/amd-dbgapi-4.3.0::rocm
  dev-util/Tensile-4.3.0::gentoo python_targets_python3_10 python_targets_python3_8 python_targets_python3_9 -test
  sci-libs/rocPRIM-4.3.0-r1::gentoo -benchmark -test
  sci-libs/rocSOLVER-4.3.0::gentoo -benchmark -test
  NOT INSTALLED: dev-util/rcp
  NOT INSTALLED: dev-util/amd-rocm-meta
justxi commented 2 years ago

Nice to hear that almost all ebuilds are available in Gentoo repo. The meta ebuild should be no problem. I think rcp was not updated in the near past. rocALUTION was not always easy to install and needed some more work. For miopengemm you could try to rename the ebuild and check if it works.

preney commented 2 years ago

Renaming the miopengemm ebuild to have a 4.3.0 version does not sufficiently allow things to successfully emerge --there are two issues:

Issue 1) In cmake/FindOpenCL.cmake the following line needs this change:

-find_package_handle_standard_args( OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS )
+find_package_handle_standard_args( OpenCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS )

i.e., notice "OPENCL" becomes "OpenCL" (CMake outputs a warning about and this addresses such); and telling the system to target a specific OpenCL version (which is a compile-time error). I chose to target OpenCL 2.0 but maybe this is not the best thing to naively do from within an ebuild:

add_compile_definitions(CL_TARGET_OPENCL_VERSION=200)

? (This requirement is asserted from within the OpenCL headers, i.e., see /usr/include/CL/cl_version.h.)

Issue 2) The miopengemm/src/enums.cpp is missing a necessary ISO C++ required #include <limits> which allows that code to compile.

The above results in the following patch needed to be applied while emerging:

diff -Naur MIOpenGEMM/cmake/FindOpenCL.cmake MIOpenGEMM.modified/cmake/FindOpenCL.cmake
--- MIOpenGEMM/cmake/FindOpenCL.cmake   2022-03-30 20:16:17.511078264 -0400
+++ MIOpenGEMM.modified/cmake/FindOpenCL.cmake  2022-03-30 20:47:17.727582920 -0400
@@ -52,11 +52,12 @@
 mark_as_advanced( OPENCL_LIBRARIES )

 include( FindPackageHandleStandardArgs )
-find_package_handle_standard_args( OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS )
+find_package_handle_standard_args( OpenCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS )

 set(OpenCL_FOUND ${OPENCL_FOUND} CACHE INTERNAL "")
 set(OpenCL_LIBRARIES ${OPENCL_LIBRARIES} CACHE INTERNAL "")
 set(OpenCL_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS} CACHE INTERNAL "")
+add_compile_definitions(CL_TARGET_OPENCL_VERSION=200)

 if( NOT OPENCL_FOUND )
        message( STATUS "FindOpenCL looked for libraries named: OpenCL" )
diff -Naur MIOpenGEMM/miopengemm/src/enums.cpp MIOpenGEMM.modified/miopengemm/src/enums.cpp
--- MIOpenGEMM/miopengemm/src/enums.cpp 2022-03-30 20:16:17.517744906 -0400
+++ MIOpenGEMM.modified/miopengemm/src/enums.cpp        2022-03-30 20:42:35.858672446 -0400
@@ -5,6 +5,7 @@
 #include <algorithm>
 #include <array>
 #include <iostream>
+#include <limits>
 #include <numeric>
 #include <miopengemm/enums.hpp>
 #include <miopengemm/outputwriter.hpp>

Once this patch is applied, the sci-libs/miopengemm-4.3.0.ebuild emerges. (NOTE: I did no testing of the resulting ebuild.)

I will create a branch and do a pull request later tonight or tomorrow.