push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,89 @@
diff --git a/rocm_smi-backward-compat.cmake b/rocm_smi-backward-compat.cmake
index aa8fd9c..59afce5 100644
--- a/rocm_smi-backward-compat.cmake
+++ b/rocm_smi-backward-compat.cmake
@@ -72,7 +72,12 @@ function(generate_wrapper_header)
set(include_guard "${include_guard}COMGR_WRAPPER_INCLUDE_${INC_GAURD_NAME}_H")
#set #include statement
get_filename_component(file_name ${header_file} NAME)
- set(include_statements "${include_statements}#include \"../../../${CMAKE_INSTALL_INCLUDEDIR}/${ROCM_SMI}/${file_name}\"\n")
+ if(IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR})
+ set(include_dir "${CMAKE_INSTALL_INCLUDEDIR}")
+ else()
+ set(include_dir "../../../${CMAKE_INSTALL_INCLUDEDIR}")
+ endif()
+ set(include_statements "${include_statements}#include \"${include_dir}/${ROCM_SMI}/${file_name}\"\n")
configure_file(${RSMI_WRAPPER_DIR}/header.hpp.in ${RSMI_WRAPPER_INC_DIR}/${file_name})
unset(include_guard)
unset(include_statements)
@@ -90,7 +95,12 @@ function(generate_wrapper_header)
set(include_guard "${include_guard}COMGR_WRAPPER_INCLUDE_${INC_GAURD_NAME}_H")
#set #include statement
get_filename_component(file_name ${header_file} NAME)
- set(include_statements "${include_statements}#include \"../../../${CMAKE_INSTALL_INCLUDEDIR}/${OAM_TARGET_NAME}/${file_name}\"\n")
+ if(IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR})
+ set(include_dir "${CMAKE_INSTALL_INCLUDEDIR}")
+ else()
+ set(include_dir "../../../${CMAKE_INSTALL_INCLUDEDIR}")
+ endif()
+ set(include_statements "${include_statements}#include \"${include_dir}/${OAM_TARGET_NAME}/${file_name}\"\n")
configure_file(${RSMI_WRAPPER_DIR}/header.hpp.in ${OAM_WRAPPER_INC_DIR}/${file_name})
unset(include_guard)
unset(include_statements)
@@ -123,11 +133,16 @@ function(create_library_symlink)
set(library_files "${LIB_RSMI}")
endif()
+ if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
+ set(install_libdir "${CMAKE_INSTALL_LIBDIR}")
+ else()
+ set(install_libdir "../../${CMAKE_INSTALL_LIBDIR}")
+ endif()
foreach(file_name ${library_files})
add_custom_target(link_${file_name} ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E create_symlink
- ../../${CMAKE_INSTALL_LIBDIR}/${file_name} ${RSMI_WRAPPER_LIB_DIR}/${file_name})
+ ${install_libdir}/${file_name} ${RSMI_WRAPPER_LIB_DIR}/${file_name})
endforeach()
file(MAKE_DIRECTORY ${OAM_WRAPPER_LIB_DIR})
@@ -151,11 +166,16 @@ function(create_library_symlink)
set(library_files "${LIB_OAM}")
endif()
+ if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
+ set(install_libdir "${CMAKE_INSTALL_LIBDIR}")
+ else()
+ set(install_libdir "../../${CMAKE_INSTALL_LIBDIR}")
+ endif()
foreach(file_name ${library_files})
add_custom_target(link_${file_name} ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E create_symlink
- ../../${CMAKE_INSTALL_LIBDIR}/${file_name} ${OAM_WRAPPER_LIB_DIR}/${file_name})
+ ${install_libdir}/${file_name} ${OAM_WRAPPER_LIB_DIR}/${file_name})
endforeach()
endfunction()
diff --git a/rocm_smi/CMakeLists.txt b/rocm_smi/CMakeLists.txt
index c594eeb..d3ed39d 100755
--- a/rocm_smi/CMakeLists.txt
+++ b/rocm_smi/CMakeLists.txt
@@ -105,10 +105,15 @@ endif ()
#file reorganization changes
#rocm_smi.py moved to libexec/rocm_smi. so creating rocm-smi symlink
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
+if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBEXECDIR})
+ set(install_libexecdir "${CMAKE_INSTALL_LIBEXECDIR}")
+else()
+ set(install_libexecdir "../${CMAKE_INSTALL_LIBEXECDIR}")
+endif()
add_custom_target(link-rocm-smi ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E create_symlink
- ../${CMAKE_INSTALL_LIBEXECDIR}/${ROCM_SMI}/rocm_smi.py ${CMAKE_CURRENT_BINARY_DIR}/bin/rocm-smi)
+ ${install_libexecdir}/${ROCM_SMI}/rocm_smi.py ${CMAKE_CURRENT_BINARY_DIR}/bin/rocm-smi)
## Add the install directives for the runtime library.
install(TARGETS ${ROCM_SMI_TARGET}

View File

@@ -0,0 +1,75 @@
{
lib,
stdenv,
fetchFromGitHub,
rocmUpdateScript,
pkg-config,
libdrm,
cmake,
wrapPython,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "rocm-smi";
version = "6.4.3";
src = fetchFromGitHub {
owner = "ROCm";
repo = "rocm_smi_lib";
rev = "rocm-${finalAttrs.version}";
hash = "sha256-yJ3Bf+tM39JWbY+A0NlpHNkvythdAdz6ZVp1AvLcXhk=";
};
patches = [
./cmake.patch
];
propagatedBuildInputs = [
libdrm
];
nativeBuildInputs = [
cmake
wrapPython
pkg-config
];
cmakeFlags = [
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
];
postInstall =
# wrap python programs, but undo two that need to be importable at that path
''
wrapPythonProgramsIn $out
mv $out/libexec/rocm_smi/.rsmiBindingsInit.py-wrapped $out/libexec/rocm_smi/rsmiBindingsInit.py
mv $out/libexec/rocm_smi/.rsmiBindings.py-wrapped $out/libexec/rocm_smi/rsmiBindings.py
''
# workaround: propagate libdrm/ manually
# rocmcxx doesn't automatically add buildInputs to isystem include path like
# wrapper based toolchains, cmake files often don't find_package(rocm-smi) so
# can't rely on cmake propagated interface
# upstream have been shipping libdrm copied into /opt/rocm
+ ''
ln -s ${libdrm.dev}/include/libdrm/ $out/include/
'';
passthru.updateScript = rocmUpdateScript {
name = finalAttrs.pname;
inherit (finalAttrs.src) owner;
inherit (finalAttrs.src) repo;
};
meta = with lib; {
description = "System management interface for AMD GPUs supported by ROCm";
homepage = "https://github.com/ROCm/rocm_smi_lib";
license = with licenses; [ mit ];
maintainers = with maintainers; [ lovesegfault ];
teams = [ teams.rocm ];
platforms = [ "x86_64-linux" ];
};
})