Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ LAYERVERSION_meta-python-ai = "1"
LAYERSERIES_COMPAT_meta-python-ai = "nanbield"

LAYERDEPENDS_meta-python-ai = "core openembedded-layer meta-python"

# This is for setvars.sh in Intel DPCPP compiler
HOSTTOOLS += "ps"
29 changes: 12 additions & 17 deletions recipes-python/pytorch/python3-pytorch_2.3.1.bb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ DEPENDS = " \
"

DEPENDS:append:class-target = " \
zstd-native intel-oneapi-mkl intel-oneapi-dpcpp-cpp \
onednn tbb glog gloo numactl opencv \
opencl-headers virtual/opencl-icd \
zstd-native glog gloo numactl \
chipstar-native chipstar virtual/opencl-icd \
shaderc spirv-tools mesa vulkan-headers vulkan-loader \
python3-numpy python3-typing-extensions python3-pyyaml \
python3-pybind11 python3-pytorch-native \
Expand Down Expand Up @@ -230,9 +229,6 @@ BUILD_CFLAGS += " \
-Wno-error=uninitialized \
"

LDFLAGS:append:class-target = " -ldnnl"
BUILD_LDFLAGS:append:class-target = " -ldnnl"

# Leave these variables below un-indented.
# The contents of EXTRA_OECMAKE is split in python code,
# which expects a single space between pieces.
Expand All @@ -249,12 +245,8 @@ EXTRA_OECMAKE = "\
-DPYTHON_LIBRARY=${STAGING_DIR}/${libdir}/${PYTHON_DIR} \
-DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} \
-DGLIBCXX_USE_CXX11_ABI=1 \
-DBLAS=MKL \
-DUSE_MKLDNN=ON \
-DUSE_MKLDNN_CBLAS=ON \
-DBUILD_ONEDNN_GRAPH=ON \
-DUSE_ITT=OFF \
-DUSE_CUDA=OFF \
-DUSE_CUDA=ON \
-DUSE_FFMPEG=OFF \
-DBUILD_CAFFE2=ON \
-DBUILD_CAFFE2_OPS=ON \
Expand All @@ -263,11 +255,10 @@ EXTRA_OECMAKE = "\
-DUSE_SYSTEM_SLEEF=ON \
-DUSE_GOLD_LINKER=ON \
-DUSE_TBB=ON \
-DUSE_SYSTEM_TBB=ON \
-DUSE_GFLAGS=ON \
-DUSE_GLOG=ON \
-DUSE_OPENCL=OFF \
-DUSE_OPENCV=ON \
-DUSE_OPENCL=ON \
-DUSE_OPENCV=OFF \
-DUSE_VULKAN=ON \
-DUSE_VULKAN_FP16_INFERENCE=ON \
-DUSE_VULKAN_RELAXED_PRECISION=ON \
Expand Down Expand Up @@ -296,6 +287,12 @@ EXTRA_OECMAKE:class-native = "\

export CMAKE_TOOLCHAIN_FILE="${WORKDIR}/toolchain.cmake"

# For chipStar: Fake CUDA 12.0.0
#CUCC_VERSION_STRING = "12.0.0"
#export CUCC_VERSION_STRING
export STAGING_BINDIR_NATIVE
export STAGING_EXECPREFIXDIR

do_configure () {
export EXTRA_OECMAKE="${EXTRA_OECMAKE}"
setuptools3_legacy_do_configure
Expand Down Expand Up @@ -337,9 +334,7 @@ FILES:${PN} += " \
INSANE_SKIP:${PN} = "dev-so"

RDEPENDS:${PN}:class-target = " \
sleef glslang gflags zstd \
intel-oneapi-mkl intel-oneapi-dpcpp-cpp-runtime \
onednn tbb glog numactl opencv \
sleef glslang gflags zstd glog numactl \
shaderc spirv-tools vulkan-loader \
python3-numpy python3-typing-extensions \
python3-pyyaml python3-pybind11 \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From f744933a68f40ca1fde55b233a9435f5561e1c02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
<[email protected]>
Date: Mon, 17 Jun 2024 14:28:01 +0200
Subject: [PATCH] Build ccompat with native hipcc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream-Status: Inappropriate [Yocto specific]
Signed-off-by: Zoltán Böszörményi <[email protected]>
---
samples/ccompat/CMakeLists.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/samples/ccompat/CMakeLists.txt b/samples/ccompat/CMakeLists.txt
index 2c0e7648..05a478e9 100644
--- a/samples/ccompat/CMakeLists.txt
+++ b/samples/ccompat/CMakeLists.txt
@@ -1,18 +1,18 @@
add_custom_command(
OUTPUT saxpy.o DEPENDS ${CMAKE_SOURCE_DIR}/samples/ccompat/saxpy.hip
- COMMAND ${CMAKE_BINARY_DIR}/bin/hipcc
+ COMMAND hipcc
${CMAKE_SOURCE_DIR}/samples/ccompat/saxpy.hip -c -g -pthread
-I${CMAKE_SOURCE_DIR}/include -I${CMAKE_SOURCE_DIR}/HIP/include)

add_custom_command(
OUTPUT ccompat.o DEPENDS ${CMAKE_SOURCE_DIR}/samples/ccompat/ccompat.c
- COMMAND ${CMAKE_BINARY_DIR}/bin/hipcc
+ COMMAND hipcc
${CMAKE_SOURCE_DIR}/samples/ccompat/ccompat.c -c -g -pthread
-I${CMAKE_SOURCE_DIR}/include -I${CMAKE_SOURCE_DIR}/HIP/include)

add_custom_command(
OUTPUT ccompat DEPENDS ccompat.o saxpy.o
-COMMAND ${CMAKE_BINARY_DIR}/bin/hipcc
+COMMAND hipcc
./ccompat.o ./saxpy.o -o ccompat -g -pthread)

add_custom_target(ccompatBuild ALL
--
2.45.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From f65d4a6be3da2cce6ae1fbb06a473284526376c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
<[email protected]>
Date: Mon, 17 Jun 2024 14:20:48 +0200
Subject: [PATCH] Build hipInfo with native hipcc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream-Status: Inappropriate [Yocto specific]
Signed-off-by: Zoltán Böszörményi <[email protected]>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea989ca2..5514d6ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -395,7 +395,7 @@ endif()
# once hipcc.bin is built, execute hipcc ./samples/hipSample.cpp
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/hipInfo
- COMMAND ${HIPCC_BUILD_PATH}/hipcc ${CMAKE_SOURCE_DIR}/samples/hipInfo/hipInfo.cpp -o ${CMAKE_BINARY_DIR}/hipInfo
+ COMMAND hipcc ${CMAKE_SOURCE_DIR}/samples/hipInfo/hipInfo.cpp -o ${CMAKE_BINARY_DIR}/hipInfo
DEPENDS ${CMAKE_SOURCE_DIR}/samples/hipInfo/hipInfo.cpp hipcc.bin CHIP devicelib_bc
)

--
2.45.2

61 changes: 61 additions & 0 deletions recipes-support/chipstar/chipstar/0001-Eliminate-RPATH.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From d86a6b7c55a024343a206b78163111df508bc760 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
<[email protected]>
Date: Wed, 19 Jun 2024 07:54:25 +0200
Subject: [PATCH] Eliminate RPATH
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Zoltán Böszörményi <[email protected]>
---
CMakeLists.txt | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5514d6ee..481c7485 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -208,7 +208,6 @@ option(CHIP_VERBOSE "Verbose compilation" OFF)
option(CHIP_BUILD_SHARED_LIBS "Build chipStar as a shared library" ON)
option(CHIP_BUILD_DOCS "Build doxygen documentation" OFF)
option(CHIP_LLVM_USE_INTERGRATED_SPIRV "Use LLVM's intergrated SPIR-V backend for emitting device binary instead of SPIR-V translator. Requires LLVM 15" OFF)
-option(CHIP_SET_RPATH "Add CMAKE_INSTALL_PREFIX/lib to the RPATH for chipStar executables" ON)
option(CHIP_ENABLE_UNCOMPILABLE_TESTS "Enable tests which are known to not compile" OFF)
option(CHIP_BUILD_TESTS "Enable build_tests target" ON)
option(CHIP_BUILD_SAMPLES "Build samples" ON)
@@ -506,8 +505,6 @@ set(HIP_OFFLOAD_COMPILE_OPTIONS_BUILD_
-I${CMAKE_SOURCE_DIR}/HIP/include
-I${CMAKE_BINARY_DIR}/include)

-# HIP applications need to link against libCHIP.so; add it to rpath
-#
# -no-hip-rt: Prevents linking amdhip64 library implicitly when doing
# combined compile and link or when the --hip-link is
# present at the link step.
@@ -517,22 +514,14 @@ list(APPEND HIP_OFFLOAD_LINK_OPTIONS_BUILD_
"-L${CMAKE_BINARY_DIR}" "-lCHIP" "-no-hip-rt")

if(OpenCL_LIBRARY)
- target_link_options(CHIP PUBLIC -Wl,-rpath,${OpenCL_DIR})
target_link_directories(CHIP PUBLIC ${OpenCL_DIR})
endif()

if(LevelZero_LIBRARY)
include_directories(CHIP PUBLIC ${LevelZeroInclude_DIR})
- target_link_options(CHIP PUBLIC -Wl,-rpath,${LevelZeroLib_DIR})
target_link_directories(CHIP PUBLIC ${LevelZeroLib_DIR})
endif()

-if(CHIP_SET_RPATH)
- list(APPEND HIP_OFFLOAD_LINK_OPTIONS_INSTALL_ "-Wl,-rpath,${LIB_INSTALL_DIR}")
- list(APPEND HIP_OFFLOAD_LINK_OPTIONS_BUILD_ "-Wl,-rpath,${CMAKE_BINARY_DIR}")
- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-endif()
-
# Workaround istead of trying to generate the CMake generator expression
string(REPLACE ";" " " HIP_OFFLOAD_COMPILE_OPTIONS_INSTALL "${HIP_OFFLOAD_COMPILE_OPTIONS_INSTALL_}")
string(REPLACE ";" " " HIP_OFFLOAD_COMPILE_OPTIONS_BUILD "${HIP_OFFLOAD_COMPILE_OPTIONS_BUILD_}")
--
2.45.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From 449a7530f6e417aa1c845937f50673a2828199b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
<[email protected]>
Date: Mon, 17 Jun 2024 11:12:55 +0200
Subject: [PATCH] Fix executing commands in opencl_bc_lib macro in
cmake/OCL.cmake
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream-Status: Inappropriate [Yocto specific]
Signed-off-by: Zoltán Böszörményi <[email protected]>
---
cmake/OCL.cmake | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/cmake/OCL.cmake b/cmake/OCL.cmake
index 2eaf44e..8fd0a2d 100644
--- a/cmake/OCL.cmake
+++ b/cmake/OCL.cmake
@@ -32,7 +32,7 @@ endif()
# Disable code object version module flag if available.
file(WRITE ${CMAKE_BINARY_DIR}/tmp.cl "")
execute_process (
- COMMAND ${LLVM_TOOLS_BINARY_DIR}/clang${EXE_SUFFIX} ${CLANG_OCL_FLAGS} -Xclang -mcode-object-version=none ${CMAKE_BINARY_DIR}/tmp.cl
+ COMMAND clang${EXE_SUFFIX} ${CLANG_OCL_FLAGS} -Xclang -mcode-object-version=none ${CMAKE_BINARY_DIR}/tmp.cl
RESULT_VARIABLE TEST_CODE_OBJECT_VERSION_NONE_RESULT
ERROR_QUIET
)
@@ -99,7 +99,7 @@ macro(opencl_bc_lib)
if (fext STREQUAL ".cl")
set(output "${CMAKE_CURRENT_BINARY_DIR}/${fname_we}${BC_EXT}")
add_custom_command(OUTPUT "${output}"
- COMMAND ${CLANG_ROOT_PATH_BIN}/clang ${inc_options} ${CLANG_OCL_FLAGS}
+ COMMAND clang ${inc_options} ${CLANG_OCL_FLAGS}
-emit-llvm -Xclang -mlink-builtin-bitcode -Xclang "${irif_lib_output}"
-c "${file}" -o "${output}"
DEPENDS "${file}" "${irif_lib_output}" "${CLANG}"
@@ -130,12 +130,12 @@ macro(opencl_bc_lib)

add_custom_command(OUTPUT ${OUTPUT_BC_LIB}
# Link regular library dependencies
- COMMAND ${CLANG_ROOT_PATH_BIN}/llvm-link
+ COMMAND ${LLVM_LINK}
-o "${OUT_NAME}.link0${LIB_SUFFIX}" "@${OUT_NAME}_response"
# Extra link step with internalize
- COMMAND ${CLANG_ROOT_PATH_BIN}/llvm-link -internalize -only-needed "${name}.link0${LIB_SUFFIX}"
+ COMMAND ${LLVM_LINK} -internalize -only-needed "${name}.link0${LIB_SUFFIX}"
-o "${OUT_NAME}${LIB_SUFFIX}" ${internal_link_libs}
- COMMAND ${CLANG_ROOT_PATH_BIN}/opt -passes=strip
+ COMMAND opt -passes=strip
-o "${OUT_NAME}${STRIP_SUFFIX}" "${OUT_NAME}${LIB_SUFFIX}"
COMMAND "${PREPARE_BUILTINS}"
-o ${OUTPUT_BC_LIB} "${OUT_NAME}${STRIP_SUFFIX}"
--
2.45.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From f8c861eaae683e6d6f9557d3e50217d29ac60682 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
<[email protected]>
Date: Mon, 17 Jun 2024 10:36:21 +0200
Subject: [PATCH] Fix irif/CMakeLists.txt to find llvm-link
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream-Status: Inappropriate [Yocto specific]
Signed-off-by: Zoltán Böszörményi <[email protected]>
---
irif/CMakeLists.txt | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/irif/CMakeLists.txt b/irif/CMakeLists.txt
index a874772..d9e3502 100644
--- a/irif/CMakeLists.txt
+++ b/irif/CMakeLists.txt
@@ -11,12 +11,16 @@ file(GLOB sources

set(irif_lib_file ${CMAKE_CURRENT_BINARY_DIR}/irif.bc)

-# find_program(LLVM_LINK_EXECUTABLE NAMES llvm-link PATHS ${LLVM_CONFIG_DIR} NO_DEFAULT_PATH)
-# if(NOT LLVM_LINK_EXECUTABLE)
-# message(FATAL_ERROR "llvm-link not found")
-# endif()
-# add_executable(llvm-link IMPORTED)
-# set_target_properties(llvm-link PROPERTIES IMPORTED_LOCATION ${LLVM_LINK_EXECUTABLE})
+if(NOT DEFINED LLVM_LINK)
+ find_program(LLVM_LINK NAMES llvm-link NO_DEFAULT_PATH PATHS ${CLANG_ROOT_PATH_BIN} ENV PATH)
+ if(NOT LLVM_LINK)
+ message(FATAL_ERROR "Can't find llvm-link. Please provide CMake argument -D$LLVM_LINK=/path/to/llvm-link<-version>")
+ endif()
+endif()
+message(STATUS "Using llvm-link: ${LLVM_LINK}")
+
+add_executable(llvm-link IMPORTED)
+set_target_properties(llvm-link PROPERTIES IMPORTED_LOCATION ${LLVM_LINK})

add_custom_command(OUTPUT ${irif_lib_file}
COMMAND $<TARGET_FILE:llvm-link> ${sources} -o ${irif_lib_file}
--
2.45.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 81c0ab815785aa884e29aa7b7bc8a599185b4a6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
<[email protected]>
Date: Wed, 19 Jun 2024 07:42:16 +0200
Subject: [PATCH] H4I-HipBLAS: Don't set CMAKE_INSTALL_RPATH
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream-Status: Inappropriate [Yocto specific]
Signed-off-by: Zoltán Böszörményi <[email protected]>
---
CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed479ac..aefcd15 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,6 @@ file(RELATIVE_PATH relRPath
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
)
-set(CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/${relRPath})

# Define a target capturing common configuration settings.
# Although we use 'add_library' for this, it is not a library -
--
2.45.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 81e528767342d17e06851ea8a932cc8c07d991e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
<[email protected]>
Date: Mon, 17 Jun 2024 13:50:00 +0200
Subject: [PATCH] Use TARGET_SYS for offload compiler commands
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream-Status: Inappropriate [Yocto specific]
Signed-off-by: Zoltán Böszörményi <[email protected]>
---
CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 272e759e..ea989ca2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -493,14 +493,14 @@ set(HIP_OFFLOAD_COMPILE_OPTIONS_INSTALL_
${HIP_ENABLE_SPIRV}
${HIP_OFFLOAD_COMPILE_ONLY_OPTIONS_}
--hip-path=${CMAKE_INSTALL_PREFIX}
- ${HOST_ARCH}
+ --target=${TARGET_SYS}
${HIP_FIXUPS_HEADER_INSTALL})

set(HIP_OFFLOAD_COMPILE_OPTIONS_BUILD_
${HIP_ENABLE_SPIRV}
${HIP_OFFLOAD_COMPILE_ONLY_OPTIONS_}
--hip-path=${CMAKE_BINARY_DIR}
- ${HOST_ARCH}
+ --target=${TARGET_SYS}
${HIP_FIXUPS_HEADER_BUILD}
-I${CMAKE_SOURCE_DIR}/include
-I${CMAKE_SOURCE_DIR}/HIP/include
--
2.45.2

Loading