From a8c76c4f546ee465feb2f604cb4fb5d1a721cd2b Mon Sep 17 00:00:00 2001 From: Adel Johar Date: Wed, 6 May 2026 15:23:26 +0200 Subject: [PATCH 1/2] Minor fixes to hipBLASLt and rocDecode samples --- Common/hipblaslt_utils.hpp | 4 ++-- Libraries/hipSPARSELt/spmm/Makefile | 11 ++++++++++- Libraries/hipSPARSELt/spmm_advanced/Makefile | 11 ++++++++++- Libraries/rocDecode/video_decode_batch/main.cpp | 14 +++++++------- Libraries/rocDecode/video_decode_perf/main.cpp | 6 +++--- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/Common/hipblaslt_utils.hpp b/Common/hipblaslt_utils.hpp index c6123e1ba3..5ff49e4504 100644 --- a/Common/hipblaslt_utils.hpp +++ b/Common/hipblaslt_utils.hpp @@ -161,8 +161,8 @@ inline std::size_t real_datatype_size(hipDataType dtype) { // These types were not defined in older versions of ROCm, so need to be handled specially here. auto const dtype_int = static_cast(dtype); - if(dtype_int == HIP_R_4F_E2M1_EXT || dtype_int == HIP_R_6F_E2M3_EXT - || dtype_int == HIP_R_6F_E3M2_EXT) + if(dtype_int == HIP_R_4F_E2M1 || dtype_int == HIP_R_6F_E2M3 + || dtype_int == HIP_R_6F_E3M2) { return 1; } diff --git a/Libraries/hipSPARSELt/spmm/Makefile b/Libraries/hipSPARSELt/spmm/Makefile index 8468d831e7..b320fa9353 100644 --- a/Libraries/hipSPARSELt/spmm/Makefile +++ b/Libraries/hipSPARSELt/spmm/Makefile @@ -24,6 +24,10 @@ EXAMPLE := hipsparselt_spmm COMMON_INCLUDE_DIR := ../../../Common GPU_RUNTIME ?= HIP +# Supported GPU architectures for hipSPARSELt +SUPPORTED_HIP_ARCHITECTURES := gfx942 gfx950 +include $(COMMON_INCLUDE_DIR)/filter_hip_architectures.mk + # HIP variables ROCM_PATH ?= /opt/rocm CUDA_INSTALL_DIR ?= /usr/local/cuda @@ -58,8 +62,13 @@ ICPPFLAGS += $(CPPFLAGS) ILDFLAGS += $(LDFLAGS) ILDLIBS += $(LDLIBS) +ifeq ($(SKIP_BUILD),1) +$(EXAMPLE): + @echo "Skipping $(EXAMPLE): no supported architectures" +else $(EXAMPLE): main.cpp $(COMMON_INCLUDE_DIR)/example_utils.hpp $(COMMON_INCLUDE_DIR)/hipsparselt_utils.hpp - $(COMPILER) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS) + $(COMPILER) $(ICXXFLAGS) $(ICPPFLAGS) $(OFFLOAD_ARCH_FLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS) +endif test: $(EXAMPLE) ./$(EXAMPLE) $(TEST_ARGS) diff --git a/Libraries/hipSPARSELt/spmm_advanced/Makefile b/Libraries/hipSPARSELt/spmm_advanced/Makefile index 9f5fd43f62..99638dd9c9 100644 --- a/Libraries/hipSPARSELt/spmm_advanced/Makefile +++ b/Libraries/hipSPARSELt/spmm_advanced/Makefile @@ -24,6 +24,10 @@ EXAMPLE := hipsparselt_spmm_advanced COMMON_INCLUDE_DIR := ../../../Common GPU_RUNTIME ?= HIP +# Supported GPU architectures for hipSPARSELt +SUPPORTED_HIP_ARCHITECTURES := gfx942 gfx950 +include $(COMMON_INCLUDE_DIR)/filter_hip_architectures.mk + # HIP variables ROCM_PATH ?= /opt/rocm CUDA_INSTALL_DIR ?= /usr/local/cuda @@ -58,8 +62,13 @@ ICPPFLAGS += $(CPPFLAGS) ILDFLAGS += $(LDFLAGS) ILDLIBS += $(LDLIBS) +ifeq ($(SKIP_BUILD),1) +$(EXAMPLE): + @echo "Skipping $(EXAMPLE): no supported architectures" +else $(EXAMPLE): main.cpp $(COMMON_INCLUDE_DIR)/example_utils.hpp $(COMMON_INCLUDE_DIR)/hipsparselt_utils.hpp - $(COMPILER) $(ICXXFLAGS) $(ICPPFLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS) + $(COMPILER) $(ICXXFLAGS) $(ICPPFLAGS) $(OFFLOAD_ARCH_FLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS) +endif test: $(EXAMPLE) ./$(EXAMPLE) $(TEST_ARGS) diff --git a/Libraries/rocDecode/video_decode_batch/main.cpp b/Libraries/rocDecode/video_decode_batch/main.cpp index ad7ad97c6b..66691f7de2 100644 --- a/Libraries/rocDecode/video_decode_batch/main.cpp +++ b/Libraries/rocDecode/video_decode_batch/main.cpp @@ -272,15 +272,15 @@ int main(int argc, char** argv) } if(num_devices < 1) { - ROCDEC_ERR("ERROR: didn't find any GPU!"); + std::cerr << "ERROR: didn't find any GPU!" << std::endl; return -1; } hip_status = hipGetDeviceProperties(&hip_dev_prop, device_id); if(hip_status != hipSuccess) { - ROCDEC_ERR("ERROR: hipGetDeviceProperties for device (" + TOSTR(device_id) - + " ) failed! (" + hipGetErrorName(hip_status) + ")"); + std::cerr << "ERROR: hipGetDeviceProperties for device (" + std::to_string(device_id) + + " ) failed! (" + hipGetErrorName(hip_status) + ")" << std::endl; return -1; } @@ -419,7 +419,7 @@ int main(int argc, char** argv) } else { - ROCDEC_ERR("ERROR: codec type is not supported!"); + std::cerr << "ERROR: codec type is not supported!" << std::endl; return -1; } } @@ -463,7 +463,7 @@ int main(int argc, char** argv) } else { - ROCDEC_ERR("ERROR: codec type is not supported!"); + std::cerr << "ERROR: codec type is not supported!" << std::endl; return -1; } } @@ -570,7 +570,7 @@ int main(int argc, char** argv) } else { - ROCDEC_ERR("ERROR: codec type is not supported!"); + std::cerr << "ERROR: codec type is not supported!" << std::endl; return -1; } } @@ -631,7 +631,7 @@ int main(int argc, char** argv) } else { - ROCDEC_ERR("ERROR: codec type is not supported!"); + std::cerr << "ERROR: codec type is not supported!" << std::endl; return -1; } } diff --git a/Libraries/rocDecode/video_decode_perf/main.cpp b/Libraries/rocDecode/video_decode_perf/main.cpp index e2b595621b..becf48bff9 100644 --- a/Libraries/rocDecode/video_decode_perf/main.cpp +++ b/Libraries/rocDecode/video_decode_perf/main.cpp @@ -159,15 +159,15 @@ int main(int argc, char** argv) if(num_devices < 1) { - ROCDEC_ERR("ERROR: didn't find any GPU!"); + std::cerr << "ERROR: didn't find any GPU!" << std::endl; return -1; } hip_status = hipGetDeviceProperties(&hip_dev_prop, device_id); if(hip_status != hipSuccess) { - ROCDEC_ERR("ERROR: hipGetDeviceProperties for device (" + TOSTR(device_id) - + " ) failed! (" + hipGetErrorName(hip_status) + ")"); + std::cerr << "ERROR: hipGetDeviceProperties for device (" + std::to_string(device_id) + + " ) failed! (" + hipGetErrorName(hip_status) + ")" << std::endl; return -1; } From 79e8dc22ec6c4aa0d34dbaa5104b0b4f7432b695 Mon Sep 17 00:00:00 2001 From: Adel Johar Date: Wed, 6 May 2026 16:28:52 +0200 Subject: [PATCH 2/2] Fixes to CI workflows --- .../workflows/build-rocm-examples-reusable.yml | 17 ++++++++++++++++- .github/workflows/build_applications_vs.yml | 17 ++++++++++------- .github/workflows/build_hip_basic_vs.yml | 17 ++++++++++------- .../workflows/build_hip_documentation_vs.yml | 17 ++++++++++------- .github/workflows/build_libraries_vs.yml | 17 ++++++++++------- .github/workflows/build_portable_sln.yml | 15 +++++++++------ .../workflows/build_programming_guide_vs.yml | 17 ++++++++++------- Common/find_filesystem.mk | 8 ++++++-- Libraries/hipSPARSELt/spmm/Makefile | 5 +++++ Libraries/hipSPARSELt/spmm_advanced/Makefile | 5 +++++ Libraries/rocDecode/video_decode/Makefile | 2 +- Libraries/rocDecode/video_decode_batch/Makefile | 2 +- Libraries/rocDecode/video_decode_mem/Makefile | 2 +- .../rocDecode/video_decode_multi_files/Makefile | 2 +- Libraries/rocDecode/video_decode_perf/Makefile | 2 +- .../rocDecode/video_decode_pic_files/Makefile | 2 +- Libraries/rocDecode/video_decode_rgb/Makefile | 2 +- Libraries/rocDecode/video_to_sequence/Makefile | 2 +- 18 files changed, 99 insertions(+), 52 deletions(-) diff --git a/.github/workflows/build-rocm-examples-reusable.yml b/.github/workflows/build-rocm-examples-reusable.yml index 73aebc88da..0db20e8c39 100644 --- a/.github/workflows/build-rocm-examples-reusable.yml +++ b/.github/workflows/build-rocm-examples-reusable.yml @@ -80,7 +80,7 @@ jobs: if: ${{ matrix.install_method == 'tarball' }} id: install-tarball run: | - LATEST_TARBALL=$(curl -s https://rocm.nightlies.amd.com/tarball/ \ + LATEST_TARBALL=$(curl -s -H "Cache-Control: no-cache" -H "Pragma: no-cache" https://rocm.nightlies.amd.com/tarball/ \ | grep -oE "therock-dist-linux-${{ matrix.gpu_config.therock_family }}-[0-9]+\.[0-9]+\.\w+\.tar\.gz" \ | sort -V \ | tail -1) @@ -107,6 +107,21 @@ jobs: echo "ENABLE_OPENMP=ON" >> $GITHUB_ENV echo "HIPCC_COMPILE_FLAGS_APPEND=--offload-arch=${{ matrix.gpu_config.gpu_target }}" >> $GITHUB_ENV + - name: Upgrade elfutils (SLES) + if: ${{ startsWith(inputs.distro, 'sles') && matrix.install_method == 'tarball' }} + run: | + zypper -qni install -y bzip2 m4 zlib-devel + wget https://sourceware.org/elfutils/ftp/0.186/elfutils-0.186.tar.bz2 + tar -xjf elfutils-0.186.tar.bz2 + cd elfutils-0.186 + ./configure --disable-debuginfod --disable-libdebuginfod + make -j$(nproc) + make install + ldconfig + cd .. + rm -rf elfutils-0.186* + echo "LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV + - name: Makefile build run: | ./Scripts/configure.sh --rocm-path="${ROCM_PATH}" diff --git a/.github/workflows/build_applications_vs.yml b/.github/workflows/build_applications_vs.yml index 442933b7f0..47bd329622 100644 --- a/.github/workflows/build_applications_vs.yml +++ b/.github/workflows/build_applications_vs.yml @@ -19,8 +19,6 @@ concurrency: cancel-in-progress: true env: - PLATFORM_TOOLSET_VERSION: 6.4 - HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ HIPSDK_INSTALLER_VERSION: 25.Q3 GLFW_DIR: C:\glfw-3.4.bin.WIN64\ @@ -30,7 +28,7 @@ jobs: strategy: matrix: config: [Debug, Release] - runs-on: windows-latest + runs-on: windows-2022 defaults: run: shell: pwsh @@ -58,14 +56,19 @@ jobs: Start-Process HIPSDK.exe -ArgumentList '-install','-log',"$((Get-Location).Path)\installer_log.txt" -NoNewWindow -Wait Write-Host "Installer log:" Get-Content "installer_log.txt" - if (Test-Path -Path "${{ env.HIP_PATH }}") { - Write-Host "HIP_PATH directory exists: ${{ env.HIP_PATH }}" + $hip_path = [System.Environment]::GetEnvironmentVariable('HIP_PATH', 'Machine') + if (Test-Path -Path "$hip_path") { + Write-Host "HIP_PATH directory exists: $hip_path" Write-Host "HIP SDK installed successfully" } else { - Write-Host "HIP_PATH directory DOES NOT exist: ${{ env.HIP_PATH }}" + Write-Host "HIP_PATH directory DOES NOT exist: $hip_path" Write-Host "HIP SDK installation failed" Exit 1 } + $version = (Split-Path $hip_path -Leaf) + Write-Host "Detected HIP SDK version: $version" + echo "HIP_PATH=$hip_path" >> $env:GITHUB_ENV + echo "PLATFORM_TOOLSET_VERSION=$version" >> $env:GITHUB_ENV - name: Build ${{ matrix.config }} x64 run: | Write-Host "Replace toolset $((Get-ChildItem -Recurse -File | Get-Content | Select-String -Pattern 'HIP clang .\..' | Select-Object -First 1).Matches.Value) with HIP clang ${{ env.PLATFORM_TOOLSET_VERSION }}" @@ -74,4 +77,4 @@ jobs: } msbuild Scripts\VisualStudio\build.proj -maxCpuCount -detailedSummary -property:"Category=Applications;Configuration=${{ matrix.config }};Platform=x64" Write-Host "msbuild returned: $LastExitCode" - Exit $LastExitCode \ No newline at end of file + Exit $LastExitCode diff --git a/.github/workflows/build_hip_basic_vs.yml b/.github/workflows/build_hip_basic_vs.yml index cdb007f431..d092afc112 100644 --- a/.github/workflows/build_hip_basic_vs.yml +++ b/.github/workflows/build_hip_basic_vs.yml @@ -19,8 +19,6 @@ concurrency: cancel-in-progress: true env: - PLATFORM_TOOLSET_VERSION: 6.4 - HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ HIPSDK_INSTALLER_VERSION: 25.Q3 VULKAN_SDK: C:\VulkanSDK\1.4.313.2\ GLFW_DIR: C:\glfw-3.4.bin.WIN64\ @@ -31,7 +29,7 @@ jobs: strategy: matrix: config: [Debug, Release] - runs-on: windows-latest + runs-on: windows-2022 defaults: run: shell: pwsh @@ -63,14 +61,19 @@ jobs: Start-Process HIPSDK.exe -ArgumentList '-install','-log',"$((Get-Location).Path)\installer_log.txt" -NoNewWindow -Wait Write-Host "Installer log:" Get-Content "installer_log.txt" - if (Test-Path -Path "${{ env.HIP_PATH }}") { - Write-Host "HIP_PATH directory exists: ${{ env.HIP_PATH }}" + $hip_path = [System.Environment]::GetEnvironmentVariable('HIP_PATH', 'Machine') + if (Test-Path -Path "$hip_path") { + Write-Host "HIP_PATH directory exists: $hip_path" Write-Host "HIP SDK installed successfully" } else { - Write-Host "HIP_PATH directory DOES NOT exist: ${{ env.HIP_PATH }}" + Write-Host "HIP_PATH directory DOES NOT exist: $hip_path" Write-Host "HIP SDK installation failed" Exit 1 } + $version = (Split-Path $hip_path -Leaf) + Write-Host "Detected HIP SDK version: $version" + echo "HIP_PATH=$hip_path" >> $env:GITHUB_ENV + echo "PLATFORM_TOOLSET_VERSION=$version" >> $env:GITHUB_ENV - name: Apply patch run: | Write-Host "Applying patches $(Get-ChildItem -File Scripts\VisualStudio\*.patch)" @@ -85,4 +88,4 @@ jobs: } msbuild Scripts\VisualStudio\build.proj -maxCpuCount -detailedSummary -property:"Category=HIP-Basic;Configuration=${{ matrix.config }};Platform=x64" Write-Host "msbuild returned: $LastExitCode" - Exit $LastExitCode \ No newline at end of file + Exit $LastExitCode diff --git a/.github/workflows/build_hip_documentation_vs.yml b/.github/workflows/build_hip_documentation_vs.yml index da8447b6a8..e0fcdc8863 100644 --- a/.github/workflows/build_hip_documentation_vs.yml +++ b/.github/workflows/build_hip_documentation_vs.yml @@ -19,8 +19,6 @@ concurrency: cancel-in-progress: true env: - PLATFORM_TOOLSET_VERSION: 6.4 - HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ HIPSDK_INSTALLER_VERSION: 25.Q3 VULKAN_SDK: C:\VulkanSDK\1.4.313.2\ GLFW_DIR: C:\glfw-3.4.bin.WIN64\ @@ -31,7 +29,7 @@ jobs: strategy: matrix: config: [Debug, Release] - runs-on: windows-latest + runs-on: windows-2022 defaults: run: shell: pwsh @@ -63,14 +61,19 @@ jobs: Start-Process HIPSDK.exe -ArgumentList '-install','-log',"$((Get-Location).Path)\installer_log.txt" -NoNewWindow -Wait Write-Host "Installer log:" Get-Content "installer_log.txt" - if (Test-Path -Path "${{ env.HIP_PATH }}") { - Write-Host "HIP_PATH directory exists: ${{ env.HIP_PATH }}" + $hip_path = [System.Environment]::GetEnvironmentVariable('HIP_PATH', 'Machine') + if (Test-Path -Path "$hip_path") { + Write-Host "HIP_PATH directory exists: $hip_path" Write-Host "HIP SDK installed successfully" } else { - Write-Host "HIP_PATH directory DOES NOT exist: ${{ env.HIP_PATH }}" + Write-Host "HIP_PATH directory DOES NOT exist: $hip_path" Write-Host "HIP SDK installation failed" Exit 1 } + $version = (Split-Path $hip_path -Leaf) + Write-Host "Detected HIP SDK version: $version" + echo "HIP_PATH=$hip_path" >> $env:GITHUB_ENV + echo "PLATFORM_TOOLSET_VERSION=$version" >> $env:GITHUB_ENV - name: Build ${{ matrix.config }} x64 run: | Write-Host "Replace toolset $((Get-ChildItem -Recurse -File | Get-Content | Select-String -Pattern 'HIP clang .\..' | Select-Object -First 1).Matches.Value) with HIP clang ${{ env.PLATFORM_TOOLSET_VERSION }}" @@ -79,4 +82,4 @@ jobs: } msbuild Scripts\VisualStudio\build.proj -maxCpuCount -detailedSummary -property:"Category=HIP-Doc;Configuration=${{ matrix.config }};Platform=x64" Write-Host "msbuild returned: $LastExitCode" - Exit $LastExitCode \ No newline at end of file + Exit $LastExitCode diff --git a/.github/workflows/build_libraries_vs.yml b/.github/workflows/build_libraries_vs.yml index 232d574567..e296918b0a 100644 --- a/.github/workflows/build_libraries_vs.yml +++ b/.github/workflows/build_libraries_vs.yml @@ -19,8 +19,6 @@ concurrency: cancel-in-progress: true env: - PLATFORM_TOOLSET_VERSION: 6.4 - HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ HIPSDK_INSTALLER_VERSION: 25.Q3 jobs: @@ -30,7 +28,7 @@ jobs: matrix: config: [Debug, Release] vsversion: [2017, 2019, 2022] - runs-on: windows-latest + runs-on: windows-2022 defaults: run: shell: pwsh @@ -52,14 +50,19 @@ jobs: Start-Process HIPSDK.exe -ArgumentList '-install','-log',"$((Get-Location).Path)\installer_log.txt" -NoNewWindow -Wait Write-Host "Installer log:" Get-Content "installer_log.txt" - if (Test-Path -Path "${{ env.HIP_PATH }}") { - Write-Host "HIP_PATH directory exists: ${{ env.HIP_PATH }}" + $hip_path = [System.Environment]::GetEnvironmentVariable('HIP_PATH', 'Machine') + if (Test-Path -Path "$hip_path") { + Write-Host "HIP_PATH directory exists: $hip_path" Write-Host "HIP SDK installed successfully" } else { - Write-Host "HIP_PATH directory DOES NOT exist: ${{ env.HIP_PATH }}" + Write-Host "HIP_PATH directory DOES NOT exist: $hip_path" Write-Host "HIP SDK installation failed" Exit 1 } + $version = (Split-Path $hip_path -Leaf) + Write-Host "Detected HIP SDK version: $version" + echo "HIP_PATH=$hip_path" >> $env:GITHUB_ENV + echo "PLATFORM_TOOLSET_VERSION=$version" >> $env:GITHUB_ENV - name: Apply patch run: | Write-Host "Applying patches $(Get-ChildItem -File Scripts\VisualStudio\0002-Revert-Rename-hipblas-dll-for-HIP-SDK-7.1.patch)" @@ -74,4 +77,4 @@ jobs: } msbuild Scripts\VisualStudio\build.proj -maxCpuCount -detailedSummary -property:"Category=Libraries;Configuration=${{ matrix.config }};Platform=x64;VSVersion=${{ matrix.vsversion }}" -target:"Build" Write-Host "msbuild returned: $LastExitCode" - Exit $LastExitCode \ No newline at end of file + Exit $LastExitCode diff --git a/.github/workflows/build_portable_sln.yml b/.github/workflows/build_portable_sln.yml index ee9774231d..9fed56478f 100644 --- a/.github/workflows/build_portable_sln.yml +++ b/.github/workflows/build_portable_sln.yml @@ -27,8 +27,6 @@ concurrency: cancel-in-progress: true env: - PLATFORM_TOOLSET_VERSION: 6.4 - HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ HIPSDK_INSTALLER_VERSION: 25.Q3 CUDA_VERSION: 12.8.1 CUDA_INSTALLER_VERSION: 572.61 @@ -42,7 +40,7 @@ jobs: strategy: matrix: config: [Debug, Release] - runs-on: windows-2025 + runs-on: windows-2022 defaults: run: shell: pwsh @@ -89,14 +87,19 @@ jobs: Start-Process HIPSDK.exe -ArgumentList '-install','-log',"$((Get-Location).Path)\installer_log.txt" -NoNewWindow -Wait Write-Host "Installer log:" Get-Content "installer_log.txt" - if (Test-Path -Path "${{ env.HIP_PATH }}") { - Write-Host "HIP_PATH directory exists: ${{ env.HIP_PATH }}" + $hip_path = [System.Environment]::GetEnvironmentVariable('HIP_PATH', 'Machine') + if (Test-Path -Path "$hip_path") { + Write-Host "HIP_PATH directory exists: $hip_path" Write-Host "HIP SDK installed successfully" } else { - Write-Host "HIP_PATH directory DOES NOT exist: ${{ env.HIP_PATH }}" + Write-Host "HIP_PATH directory DOES NOT exist: $hip_path" Write-Host "HIP SDK installation failed" Exit 1 } + $version = (Split-Path $hip_path -Leaf) + Write-Host "Detected HIP SDK version: $version" + echo "HIP_PATH=$hip_path" >> $env:GITHUB_ENV + echo "PLATFORM_TOOLSET_VERSION=$version" >> $env:GITHUB_ENV - name: Apply patch run: | Write-Host "Applying patches $(Get-ChildItem -File Scripts\VisualStudio\*.patch)" diff --git a/.github/workflows/build_programming_guide_vs.yml b/.github/workflows/build_programming_guide_vs.yml index 79a7dfb199..22e41ecef8 100644 --- a/.github/workflows/build_programming_guide_vs.yml +++ b/.github/workflows/build_programming_guide_vs.yml @@ -19,8 +19,6 @@ concurrency: cancel-in-progress: true env: - PLATFORM_TOOLSET_VERSION: 6.4 - HIP_PATH: C:\Program Files\AMD\ROCm\6.4\ HIPSDK_INSTALLER_VERSION: 25.Q3 VULKAN_SDK: C:\VulkanSDK\1.4.313.2\ GLFW_DIR: C:\glfw-3.4.bin.WIN64\ @@ -31,7 +29,7 @@ jobs: strategy: matrix: config: [Debug, Release] - runs-on: windows-latest + runs-on: windows-2022 defaults: run: shell: pwsh @@ -53,14 +51,19 @@ jobs: Start-Process HIPSDK.exe -ArgumentList '-install','-log',"$((Get-Location).Path)\installer_log.txt" -NoNewWindow -Wait Write-Host "Installer log:" Get-Content "installer_log.txt" - if (Test-Path -Path "${{ env.HIP_PATH }}") { - Write-Host "HIP_PATH directory exists: ${{ env.HIP_PATH }}" + $hip_path = [System.Environment]::GetEnvironmentVariable('HIP_PATH', 'Machine') + if (Test-Path -Path "$hip_path") { + Write-Host "HIP_PATH directory exists: $hip_path" Write-Host "HIP SDK installed successfully" } else { - Write-Host "HIP_PATH directory DOES NOT exist: ${{ env.HIP_PATH }}" + Write-Host "HIP_PATH directory DOES NOT exist: $hip_path" Write-Host "HIP SDK installation failed" Exit 1 } + $version = (Split-Path $hip_path -Leaf) + Write-Host "Detected HIP SDK version: $version" + echo "HIP_PATH=$hip_path" >> $env:GITHUB_ENV + echo "PLATFORM_TOOLSET_VERSION=$version" >> $env:GITHUB_ENV - name: Build ${{ matrix.config }} x64 run: | Write-Host "Replace toolset $((Get-ChildItem -Recurse -File | Get-Content | Select-String -Pattern 'HIP clang .\..' | Select-Object -First 1).Matches.Value) with HIP clang ${{ env.PLATFORM_TOOLSET_VERSION }}" @@ -69,4 +72,4 @@ jobs: } msbuild Scripts\VisualStudio\build.proj -maxCpuCount -detailedSummary -property:"Category=Programming-Guide;Configuration=${{ matrix.config }};Platform=x64" Write-Host "msbuild returned: $LastExitCode" - Exit $LastExitCode \ No newline at end of file + Exit $LastExitCode diff --git a/Common/find_filesystem.mk b/Common/find_filesystem.mk index 005b24c67c..32686d89f0 100644 --- a/Common/find_filesystem.mk +++ b/Common/find_filesystem.mk @@ -34,9 +34,13 @@ # Output variable: # CXX_FS_LIB - either "-lstdc++fs" or empty. -_FS_OK_BARE := $(shell { echo '#include '; echo 'int main(){std::experimental::filesystem::path p; return 0;}'; } | $${CXX:-c++} -x c++ -std=c++17 - -o /dev/null 2>/dev/null && echo 1 || echo 0) +# GNU Make 4.2 treats '#' as a comment even inside $(shell), hiding the +# closing ')' from the parser. Expand it via a variable instead. +_FS_HASH := \# + +_FS_OK_BARE := $(shell { echo '$(_FS_HASH)include '; echo 'int main(){return std::experimental::filesystem::current_path().empty();}'; } | $${CXX:-c++} -x c++ -std=c++17 - -o /dev/null 2>/dev/null && echo 1 || echo 0) ifeq ($(_FS_OK_BARE),0) - _FS_OK_WITH_LIB := $(shell { echo '#include '; echo 'int main(){std::experimental::filesystem::path p; return 0;}'; } | $${CXX:-c++} -x c++ -std=c++17 - -lstdc++fs -o /dev/null 2>/dev/null && echo 1 || echo 0) + _FS_OK_WITH_LIB := $(shell { echo '$(_FS_HASH)include '; echo 'int main(){return std::experimental::filesystem::current_path().empty();}'; } | $${CXX:-c++} -x c++ -std=c++17 - -lstdc++fs -o /dev/null 2>/dev/null && echo 1 || echo 0) ifeq ($(_FS_OK_WITH_LIB),1) CXX_FS_LIB := -lstdc++fs endif diff --git a/Libraries/hipSPARSELt/spmm/Makefile b/Libraries/hipSPARSELt/spmm/Makefile index b320fa9353..98c803b679 100644 --- a/Libraries/hipSPARSELt/spmm/Makefile +++ b/Libraries/hipSPARSELt/spmm/Makefile @@ -70,8 +70,13 @@ $(EXAMPLE): main.cpp $(COMMON_INCLUDE_DIR)/example_utils.hpp $(COMMON_INCLUDE_DI $(COMPILER) $(ICXXFLAGS) $(ICPPFLAGS) $(OFFLOAD_ARCH_FLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS) endif +ifeq ($(SKIP_BUILD),1) +test: + @echo "Skipping $(EXAMPLE) test: no supported architectures" +else test: $(EXAMPLE) ./$(EXAMPLE) $(TEST_ARGS) +endif clean: $(RM) $(EXAMPLE) diff --git a/Libraries/hipSPARSELt/spmm_advanced/Makefile b/Libraries/hipSPARSELt/spmm_advanced/Makefile index 99638dd9c9..b4eee67c57 100644 --- a/Libraries/hipSPARSELt/spmm_advanced/Makefile +++ b/Libraries/hipSPARSELt/spmm_advanced/Makefile @@ -70,8 +70,13 @@ $(EXAMPLE): main.cpp $(COMMON_INCLUDE_DIR)/example_utils.hpp $(COMMON_INCLUDE_DI $(COMPILER) $(ICXXFLAGS) $(ICPPFLAGS) $(OFFLOAD_ARCH_FLAGS) $(ILDFLAGS) -o $@ $< $(ILDLIBS) endif +ifeq ($(SKIP_BUILD),1) +test: + @echo "Skipping $(EXAMPLE) test: no supported architectures" +else test: $(EXAMPLE) ./$(EXAMPLE) $(TEST_ARGS) +endif clean: $(RM) $(EXAMPLE) diff --git a/Libraries/rocDecode/video_decode/Makefile b/Libraries/rocDecode/video_decode/Makefile index 74c6dea129..1d1021c11c 100644 --- a/Libraries/rocDecode/video_decode/Makefile +++ b/Libraries/rocDecode/video_decode/Makefile @@ -53,7 +53,7 @@ CXX_STD := c++17 ICXXFLAGS := -std=$(CXX_STD) ICPPFLAGS := -isystem $(ROCDECODE_INCLUDE_DIR) -I $(COMMON_INCLUDE_DIR) -I $(EXTERNAL_DIR) -I .. -I $(UTILS_DIR) -I $(UTILS_DIR)/rocvideodecode ILDFLAGS := -L $(ROCM_PATH)/lib -ILDLIBS := -lrocdecode -lrocprofiler-register -lavcodec -lavformat -lavutil -lpthread $(CXX_FS_LIB) +ILDLIBS := -lrocdecode -lrocprofiler-register $(FFMPEG_LIBS) -lpthread $(CXX_FS_LIB) ifeq ($(GPU_RUNTIME), HIP) CXXFLAGS ?= -Wall -Wextra CPPFLAGS += -D__HIP_PLATFORM_AMD__ diff --git a/Libraries/rocDecode/video_decode_batch/Makefile b/Libraries/rocDecode/video_decode_batch/Makefile index 8a48dabe66..a57c822c66 100644 --- a/Libraries/rocDecode/video_decode_batch/Makefile +++ b/Libraries/rocDecode/video_decode_batch/Makefile @@ -46,7 +46,7 @@ CXX_STD := c++17 ICXXFLAGS := -std=$(CXX_STD) ICPPFLAGS := -isystem $(ROCDECODE_INCLUDE_DIR) -I $(COMMON_INCLUDE_DIR) -I $(EXTERNAL_DIR) -I $(UTILS_DIR) -I $(UTILS_DIR)/rocvideodecode ILDFLAGS := -L $(ROCM_PATH)/lib -ILDLIBS := -lrocdecode -lrocprofiler-register -lavcodec -lavformat -lavutil -lpthread $(CXX_FS_LIB) +ILDLIBS := -lrocdecode -lrocprofiler-register $(FFMPEG_LIBS) -lpthread $(CXX_FS_LIB) ifeq ($(GPU_RUNTIME), HIP) CXXFLAGS ?= -Wall -Wextra diff --git a/Libraries/rocDecode/video_decode_mem/Makefile b/Libraries/rocDecode/video_decode_mem/Makefile index f26c7051d2..2fdab0f0a0 100644 --- a/Libraries/rocDecode/video_decode_mem/Makefile +++ b/Libraries/rocDecode/video_decode_mem/Makefile @@ -46,7 +46,7 @@ CXX_STD := c++17 ICXXFLAGS := -std=$(CXX_STD) ICPPFLAGS := -isystem $(ROCDECODE_INCLUDE_DIR) -I $(COMMON_INCLUDE_DIR) -I $(EXTERNAL_DIR) -I $(UTILS_DIR) -I $(UTILS_DIR)/rocvideodecode ILDFLAGS := -L $(ROCM_PATH)/lib -ILDLIBS := -lrocdecode -lavcodec -lavformat -lavutil $(CXX_FS_LIB) +ILDLIBS := -lrocdecode $(FFMPEG_LIBS) $(CXX_FS_LIB) ifeq ($(GPU_RUNTIME), HIP) CXXFLAGS ?= -Wall -Wextra CPPFLAGS += -D__HIP_PLATFORM_AMD__ diff --git a/Libraries/rocDecode/video_decode_multi_files/Makefile b/Libraries/rocDecode/video_decode_multi_files/Makefile index 87e56c1c1c..0d058e26e4 100644 --- a/Libraries/rocDecode/video_decode_multi_files/Makefile +++ b/Libraries/rocDecode/video_decode_multi_files/Makefile @@ -46,7 +46,7 @@ CXX_STD := c++17 ICXXFLAGS := -std=$(CXX_STD) ICPPFLAGS := -isystem $(ROCDECODE_INCLUDE_DIR) -I $(COMMON_INCLUDE_DIR) -I $(EXTERNAL_DIR) -I $(UTILS_DIR) -I $(UTILS_DIR)/rocvideodecode ILDFLAGS := -L $(ROCM_PATH)/lib -ILDLIBS := -lrocdecode -lavcodec -lavformat -lavutil $(CXX_FS_LIB) +ILDLIBS := -lrocdecode $(FFMPEG_LIBS) $(CXX_FS_LIB) ifeq ($(GPU_RUNTIME), HIP) CXXFLAGS ?= -Wall -Wextra CPPFLAGS += -D__HIP_PLATFORM_AMD__ diff --git a/Libraries/rocDecode/video_decode_perf/Makefile b/Libraries/rocDecode/video_decode_perf/Makefile index 8922655d84..08e567191e 100644 --- a/Libraries/rocDecode/video_decode_perf/Makefile +++ b/Libraries/rocDecode/video_decode_perf/Makefile @@ -53,7 +53,7 @@ CXX_STD := c++17 ICXXFLAGS := -std=$(CXX_STD) ICPPFLAGS := -isystem $(ROCDECODE_INCLUDE_DIR) -I $(COMMON_INCLUDE_DIR) -I $(EXTERNAL_DIR) -I $(UTILS_DIR) -I $(UTILS_DIR)/rocvideodecode ILDFLAGS := -L $(ROCM_PATH)/lib -ILDLIBS := -lrocdecode -lavcodec -lavformat -lavutil -lpthread $(CXX_FS_LIB) +ILDLIBS := -lrocdecode $(FFMPEG_LIBS) -lpthread $(CXX_FS_LIB) ifeq ($(GPU_RUNTIME), HIP) CXXFLAGS ?= -Wall -Wextra CPPFLAGS += -D__HIP_PLATFORM_AMD__ diff --git a/Libraries/rocDecode/video_decode_pic_files/Makefile b/Libraries/rocDecode/video_decode_pic_files/Makefile index 6cebddd050..fcdb243004 100644 --- a/Libraries/rocDecode/video_decode_pic_files/Makefile +++ b/Libraries/rocDecode/video_decode_pic_files/Makefile @@ -53,7 +53,7 @@ CXX_STD := c++17 ICXXFLAGS := -std=$(CXX_STD) ICPPFLAGS := -isystem $(ROCDECODE_INCLUDE_DIR) -I $(COMMON_INCLUDE_DIR) -I $(EXTERNAL_DIR) -I $(UTILS_DIR) -I $(UTILS_DIR)/rocvideodecode ILDFLAGS := -L $(ROCM_PATH)/lib -ILDLIBS := -lrocdecode -lavcodec -lavformat -lavutil $(CXX_FS_LIB) +ILDLIBS := -lrocdecode $(FFMPEG_LIBS) $(CXX_FS_LIB) ifeq ($(GPU_RUNTIME), HIP) CXXFLAGS ?= -Wall -Wextra CPPFLAGS += -D__HIP_PLATFORM_AMD__ diff --git a/Libraries/rocDecode/video_decode_rgb/Makefile b/Libraries/rocDecode/video_decode_rgb/Makefile index b08c64696e..01085a18be 100644 --- a/Libraries/rocDecode/video_decode_rgb/Makefile +++ b/Libraries/rocDecode/video_decode_rgb/Makefile @@ -46,7 +46,7 @@ CXX_STD := c++17 ICXXFLAGS := -std=$(CXX_STD) ICPPFLAGS := -isystem $(ROCDECODE_INCLUDE_DIR) -I $(COMMON_INCLUDE_DIR) -I $(EXTERNAL_DIR) -I $(UTILS_DIR) -I $(UTILS_DIR)/rocvideodecode ILDFLAGS := -L $(ROCM_PATH)/lib -ILDLIBS := -lrocdecode -lavcodec -lavformat -lavutil -lswresample -lpthread $(CXX_FS_LIB) +ILDLIBS := -lrocdecode $(FFMPEG_LIBS) -lpthread $(CXX_FS_LIB) ifeq ($(GPU_RUNTIME), HIP) CXXFLAGS ?= -Wall -Wextra CPPFLAGS += -D__HIP_PLATFORM_AMD__ diff --git a/Libraries/rocDecode/video_to_sequence/Makefile b/Libraries/rocDecode/video_to_sequence/Makefile index 2e98d24ce4..c9b3d86b59 100644 --- a/Libraries/rocDecode/video_to_sequence/Makefile +++ b/Libraries/rocDecode/video_to_sequence/Makefile @@ -46,7 +46,7 @@ CXX_STD := c++17 ICXXFLAGS := -std=$(CXX_STD) ICPPFLAGS := -isystem $(ROCDECODE_INCLUDE_DIR) -I $(COMMON_INCLUDE_DIR) -I $(EXTERNAL_DIR) -I $(UTILS_DIR) -I $(UTILS_DIR)/rocvideodecode ILDFLAGS := -L $(ROCM_PATH)/lib -ILDLIBS := -lrocdecode -lavcodec -lavformat -lavutil -lswresample -lpthread $(CXX_FS_LIB) +ILDLIBS := -lrocdecode $(FFMPEG_LIBS) -lpthread $(CXX_FS_LIB) ifeq ($(GPU_RUNTIME), HIP) CXXFLAGS ?= -Wall -Wextra CPPFLAGS += -D__HIP_PLATFORM_AMD__