summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorSreenivasa Murthy Kolam <sreenivasamurthy.kolam@amd.com>2024-11-05 01:24:48 +0530
committerGitHub <noreply@github.com>2024-11-04 11:54:48 -0800
commit0de6c174774d8fb22a8a5cfbf7b42e7e445ac47c (patch)
treed2dfd99fae1885edd638d065101e348dcbc398f2 /var
parent6924c530e2a619801efcc5b5c29b9fa945876049 (diff)
downloadspack-0de6c174774d8fb22a8a5cfbf7b42e7e445ac47c.tar.gz
spack-0de6c174774d8fb22a8a5cfbf7b42e7e445ac47c.tar.bz2
spack-0de6c174774d8fb22a8a5cfbf7b42e7e445ac47c.tar.xz
spack-0de6c174774d8fb22a8a5cfbf7b42e7e445ac47c.zip
fix the error libroctx64.so.o not found when executing MIOpenDriver (#47196)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/miopen-hip/0001-link-with-roctracer-when-building-miopendriver-6.1.0.patch26
-rw-r--r--var/spack/repos/builtin/packages/miopen-hip/0001-link-with-roctracer-when-building-miopendriver-6.2.0.patch26
-rw-r--r--var/spack/repos/builtin/packages/miopen-hip/0002-add-include-dir-miopen-hip-6.1.0.patch35
-rw-r--r--var/spack/repos/builtin/packages/miopen-hip/package.py13
4 files changed, 59 insertions, 41 deletions
diff --git a/var/spack/repos/builtin/packages/miopen-hip/0001-link-with-roctracer-when-building-miopendriver-6.1.0.patch b/var/spack/repos/builtin/packages/miopen-hip/0001-link-with-roctracer-when-building-miopendriver-6.1.0.patch
new file mode 100644
index 0000000000..c12450b451
--- /dev/null
+++ b/var/spack/repos/builtin/packages/miopen-hip/0001-link-with-roctracer-when-building-miopendriver-6.1.0.patch
@@ -0,0 +1,26 @@
+From bbfc08e034b80d8b8c6895cb74c38544ffa9a9b4 Mon Sep 17 00:00:00 2001
+From: sreenivasa murthy kolam <sreenivasamurthy.kolam@amd.com>
+Date: Thu, 24 Oct 2024 14:01:27 +0000
+Subject: [PATCH] link with roctracer when building miopendriver for 6.1.0
+
+---
+ driver/CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt
+index 7d4fdbb..31de1ba 100644
+--- a/driver/CMakeLists.txt
++++ b/driver/CMakeLists.txt
+@@ -34,6 +34,9 @@ endif()
+ add_dependencies(MIOpenDriver generate_kernels)
+ target_include_directories(MIOpenDriver PRIVATE ../src/kernels)
+ target_link_libraries(MIOpenDriver MIOpen Threads::Threads)
++if(MIOPEN_USE_ROCTRACER)
++ target_link_libraries(MIOpenDriver ${rocTracer})
++endif()
+ if(NOT MIOPEN_EMBED_DB STREQUAL "")
+ target_link_libraries(MIOpenDriver $<BUILD_INTERFACE:miopen_data> )
+ endif()
+--
+2.39.3
+
diff --git a/var/spack/repos/builtin/packages/miopen-hip/0001-link-with-roctracer-when-building-miopendriver-6.2.0.patch b/var/spack/repos/builtin/packages/miopen-hip/0001-link-with-roctracer-when-building-miopendriver-6.2.0.patch
new file mode 100644
index 0000000000..fd8a3bb88c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/miopen-hip/0001-link-with-roctracer-when-building-miopendriver-6.2.0.patch
@@ -0,0 +1,26 @@
+From 5565f0bf0a8e7b8217ed1a943a4210fec303ec42 Mon Sep 17 00:00:00 2001
+From: sreenivasa murthy kolam <sreenivasamurthy.kolam@amd.com>
+Date: Thu, 24 Oct 2024 13:55:01 +0000
+Subject: [PATCH] link with roctracer when building miopendriver
+
+---
+ driver/CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt
+index 8f19a90..6c701d6 100644
+--- a/driver/CMakeLists.txt
++++ b/driver/CMakeLists.txt
+@@ -64,6 +64,9 @@ endif()
+ add_dependencies(MIOpenDriver generate_kernels)
+ target_include_directories(MIOpenDriver PRIVATE ../src/kernels)
+ target_link_libraries(MIOpenDriver MIOpen Threads::Threads roc::rocrand)
++if(MIOPEN_USE_ROCTRACER)
++ target_link_libraries(MIOpenDriver ${rocTracer})
++endif()
+ if(NOT MIOPEN_EMBED_DB STREQUAL "")
+ target_link_libraries(MIOpenDriver $<BUILD_INTERFACE:miopen_data> )
+ endif()
+--
+2.39.3
+
diff --git a/var/spack/repos/builtin/packages/miopen-hip/0002-add-include-dir-miopen-hip-6.1.0.patch b/var/spack/repos/builtin/packages/miopen-hip/0002-add-include-dir-miopen-hip-6.1.0.patch
deleted file mode 100644
index 44e68e401c..0000000000
--- a/var/spack/repos/builtin/packages/miopen-hip/0002-add-include-dir-miopen-hip-6.1.0.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 1693afd9690b97fcceff09ffce765712e3c7361a Mon Sep 17 00:00:00 2001
-From: Renjith Ravindran <Renjith.RavindranKannath@amd.com>
-Date: Mon, 29 Apr 2024 08:01:47 +0000
-Subject: [PATCH] Adding roctracer-dev include and library path
-
----
- src/CMakeLists.txt | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index 0741a60..84b6805 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -739,6 +739,9 @@ if(WIN32)
- endif()
-
- target_include_directories(MIOpen SYSTEM PUBLIC $<BUILD_INTERFACE:${HALF_INCLUDE_DIR}>)
-+target_include_directories(MIOpen SYSTEM PUBLIC "${NLOHMANN_JSON_INCLUDE}")
-+target_include_directories(MIOpen SYSTEM PUBLIC "${ROCTRACER_INCLUDE_DIR}")
-+target_include_directories(MIOpen SYSTEM PUBLIC "${SQLITE_INCLUDE_DIR}")
- # Workaround : change in rocm-cmake was causing linking error so had to add ${CMAKE_DL_LIBS}
- # We can remove ${CMAKE_DL_LIBS} once root cause is identified.
- target_link_libraries(MIOpen PRIVATE ${CMAKE_DL_LIBS} Threads::Threads BZip2::BZip2 ${MIOPEN_CK_LINK_FLAGS})
-@@ -861,7 +864,7 @@ if(NOT WIN32 AND NOT APPLE)
- endif()
-
- if(MIOPEN_USE_ROCTRACER)
-- target_link_libraries(MIOpen PRIVATE roctx64)
-+ target_link_libraries(MIOpen PRIVATE "${ROCTRACER_LIB_DIR}/libroctx64.so")
- endif()
-
- ############################################################
---
-2.31.1
-
diff --git a/var/spack/repos/builtin/packages/miopen-hip/package.py b/var/spack/repos/builtin/packages/miopen-hip/package.py
index 73c7d08c6c..c9544379f4 100644
--- a/var/spack/repos/builtin/packages/miopen-hip/package.py
+++ b/var/spack/repos/builtin/packages/miopen-hip/package.py
@@ -63,7 +63,8 @@ class MiopenHip(CMakePackage):
patch("miopen-hip-include-nlohmann-include-directory.patch", when="@5.4.0:5.7")
patch("0002-add-include-dir-miopen-hip-6.0.0.patch", when="@6.0")
- patch("0002-add-include-dir-miopen-hip-6.1.0.patch", when="@6.1")
+ patch("0001-link-with-roctracer-when-building-miopendriver-6.1.0.patch", when="@6.1")
+ patch("0001-link-with-roctracer-when-building-miopendriver-6.2.0.patch", when="@6.2:")
patch(
"https://github.com/ROCm/MIOpen/commit/f60aa1ff89f8fb596b4a6a4c70aa7d557803db87.patch?full_index=1",
sha256="7f382c872d89f22da1ad499e85ffe9881cc7404c8465e42877a210a09382e2ea",
@@ -135,7 +136,7 @@ class MiopenHip(CMakePackage):
depends_on("nlohmann-json", type="link")
depends_on(f"rocmlir@{ver}", when=f"@{ver}")
for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1"]:
- depends_on("roctracer-dev@" + ver, when="@" + ver)
+ depends_on(f"roctracer-dev@{ver}", when=f"@{ver}")
for ver in ["6.1.0", "6.1.1", "6.1.2"]:
depends_on("googletest")
for ver in ["6.2.0", "6.2.1"]:
@@ -200,19 +201,19 @@ class MiopenHip(CMakePackage):
args.append(self.define("MIOPEN_USE_MLIR", "OFF"))
if self.spec.satisfies("@5.7.0:"):
args.append(self.define("MIOPEN_ENABLE_AI_IMMED_MODE_FALLBACK", "OFF"))
- if self.spec.satisfies("@6:6.1"):
+ if self.spec.satisfies("@6.0"):
args.append(
"-DROCTRACER_INCLUDE_DIR={0}".format(self.spec["roctracer-dev"].prefix.include)
)
args.append("-DROCTRACER_LIB_DIR={0}".format(self.spec["roctracer-dev"].prefix.lib))
- if self.spec.satisfies("@6.1"):
args.append("-DSQLITE_INCLUDE_DIR={0}".format(self.spec["sqlite"].prefix.include))
- if self.spec.satisfies("@6.2:"):
+ if self.spec.satisfies("@6.1:"):
+ args.append(self.define("MIOPEN_USE_ROCTRACER", "ON"))
args.append(
self.define(
"CMAKE_CXX_FLAGS",
f"-I{self.spec['roctracer-dev'].prefix.include} "
- f"-L{self.spec['roctracer-dev'].prefix.lib} "
+ f"-L{self.spec['roctracer-dev'].prefix.roctracer.lib} "
f"-I{self.spec['nlohmann-json'].prefix.include} "
f"-I{self.spec['sqlite'].prefix.include} ",
)