mirror of
https://github.com/ROCm/ROCm.git
synced 2026-01-09 22:58:17 -05:00
Compare commits
36 Commits
docs/6.3.2
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65b8498867 | ||
|
|
937dcb376b | ||
|
|
ac944077ba | ||
|
|
1688d56edc | ||
|
|
042b01a71b | ||
|
|
c26ff9528f | ||
|
|
9baa927218 | ||
|
|
d7136806da | ||
|
|
61ada2eae9 | ||
|
|
9b34984b1b | ||
|
|
20a264a715 | ||
|
|
3750e88066 | ||
|
|
beb5f5b48d | ||
|
|
65330eb26d | ||
|
|
23b90e4e6b | ||
|
|
080c442789 | ||
|
|
5d90797591 | ||
|
|
0417c2196d | ||
|
|
1f2a94bb3a | ||
|
|
9c5c2c9ca1 | ||
|
|
190f609ea2 | ||
|
|
82cf58912c | ||
|
|
c469e34b27 | ||
|
|
b6d19bd91c | ||
|
|
2751a17cf0 | ||
|
|
9b0ae86b1b | ||
|
|
16f7cb4c04 | ||
|
|
de007b6faf | ||
|
|
aa1333269c | ||
|
|
acb8f60304 | ||
|
|
faa67965dd | ||
|
|
7179f2a72f | ||
|
|
0df0f74312 | ||
|
|
f885b5df6e | ||
|
|
ee70cb0bb5 | ||
|
|
d401b5f152 |
@@ -133,6 +133,7 @@ jobs:
|
||||
-DROCM_DIR=$(Agent.BuildDirectory)/rocm \
|
||||
-DLLVM_DIR=$(Agent.BuildDirectory)/rocm/llvm/bin \
|
||||
-DOPENCL_DIR=$(Agent.BuildDirectory)/rocm/llvm/bin
|
||||
-DOPENCL_INC_DIR=$(Agent.BuildDirectory)/rocm/llvm/lib/clang/21/include
|
||||
make
|
||||
make rocrtst_kernels
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/test.yml
|
||||
|
||||
@@ -59,14 +59,10 @@ jobs:
|
||||
value: $(Build.BinariesDirectory)/rocm
|
||||
- name: TENSILE_ROCM_ASSEMBLER_PATH
|
||||
value: $(Agent.BuildDirectory)/rocm/llvm/bin/amdclang
|
||||
- name: CMAKE_CXX_COMPILER
|
||||
value: $(Agent.BuildDirectory)/rocm/bin/hipcc
|
||||
- name: TENSILE_ROCM_OFFLOAD_BUNDLER_PATH
|
||||
value: $(Agent.BuildDirectory)/rocm/llvm/bin/clang-offload-bundler
|
||||
- name: TENSILE_ROCM_PATH
|
||||
value: $(Agent.BuildDirectory)/rocm/bin/hipcc
|
||||
- name: PATH
|
||||
value: $(Agent.BuildDirectory)/rocm/llvm/bin:$(Agent.BuildDirectory)/rocm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
|
||||
- name: ROCM_PATH
|
||||
value: $(Agent.BuildDirectory)/rocm
|
||||
- name: DAY_STRING
|
||||
value: $[format('{0:ddMMyyyy}', pipeline.startTime)]
|
||||
pool: ${{ variables.ULTRA_BUILD_POOL }}
|
||||
@@ -154,9 +150,8 @@ jobs:
|
||||
extraEnvVars:
|
||||
- HIP_ROCCLR_HOME:::/home/user/workspace/rocm
|
||||
- TENSILE_ROCM_ASSEMBLER_PATH:::/home/user/workspace/rocm/llvm/bin/amdclang
|
||||
- CMAKE_CXX_COMPILER:::/home/user/workspace/rocm/bin/hipcc
|
||||
- TENSILE_ROCM_OFFLOAD_BUNDLER_PATH:::/home/user/workspace/rocm/llvm/bin/clang-offload-bundler
|
||||
- TENSILE_ROCM_PATH:::/home/user/workspace/rocm/bin/hipcc
|
||||
- ROCM_PATH:::/home/user/workspace/rocm
|
||||
extraCopyDirectories:
|
||||
- deps
|
||||
|
||||
|
||||
@@ -64,10 +64,10 @@ jobs:
|
||||
value: $(Build.BinariesDirectory)/rocm
|
||||
- name: TENSILE_ROCM_ASSEMBLER_PATH
|
||||
value: $(Agent.BuildDirectory)/rocm/llvm/bin/clang
|
||||
- name: CMAKE_CXX_COMPILER
|
||||
value: $(Agent.BuildDirectory)/rocm/bin/hipcc
|
||||
- name: TENSILE_ROCM_OFFLOAD_BUNDLER_PATH
|
||||
value: $(Agent.BuildDirectory)/rocm/llvm/bin/clang-offload-bundler
|
||||
- name: ROCM_PATH
|
||||
value: $(Agent.BuildDirectory)/rocm
|
||||
pool: ${{ variables.MEDIUM_BUILD_POOL }}
|
||||
workspace:
|
||||
clean: all
|
||||
@@ -96,8 +96,8 @@ jobs:
|
||||
-DCMAKE_TOOLCHAIN_FILE=toolchain-linux.cmake
|
||||
-DCMAKE_PREFIX_PATH=$(Agent.BuildDirectory)/rocm/llvm;$(Agent.BuildDirectory)/rocm
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_CXX_COMPILER=$(Agent.BuildDirectory)/rocm/bin/hipcc
|
||||
-DCMAKE_C_COMPILER=$(Agent.BuildDirectory)/rocm/bin/hipcc
|
||||
-DCMAKE_CXX_COMPILER=$(Agent.BuildDirectory)/rocm/bin/amdclang++
|
||||
-DCMAKE_C_COMPILER=$(Agent.BuildDirectory)/rocm/bin/amdclang
|
||||
-DGPU_TARGETS=$(JOB_GPU_TARGET)
|
||||
-DTensile_CODE_OBJECT_VERSION=default
|
||||
-DTensile_LOGIC=asm_full
|
||||
@@ -125,8 +125,8 @@ jobs:
|
||||
extraEnvVars:
|
||||
- HIP_ROCCLR_HOME:::/home/user/workspace/rocm
|
||||
- TENSILE_ROCM_ASSEMBLER_PATH:::/home/user/workspace/rocm/llvm/bin/clang
|
||||
- CMAKE_CXX_COMPILER:::/home/user/workspace/rocm/bin/hipcc
|
||||
- TENSILE_ROCM_OFFLOAD_BUNDLER_PATH:::/home/user/workspace/rocm/llvm/bin/clang-offload-bundler
|
||||
- ROCM_PATH:::/home/user/workspace/rocm
|
||||
|
||||
- job: rocBLAS_testing
|
||||
dependsOn: rocBLAS
|
||||
|
||||
@@ -49,21 +49,10 @@ jobs:
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
# Since mesa-amdgpu-multimedia-devel is not directly available from apt, register it
|
||||
- task: Bash@3
|
||||
displayName: 'Register ROCm packages'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
sudo mkdir --parents --mode=0755 /etc/apt/keyrings
|
||||
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/${{ variables.KEYRING_VERSION }}/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/amdgpu.list
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${{ variables.KEYRING_VERSION }} jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
|
||||
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
|
||||
sudo apt update
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
|
||||
parameters:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
registerROCmPackages: true
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
||||
parameters:
|
||||
@@ -104,21 +93,10 @@ jobs:
|
||||
JOB_GPU_TARGET: gfx942
|
||||
JOB_TEST_POOL: ${{ variables.GFX942_TEST_POOL }}
|
||||
steps:
|
||||
# Since mesa-amdgpu-multimedia-devel is not directly available from apt, register it
|
||||
- task: Bash@3
|
||||
displayName: 'Register ROCm packages'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
sudo mkdir --parents --mode=0755 /etc/apt/keyrings
|
||||
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/${{ variables.KEYRING_VERSION }}/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/amdgpu.list
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${{ variables.KEYRING_VERSION }} jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
|
||||
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
|
||||
sudo apt update
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
|
||||
parameters:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
registerROCmPackages: true
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/local-artifact-download.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-aqlprofile.yml
|
||||
|
||||
@@ -48,21 +48,10 @@ jobs:
|
||||
gfx942:
|
||||
JOB_GPU_TARGET: gfx942
|
||||
steps:
|
||||
# Since mesa-amdgpu-multimedia-devel is not directly available from apt, register it
|
||||
- task: Bash@3
|
||||
displayName: 'Register ROCm packages'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
sudo mkdir --parents --mode=0755 /etc/apt/keyrings
|
||||
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/${{ variables.KEYRING_VERSION }}/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/amdgpu.list
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${{ variables.KEYRING_VERSION }} jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
|
||||
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
|
||||
sudo apt update
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
|
||||
parameters:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
registerROCmPackages: true
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
||||
parameters:
|
||||
@@ -106,21 +95,10 @@ jobs:
|
||||
JOB_GPU_TARGET: gfx942
|
||||
JOB_TEST_POOL: ${{ variables.GFX942_TEST_POOL }}
|
||||
steps:
|
||||
# Since mesa-amdgpu-multimedia-devel is not directly available from apt, register it
|
||||
- task: Bash@3
|
||||
displayName: 'Register ROCm packages'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
sudo mkdir --parents --mode=0755 /etc/apt/keyrings
|
||||
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/${{ variables.KEYRING_VERSION }}/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/amdgpu.list
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${{ variables.KEYRING_VERSION }} jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
|
||||
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
|
||||
sudo apt update
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
|
||||
parameters:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
registerROCmPackages: true
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/local-artifact-download.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-aqlprofile.yml
|
||||
|
||||
@@ -80,6 +80,7 @@ jobs:
|
||||
-DROCWMMA_BUILD_SAMPLES=OFF
|
||||
-DGPU_TARGETS=$(JOB_GPU_TARGET)
|
||||
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
|
||||
-DROCM_PLATFORM_VERSION=$(NEXT_RELEASE_VERSION)
|
||||
-GNinja
|
||||
# gfx1030 not supported in documentation
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/manifest.yml
|
||||
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
-DCPACK_GENERATOR=DEB
|
||||
-DCPACK_DEBIAN_PACKAGE_RELEASE="local.9999~99.99"
|
||||
-DCPACK_RPM_PACKAGE_RELEASE="local.9999"
|
||||
-DROCM_VERSION="$(next-release)"
|
||||
-DROCM_VERSION="$(NEXT_RELEASE_VERSION)"
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/manifest.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/artifact-upload.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/artifact-links.yml
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
|
||||
parameters:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
registerRadeon: true
|
||||
registerROCmPackages: true
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
||||
parameters:
|
||||
|
||||
@@ -37,6 +37,8 @@ parameters:
|
||||
- clr
|
||||
- llvm-project
|
||||
- rccl
|
||||
- rocDecode
|
||||
- rocJPEG
|
||||
- rocm-cmake
|
||||
- rocm-core
|
||||
- rocminfo
|
||||
@@ -60,7 +62,7 @@ jobs:
|
||||
parameters:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
pipModules: ${{ parameters.pipModules }}
|
||||
registerRadeon: true
|
||||
registerROCmPackages: true
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
||||
parameters:
|
||||
@@ -99,6 +101,7 @@ jobs:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
pipModules: ${{ parameters.pipModules }}
|
||||
gpuTarget: $(JOB_GPU_TARGET)
|
||||
registerROCmPackages: true
|
||||
|
||||
- job: rocprofiler_sdk_testing
|
||||
dependsOn: rocprofiler_sdk
|
||||
@@ -119,7 +122,7 @@ jobs:
|
||||
parameters:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
pipModules: ${{ parameters.pipModules }}
|
||||
registerRadeon: true
|
||||
registerROCmPackages: true
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
||||
parameters:
|
||||
@@ -155,3 +158,4 @@ jobs:
|
||||
pipModules: ${{ parameters.pipModules }}
|
||||
environment: test
|
||||
gpuTarget: $(JOB_GPU_TARGET)
|
||||
registerROCmPackages: true
|
||||
|
||||
@@ -46,17 +46,19 @@ parameters:
|
||||
- name: rocmDependencies
|
||||
type: object
|
||||
default:
|
||||
- amdsmi
|
||||
- aomp
|
||||
- clr
|
||||
- llvm-project
|
||||
- rccl
|
||||
- rocDecode
|
||||
- rocJPEG
|
||||
- rocm-core
|
||||
- rocm_smi_lib
|
||||
- rocminfo
|
||||
- ROCR-Runtime
|
||||
- rocm_smi_lib
|
||||
- rocprofiler-register
|
||||
- rocprofiler-sdk
|
||||
- ROCR-Runtime
|
||||
|
||||
jobs:
|
||||
- job: rocprofiler_systems
|
||||
@@ -75,7 +77,7 @@ jobs:
|
||||
parameters:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
pipModules: ${{ parameters.pipModules }}
|
||||
registerRadeon: true
|
||||
registerROCmPackages: true
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
||||
parameters:
|
||||
@@ -159,7 +161,7 @@ jobs:
|
||||
parameters:
|
||||
aptPackages: ${{ parameters.aptPackages }}
|
||||
pipModules: ${{ parameters.pipModules }}
|
||||
registerRadeon: true
|
||||
registerROCmPackages: true
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
||||
parameters:
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
pool:
|
||||
vmImage: ${{ variables.BASE_BUILD_POOL }}
|
||||
container:
|
||||
image: ${{ variables.DOCKER_IMAGE_NAME }}:${{ variables.LATEST_DOCKER_VERSION }}
|
||||
image: rocm/dev-ubuntu-22.04:${{ variables.LATEST_RELEASE_VERSION }}
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
|
||||
@@ -4,13 +4,13 @@ steps:
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
export packageName=$(curl -s https://repo.radeon.com/rocm/apt/latest/pool/main/h/hsa-amd-aqlprofile/ | grep -oP "href=\"\K[^\"]*$(lsb_release -rs)[^\"]*\.deb")
|
||||
export packageName=$(curl -s https://repo.radeon.com/rocm/apt/$(REPO_RADEON_VERSION)/pool/main/h/hsa-amd-aqlprofile/ | grep -oP "href=\"\K[^\"]*$(lsb_release -rs)[^\"]*\.deb")
|
||||
echo "##vso[task.setvariable variable=packageName;isreadonly=true]$packageName"
|
||||
- task: Bash@3
|
||||
displayName: 'Download aqlprofile'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: wget -nv https://repo.radeon.com/rocm/apt/latest/pool/main/h/hsa-amd-aqlprofile/$(packageName)
|
||||
script: wget -nv https://repo.radeon.com/rocm/apt/$(REPO_RADEON_VERSION)/pool/main/h/hsa-amd-aqlprofile/$(packageName)
|
||||
workingDirectory: '$(Pipeline.Workspace)'
|
||||
- task: Bash@3
|
||||
displayName: 'Extract aqlprofile'
|
||||
|
||||
@@ -6,21 +6,21 @@ parameters:
|
||||
- name: pipModules
|
||||
type: object
|
||||
default: []
|
||||
- name: registerRadeon
|
||||
- name: registerROCmPackages
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
steps:
|
||||
- ${{ if eq(parameters.registerRadeon, true) }}:
|
||||
- ${{ if eq(parameters.registerROCmPackages, true) }}:
|
||||
- task: Bash@3
|
||||
displayName: 'Register repo.radeon packages'
|
||||
displayName: 'Register AMDGPU & ROCm repos'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
sudo mkdir --parents --mode=0755 /etc/apt/keyrings
|
||||
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/latest/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/amdgpu.list
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/latest jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/$(REPO_RADEON_VERSION)/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/amdgpu.list
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/$(REPO_RADEON_VERSION) jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list
|
||||
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600
|
||||
sudo apt update
|
||||
# firefox takes time to upgrade and is not needed for CI workloads, hold version
|
||||
|
||||
@@ -154,8 +154,8 @@ steps:
|
||||
script: |
|
||||
echo "RUN mkdir --parents --mode=0755 /etc/apt/keyrings" >> Dockerfile
|
||||
echo "RUN wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null" >> Dockerfile
|
||||
echo "RUN echo \"deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/latest/ubuntu jammy main\" | tee /etc/apt/sources.list.d/amdgpu.list" >> Dockerfile
|
||||
echo "RUN echo \"deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/latest jammy main\" | tee --append /etc/apt/sources.list.d/rocm.list" >> Dockerfile
|
||||
echo "RUN echo \"deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/$(REPO_RADEON_VERSION)/ubuntu jammy main\" | tee /etc/apt/sources.list.d/amdgpu.list" >> Dockerfile
|
||||
echo "RUN echo \"deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/$(REPO_RADEON_VERSION) jammy main\" | tee --append /etc/apt/sources.list.d/rocm.list" >> Dockerfile
|
||||
echo "RUN printf 'Package: *\\nPin: release o=repo.radeon.com\\nPin-Priority: 600' > /etc/apt/preferences.d/rocm-pin-600" >> Dockerfile
|
||||
echo "RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update" >> Dockerfile
|
||||
- ${{ if eq(parameters.registerCUDAPackages, true) }}:
|
||||
|
||||
@@ -27,14 +27,14 @@ variables:
|
||||
value: rocm-ci_larger_base_disk_pool
|
||||
- name: GFX942_TEST_POOL
|
||||
value: gfx942_test_pool
|
||||
- name: LATEST_RELEASE_VERSION
|
||||
value: 6.3.2
|
||||
- name: REPO_RADEON_VERSION
|
||||
value: 6.3.2
|
||||
- name: NEXT_RELEASE_VERSION
|
||||
value: 6.4.0
|
||||
- name: LATEST_RELEASE_TAG
|
||||
value: rocm-6.1.0
|
||||
- name: DOCKER_IMAGE_NAME
|
||||
value: rocm/dev-ubuntu-22.04
|
||||
- name: LATEST_DOCKER_VERSION
|
||||
value: 6.1
|
||||
- name: KEYRING_VERSION
|
||||
value: 6.3
|
||||
value: rocm-6.3.2
|
||||
- name: AMDMIGRAPHX_GFX942_TEST_PIPELINE_ID
|
||||
value: 197
|
||||
- name: AMDMIGRAPHX_PIPELINE_ID
|
||||
@@ -151,8 +151,6 @@ variables:
|
||||
value: 105
|
||||
- name: HIPTENSOR_TAGGED_PIPELINE_ID
|
||||
value: 56
|
||||
- name: LAST_RELEASE
|
||||
value: 6.1.0
|
||||
- name: LLVM_PROJECT_PIPELINE_ID
|
||||
value: 2
|
||||
- name: LLVM_PROJECT_TAGGED_PIPELINE_ID
|
||||
@@ -183,10 +181,6 @@ variables:
|
||||
value: 100
|
||||
- name: RDC_TAGGED_PIPELINE_ID
|
||||
value: 59
|
||||
- name: REIMAGE_ORG
|
||||
value: AGS-ROCm-CI
|
||||
- name: REIMAGE_REPO
|
||||
value: cirrascale-reimage-automation
|
||||
- name: ROCAL_PIPELINE_ID
|
||||
value: 151
|
||||
- name: ROCALUTION_GFX942_TEST_PIPELINE_ID
|
||||
|
||||
4
.github/workflows/issue_retrieval.yml
vendored
4
.github/workflows/issue_retrieval.yml
vendored
@@ -2,7 +2,7 @@ name: Issue retrieval
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
types: [opened, edited]
|
||||
|
||||
jobs:
|
||||
auto-retrieve:
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
app_id: ${{ secrets.ACTION_APP_ID }}
|
||||
private_key: ${{ secrets.ACTION_PEM }}
|
||||
- name: 'Retrieve Issue'
|
||||
uses: abhimeda/rocm_issue_management@main
|
||||
uses: harkgill-amd/rocm_issue_management@main
|
||||
with:
|
||||
authentication-token: ${{ steps.generate_token.outputs.token }}
|
||||
github-organization: 'ROCm'
|
||||
|
||||
@@ -74,6 +74,7 @@ Conda
|
||||
ConnectX
|
||||
CuPy
|
||||
Dashboarding
|
||||
DBRX
|
||||
DDR
|
||||
DF
|
||||
DGEMM
|
||||
@@ -92,6 +93,7 @@ DataFrame
|
||||
DataLoader
|
||||
DataParallel
|
||||
Debian
|
||||
DeepSeek
|
||||
DeepSpeed
|
||||
Dependabot
|
||||
Deprecations
|
||||
@@ -129,6 +131,7 @@ GDS
|
||||
GEMM
|
||||
GEMMs
|
||||
GFortran
|
||||
Gemma
|
||||
GiB
|
||||
GIM
|
||||
GL
|
||||
|
||||
@@ -29,8 +29,7 @@ The release notes provide a summary of notable changes since the previous ROCm r
|
||||
- [ROCm upcoming changes](#rocm-upcoming-changes)
|
||||
|
||||
```{note}
|
||||
If you’re using Radeon™ PRO or Radeon GPUs in a workstation setting with a
|
||||
display connected, continue to use ROCm 6.2.3. See the [Use ROCm on Radeon GPUs](https://rocm.docs.amd.com/projects/radeon/en/latest/index.html)
|
||||
If you’re using Radeon™ PRO or Radeon GPUs in a workstation setting with a display connected, see the [Use ROCm on Radeon GPUs](https://rocm.docs.amd.com/projects/radeon/en/latest/docs/compatibility/native_linux/native_linux_compatibility.html)
|
||||
documentation to verify compatibility and system requirements.
|
||||
```
|
||||
## Release highlights
|
||||
|
||||
124
default.xml
124
default.xml
@@ -1,76 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<manifest>
|
||||
<remote name="rocm-org" fetch="https://github.com/ROCm/" />
|
||||
<default revision="refs/tags/rocm-6.3.2"
|
||||
<default revision="refs/heads/amd-mainline"
|
||||
remote="rocm-org"
|
||||
sync-c="true"
|
||||
sync-j="4" />
|
||||
<!--list of projects for ROCm-->
|
||||
<project name="ROCK-Kernel-Driver" />
|
||||
<project name="ROCR-Runtime" />
|
||||
<project name="amdsmi" />
|
||||
<project name="rdc" />
|
||||
<project name="rocm_bandwidth_test" />
|
||||
<project name="rocm_smi_lib" />
|
||||
<project name="rocm-core" />
|
||||
<project name="rocm-examples" />
|
||||
<project name="rocminfo" />
|
||||
<project name="rocprofiler" />
|
||||
<project name="rocprofiler-register" />
|
||||
<project name="rocprofiler-sdk" />
|
||||
<project name="rocprofiler-compute" />
|
||||
<project name="rocprofiler-systems" />
|
||||
<project name="roctracer" />
|
||||
<project name="ROCm" revision="refs/heads/main" />
|
||||
<project name="ROCK-Kernel-Driver" revision="refs/heads/master" />
|
||||
<project name="ROCR-Runtime" revision="refs/heads/amd-master"/>
|
||||
<project name="amdsmi" />
|
||||
<project name="rdc" />
|
||||
<project name="rocm_bandwidth_test" revision="refs/heads/master" />
|
||||
<project name="rocm_smi_lib" />
|
||||
<project name="rocm-core" revision="refs/heads/amd-master" />
|
||||
<project name="rocm-examples" revision="refs/heads/develop"/>
|
||||
<project name="rocminfo" revision="refs/heads/amd-master" />
|
||||
<project name="rocprofiler" />
|
||||
<project name="rocprofiler-register" />
|
||||
<project name="rocprofiler-sdk" />
|
||||
<project name="rocprofiler-compute" />
|
||||
<project name="rocprofiler-systems" />
|
||||
<project name="roctracer" />
|
||||
<!--HIP Projects-->
|
||||
<project name="HIP" />
|
||||
<project name="hip-tests" />
|
||||
<project name="HIPIFY" />
|
||||
<project name="clr" />
|
||||
<project name="hipother" />
|
||||
<project name="hip" />
|
||||
<project name="hip-tests" />
|
||||
<project name="HIPIFY" />
|
||||
<project name="clr" />
|
||||
<project name="hipother" />
|
||||
<!-- The following projects are all associated with the AMDGPU LLVM compiler -->
|
||||
<project name="half" />
|
||||
<project name="half" revision="refs/heads/rocm" />
|
||||
<project name="llvm-project" />
|
||||
<project name="SPIRV-LLVM-Translator" path="llvm-project/llvm/projects/SPIRV-LLVM-Translator" />
|
||||
<!-- gdb projects -->
|
||||
<project name="ROCdbgapi" />
|
||||
<project name="ROCgdb" />
|
||||
<project name="ROCdbgapi" />
|
||||
<project name="ROCgdb" revision="refs/heads/amd-mainline-rocgdb-15"/>
|
||||
<project name="rocr_debug_agent" />
|
||||
<!-- ROCm Libraries -->
|
||||
<project groups="mathlibs" name="AMDMIGraphX" />
|
||||
<project groups="mathlibs" name="MIOpen" />
|
||||
<project groups="mathlibs" name="MIVisionX" />
|
||||
<project groups="mathlibs" name="ROCmValidationSuite" />
|
||||
<project groups="mathlibs" name="Tensile" />
|
||||
<project groups="mathlibs" name="composable_kernel" />
|
||||
<project groups="mathlibs" name="hipBLAS-common" />
|
||||
<project groups="mathlibs" name="hipBLAS" />
|
||||
<project groups="mathlibs" name="hipBLASLt" />
|
||||
<project groups="mathlibs" name="hipCUB" />
|
||||
<project groups="mathlibs" name="hipFFT" />
|
||||
<project groups="mathlibs" name="hipRAND" />
|
||||
<project groups="mathlibs" name="hipSOLVER" />
|
||||
<project groups="mathlibs" name="hipSPARSE" />
|
||||
<project groups="mathlibs" name="hipSPARSELt" />
|
||||
<project groups="mathlibs" name="hipTensor" />
|
||||
<project groups="mathlibs" name="hipfort" />
|
||||
<project groups="mathlibs" name="rccl" />
|
||||
<project groups="mathlibs" name="rocAL" />
|
||||
<project groups="mathlibs" name="rocALUTION" />
|
||||
<project groups="mathlibs" name="rocBLAS" />
|
||||
<project groups="mathlibs" name="rocDecode" />
|
||||
<project groups="mathlibs" name="rocJPEG" />
|
||||
<project groups="mathlibs" name="rocPyDecode" />
|
||||
<project groups="mathlibs" name="rocFFT" />
|
||||
<project groups="mathlibs" name="rocPRIM" />
|
||||
<project groups="mathlibs" name="rocRAND" />
|
||||
<project groups="mathlibs" name="rocSOLVER" />
|
||||
<project groups="mathlibs" name="rocSPARSE" />
|
||||
<project groups="mathlibs" name="rocThrust" />
|
||||
<project groups="mathlibs" name="rocWMMA" />
|
||||
<project groups="mathlibs" name="rocm-cmake" />
|
||||
<project groups="mathlibs" name="rpp" />
|
||||
<project groups="mathlibs" name="TransferBench" />
|
||||
<project groups="mathlibs" name="AMDMIGraphX" revision="refs/heads/master" />
|
||||
<project groups="mathlibs" name="MIOpen" revision="refs/heads/amd-master" />
|
||||
<project groups="mathlibs" name="MIVisionX" revision="refs/heads/master" />
|
||||
<project groups="mathlibs" name="ROCmValidationSuite" revision="refs/heads/master" />
|
||||
<project groups="mathlibs" name="Tensile" revision="refs/heads/master" />
|
||||
<project groups="mathlibs" name="composable_kernel" revision="refs/heads/amd-master"/>
|
||||
<project groups="mathlibs" name="hipBLAS-common" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipBLAS" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipBLASLt" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipCUB" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipFFT" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipRAND" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipSOLVER" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipSPARSE" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipSPARSELt" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipTensor" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="hipfort" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rccl" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocAL" revision="refs/heads/master" />
|
||||
<project groups="mathlibs" name="rocALUTION" revision="refs/heads/mainline"/>
|
||||
<project groups="mathlibs" name="rocBLAS" revision="refs/heads/mainline"/>
|
||||
<project groups="mathlibs" name="rocDecode" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocJPEG" revision="refs/heads/mainline"/>
|
||||
<project groups="mathlibs" name="rocPyDecode" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocFFT" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocPRIM" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocRAND" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocSOLVER" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocSPARSE" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocThrust" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocWMMA" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rocm-cmake" revision="refs/heads/mainline" />
|
||||
<project groups="mathlibs" name="rpp" revision="refs/heads/master" />
|
||||
<project groups="mathlibs" name="TransferBench" />
|
||||
<!-- Projects for OpenMP-Extras -->
|
||||
<project name="aomp" path="openmp-extras/aomp" />
|
||||
<project name="aomp-extras" path="openmp-extras/aomp-extras" />
|
||||
<project name="flang" path="openmp-extras/flang" />
|
||||
<project name="aomp" path="openmp-extras/aomp" />
|
||||
<project name="aomp-extras" path="openmp-extras/aomp-extras" />
|
||||
<project name="flang" path="openmp-extras/flang" />
|
||||
</manifest>
|
||||
|
||||
@@ -62,7 +62,7 @@ additional licenses. Please review individual repositories for more information.
|
||||
| [rocJPEG](https://github.com/ROCm/rocJPEG/) | [MIT](https://github.com/ROCm/rocJPEG/blob/develop/LICENSE) |
|
||||
| [ROCK-Kernel-Driver](https://github.com/ROCm/ROCK-Kernel-Driver/) | [GPL 2.0 WITH Linux-syscall-note](https://github.com/ROCm/ROCK-Kernel-Driver/blob/master/COPYING) |
|
||||
| [rocminfo](https://github.com/ROCm/rocminfo/) | [The University of Illinois/NCSA](https://github.com/ROCm/rocminfo/blob/amd-staging/License.txt) |
|
||||
| [ROCm Bandwidth Test](https://github.com/ROCm/rocm_bandwidth_test/) | [The University of Illinois/NCSA](https://github.com/ROCm/rocm_bandwidth_test/blob/master/LICENSE.txt) |
|
||||
| [ROCm Bandwidth Test](https://github.com/ROCm/rocm_bandwidth_test/) | [MIT](https://github.com/ROCm/rocm_bandwidth_test/blob/master/LICENSE.txt) |
|
||||
| [ROCm CMake](https://github.com/ROCm/rocm-cmake/) | [MIT](https://github.com/ROCm/rocm-cmake/blob/develop/LICENSE) |
|
||||
| [ROCm Communication Collectives Library (RCCL)](https://github.com/ROCm/rccl/) | [Custom](https://github.com/ROCm/rccl/blob/develop/LICENSE.txt) |
|
||||
| [ROCm-Core](https://github.com/ROCm/rocm-core) | [MIT](https://github.com/ROCm/rocm-core/blob/master/copyright) |
|
||||
|
||||
@@ -7,7 +7,7 @@ ROCm Version,6.3.2,6.3.1,6.3.0,6.2.4,6.2.2,6.2.1,6.2.0, 6.1.2, 6.1.1, 6.1.0, 6.0
|
||||
,"SLES 15 SP6, SP5","SLES 15 SP6, SP5","SLES 15 SP6, SP5","SLES 15 SP6, SP5","SLES 15 SP6, SP5","SLES 15 SP6, SP5","SLES 15 SP6, SP5","SLES 15 SP5, SP4","SLES 15 SP5, SP4","SLES 15 SP5, SP4","SLES 15 SP5, SP4","SLES 15 SP5, SP4"
|
||||
,,,,,,,,CentOS 7.9,CentOS 7.9,CentOS 7.9,CentOS 7.9,CentOS 7.9
|
||||
,Oracle Linux 8.10 [#mi300x-past-60]_,Oracle Linux 8.10 [#mi300x-past-60]_,Oracle Linux 8.10 [#mi300x-past-60]_,Oracle Linux 8.9 [#mi300x-past-60]_,Oracle Linux 8.9 [#mi300x-past-60]_,Oracle Linux 8.9 [#mi300x-past-60]_,Oracle Linux 8.9 [#mi300x-past-60]_,Oracle Linux 8.9 [#mi300x-past-60]_,Oracle Linux 8.9 [#mi300x-past-60]_,,,
|
||||
,Debian 12 [#mi300x-past-60]_,Debian 12 [#mi300x-past-60]_,,,,,,,,,,
|
||||
,Debian 12 [#single-node-past-60]_,Debian 12 [#single-node-past-60]_,,,,,,,,,,
|
||||
,Azure Linux 3.0 [#mi300x-past-60]_,,,,,,,,,,,
|
||||
,.. _architecture-support-compatibility-matrix-past-60:,,,,,,,,,,,
|
||||
:doc:`Architecture <rocm-install-on-linux:reference/system-requirements>`,CDNA3,CDNA3,CDNA3,CDNA3,CDNA3,CDNA3,CDNA3,CDNA3,CDNA3,CDNA3,CDNA3,CDNA3
|
||||
|
||||
|
@@ -32,7 +32,7 @@ compatibility and system requirements.
|
||||
,RHEL 8.10,RHEL 8.10,"RHEL 8.10, 8.9"
|
||||
,"SLES 15 SP6, SP5","SLES 15 SP6, SP5","SLES 15 SP6, SP5"
|
||||
,Oracle Linux 8.10 [#mi300x]_,Oracle Linux 8.10 [#mi300x]_,Oracle Linux 8.9 [#mi300x]_
|
||||
,Debian 12 [#mi300x]_,Debian 12 [#mi300x]_,
|
||||
,Debian 12 [#single-node]_,Debian 12 [#single-node]_,
|
||||
,Azure Linux 3.0 [#mi300x]_,,
|
||||
,.. _architecture-support-compatibility-matrix:,,
|
||||
:doc:`Architecture <rocm-install-on-linux:reference/system-requirements>`,CDNA3,CDNA3,CDNA3
|
||||
@@ -148,7 +148,8 @@ compatibility and system requirements.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [#mi300x] Oracle Linux, Debian, and Azure Linux are supported only on AMD Instinct MI300X.
|
||||
.. [#mi300x] Oracle Linux and Azure Linux are supported only on AMD Instinct MI300X.
|
||||
.. [#single-node] Debian 12 is supported only on AMD Instinct MI300X for single-node functionality.
|
||||
.. [#mi300_620] **For ROCm 6.2.0** - MI300X (gfx942) is supported on listed operating systems *except* Ubuntu 22.04.5 [6.8 HWE] and Ubuntu 22.04.4 [6.5 HWE].
|
||||
.. [#kfd_support] ROCm provides forward and backward compatibility between the AMD Kernel-mode GPU Driver (KMD) and its user space software for +/- 2 releases. These are the compatibility combinations that are currently supported.
|
||||
.. [#ROCT-rocr] Starting from ROCm 6.3.0, the ROCT Thunk Interface is included as part of the ROCr runtime package.
|
||||
@@ -215,7 +216,8 @@ Expand for full historical view of:
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [#mi300x-past-60] Oracle Linux, Debian, and Azure Linux are supported only on AMD Instinct MI300X.
|
||||
.. [#mi300x-past-60] Oracle Linux and Azure Linux are supported only on AMD Instinct MI300X.
|
||||
.. [#single-node-past-60] Debian 12 is supported only on AMD Instinct MI300X for single-node functionality.
|
||||
.. [#mi300_624-past-60] **For ROCm 6.2.4** - MI300X (gfx942) is supported on listed operating systems *except* Ubuntu 22.04.5 [6.8 HWE] and Ubuntu 22.04.4 [6.5 HWE].
|
||||
.. [#mi300_622-past-60] **For ROCm 6.2.2** - MI300X (gfx942) is supported on listed operating systems *except* Ubuntu 22.04.5 [6.8 HWE] and Ubuntu 22.04.4 [6.5 HWE].
|
||||
.. [#mi300_621-past-60] **For ROCm 6.2.1** - MI300X (gfx942) is supported on listed operating systems *except* Ubuntu 22.04.5 [6.8 HWE] and Ubuntu 22.04.4 [6.5 HWE].
|
||||
|
||||
@@ -16,6 +16,9 @@ Throughout the following topics, this guide discusses the goals and :ref:`challe
|
||||
model <fine-tuning-llms-concept-challenge>` like Llama 2. In the
|
||||
sections that follow, you'll find practical guides on libraries and tools to accelerate your fine-tuning.
|
||||
|
||||
The AI Developer Hub contains `AMD ROCm tutorials <https://rocm.docs.amd.com/projects/ai-developer-hub/en/latest/>`_ for
|
||||
training, fine-tuning, and inference. It leverages popular machine learning frameworks on AMD GPUs.
|
||||
|
||||
- :doc:`Conceptual overview of fine-tuning LLMs <overview>`
|
||||
|
||||
- :doc:`Fine-tuning and inference <fine-tuning-and-inference>` using a
|
||||
|
||||
@@ -12,6 +12,9 @@ You can use ROCm to perform distributed training, which enables you to train mod
|
||||
|
||||
Overall, ROCm can be used to improve the performance and efficiency of your AI applications. With its training, fine-tuning, and inference support, ROCm provides a complete solution for optimizing AI workflows and achieving the optimum results possible on AMD GPUs.
|
||||
|
||||
The AI Developer Hub contains `AMD ROCm tutorials <https://rocm.docs.amd.com/projects/ai-developer-hub/en/latest/>`_ for
|
||||
training, fine-tuning, and inference. It leverages popular machine learning frameworks on AMD GPUs.
|
||||
|
||||
In this guide, you'll learn how to use ROCm for AI:
|
||||
|
||||
- :doc:`Training <training/index>`
|
||||
|
||||
@@ -277,7 +277,7 @@ Installing FBGEMM_GPU
|
||||
Installing FBGEMM_GPU consists of the following steps:
|
||||
|
||||
* Set up an isolated Miniconda environment
|
||||
* Install ROCm using Docker or the :doc:`package manager <rocm-install-on-linux:install/native-install/index>`
|
||||
* Install ROCm using Docker or the :doc:`package manager <rocm-install-on-linux:install/install-methods/package-manager-index>`
|
||||
* Install the nightly `PyTorch <https://pytorch.org/>`_ build
|
||||
* Complete the pre-build and build tasks
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ Understanding the ROCm™ software platform’s architecture and capabilities is
|
||||
|
||||
Throughout the following topics, this section provides a comprehensive guide to setting up and deploying AI inference on AMD GPUs. This includes instructions on how to install ROCm, how to use Hugging Face Transformers to manage pre-trained models for natural language processing (NLP) tasks, how to validate vLLM on AMD Instinct™ MI300X accelerators and illustrate how to deploy trained models in production environments.
|
||||
|
||||
The AI Developer Hub contains `AMD ROCm tutorials <https://rocm.docs.amd.com/projects/ai-developer-hub/en/latest/>`_ for
|
||||
training, fine-tuning, and inference. It leverages popular machine learning frameworks on AMD GPUs.
|
||||
|
||||
- :doc:`Installing ROCm and machine learning frameworks <install>`
|
||||
|
||||
- :doc:`Running models from Hugging Face <hugging-face-models>`
|
||||
|
||||
@@ -26,7 +26,7 @@ If you’re using a Radeon GPU for graphics-accelerated applications, refer to t
|
||||
|
||||
ROCm supports multiple :doc:`installation methods <rocm-install-on-linux:install/install-overview>`:
|
||||
|
||||
* :doc:`Using your Linux distribution's package manager <rocm-install-on-linux:install/native-install/index>`
|
||||
* :doc:`Using your Linux distribution's package manager <rocm-install-on-linux:install/install-methods/package-manager-index>`
|
||||
|
||||
* :doc:`Using the AMDGPU installer <rocm-install-on-linux:install/amdgpu-install>`
|
||||
|
||||
|
||||
@@ -10,49 +10,22 @@ LLM inference performance validation on AMD Instinct MI300X
|
||||
.. _vllm-benchmark-unified-docker:
|
||||
|
||||
The `ROCm vLLM Docker <https://hub.docker.com/r/rocm/vllm/tags>`_ image offers
|
||||
a prebuilt, optimized environment designed for validating large language model
|
||||
(LLM) inference performance on the AMD Instinct™ MI300X accelerator. This
|
||||
ROCm vLLM Docker image integrates vLLM and PyTorch tailored specifically for the
|
||||
MI300X accelerator and includes the following components:
|
||||
a prebuilt, optimized environment for validating large language model (LLM)
|
||||
inference performance on the AMD Instinct™ MI300X accelerator. This ROCm vLLM
|
||||
Docker image integrates vLLM and PyTorch tailored specifically for the MI300X
|
||||
accelerator and includes the following components:
|
||||
|
||||
* `ROCm 6.2.1 <https://github.com/ROCm/ROCm>`_
|
||||
* `ROCm 6.3.1 <https://github.com/ROCm/ROCm>`_
|
||||
|
||||
* `vLLM 0.6.4 <https://docs.vllm.ai/en/latest>`_
|
||||
* `vLLM 0.6.6 <https://docs.vllm.ai/en/latest>`_
|
||||
|
||||
* `PyTorch 2.5.0 <https://github.com/pytorch/pytorch>`_
|
||||
|
||||
* Tuning files (in CSV format)
|
||||
* `PyTorch 2.7.0 (2.7.0a0+git3a58512) <https://github.com/pytorch/pytorch>`_
|
||||
|
||||
With this Docker image, you can quickly validate the expected inference
|
||||
performance numbers on the MI300X accelerator. This topic also provides tips on
|
||||
optimizing performance with popular AI models.
|
||||
|
||||
.. hlist::
|
||||
:columns: 6
|
||||
|
||||
* Llama 3.1 8B
|
||||
|
||||
* Llama 3.1 70B
|
||||
|
||||
* Llama 3.1 405B
|
||||
|
||||
* Llama 2 7B
|
||||
|
||||
* Llama 2 70B
|
||||
|
||||
* Mixtral 8x7B
|
||||
|
||||
* Mixtral 8x22B
|
||||
|
||||
* Mixtral 7B
|
||||
|
||||
* Qwen2 7B
|
||||
|
||||
* Qwen2 72B
|
||||
|
||||
* JAIS 13B
|
||||
|
||||
* JAIS 30B
|
||||
performance numbers for the MI300X accelerator. This topic also provides tips on
|
||||
optimizing performance with popular AI models. For more information, see the lists of
|
||||
:ref:`available models for MAD-integrated benchmarking <vllm-benchmark-mad-models>`
|
||||
and :ref:`standalone benchmarking <vllm-benchmark-standalone-options>`.
|
||||
|
||||
.. _vllm-benchmark-vllm:
|
||||
|
||||
@@ -91,9 +64,9 @@ MI300X accelerator with the prebuilt vLLM Docker image.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
docker pull rocm/vllm:rocm6.2_mi300_ubuntu20.04_py3.9_vllm_0.6.4
|
||||
docker pull rocm/vllm:rocm6.3.1_mi300_ubuntu22.04_py3.12_vllm_0.6.6
|
||||
|
||||
Once setup is complete, you can choose between two options to reproduce the
|
||||
Once the setup is complete, choose between two options to reproduce the
|
||||
benchmark results:
|
||||
|
||||
- :ref:`MAD-integrated benchmarking <vllm-benchmark-mad>`
|
||||
@@ -130,45 +103,89 @@ Although the following models are preconfigured to collect latency and
|
||||
throughput performance data, you can also change the benchmarking parameters.
|
||||
Refer to the :ref:`Standalone benchmarking <vllm-benchmark-standalone>` section.
|
||||
|
||||
.. _vllm-benchmark-mad-models:
|
||||
|
||||
Available models
|
||||
----------------
|
||||
|
||||
.. hlist::
|
||||
:columns: 3
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 2, 3
|
||||
|
||||
* ``pyt_vllm_llama-3.1-8b``
|
||||
* - Model name
|
||||
- Tag
|
||||
|
||||
* ``pyt_vllm_llama-3.1-70b``
|
||||
* - `Llama 3.1 8B <https://huggingface.co/meta-llama/Llama-3.1-8B>`_
|
||||
- ``pyt_vllm_llama-3.1-8b``
|
||||
|
||||
* ``pyt_vllm_llama-3.1-405b``
|
||||
* - `Llama 3.1 70B <https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct>`_
|
||||
- ``pyt_vllm_llama-3.1-70b``
|
||||
|
||||
* ``pyt_vllm_llama-2-7b``
|
||||
* - `Llama 3.1 405B <https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct>`_
|
||||
- ``pyt_vllm_llama-3.1-405b``
|
||||
|
||||
* ``pyt_vllm_llama-2-70b``
|
||||
* - `Llama 3.2 11B Vision <https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct>`_
|
||||
- ``pyt_vllm_llama-3.2-11b-vision-instruct``
|
||||
|
||||
* ``pyt_vllm_mixtral-8x7b``
|
||||
* - `Llama 2 7B <https://huggingface.co/meta-llama/Llama-2-7b-chat-hf>`_
|
||||
- ``pyt_vllm_llama-2-7b``
|
||||
|
||||
* ``pyt_vllm_mixtral-8x22b``
|
||||
* - `Llama 2 70B <https://huggingface.co/meta-llama/Llama-2-70b-chat-hf>`_
|
||||
- ``pyt_vllm_llama-2-70b``
|
||||
|
||||
* ``pyt_vllm_mistral-7b``
|
||||
* - `Mixtral MoE 8x7B <https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1>`_
|
||||
- ``pyt_vllm_mixtral-8x7b``
|
||||
|
||||
* ``pyt_vllm_qwen2-7b``
|
||||
* - `Mixtral MoE 8x22B <https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1>`_
|
||||
- ``pyt_vllm_mixtral-8x22b``
|
||||
|
||||
* ``pyt_vllm_qwen2-72b``
|
||||
* - `Mistral 7B <https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3>`_
|
||||
- ``pyt_vllm_mistral-7b``
|
||||
|
||||
* ``pyt_vllm_jais-13b``
|
||||
* - `Qwen2 7B <https://huggingface.co/Qwen/Qwen2-7B-Instruct>`_
|
||||
- ``pyt_vllm_qwen2-7b``
|
||||
|
||||
* ``pyt_vllm_jais-30b``
|
||||
* - `Qwen2 72B <https://huggingface.co/Qwen/Qwen2-72B-Instruct>`_
|
||||
- ``pyt_vllm_qwen2-72b``
|
||||
|
||||
* ``pyt_vllm_llama-3.1-8b_fp8``
|
||||
* - `JAIS 13B <https://huggingface.co/core42/jais-13b-chat>`_
|
||||
- ``pyt_vllm_jais-13b``
|
||||
|
||||
* ``pyt_vllm_llama-3.1-70b_fp8``
|
||||
* - `JAIS 30B <https://huggingface.co/core42/jais-30b-chat-v3>`_
|
||||
- ``pyt_vllm_jais-30b``
|
||||
|
||||
* ``pyt_vllm_llama-3.1-405b_fp8``
|
||||
* - `DBRX Instruct <https://huggingface.co/databricks/dbrx-instruct>`_
|
||||
- ``pyt_vllm_dbrx-instruct``
|
||||
|
||||
* ``pyt_vllm_mixtral-8x7b_fp8``
|
||||
* - `Gemma 2 27B <https://huggingface.co/google/gemma-2-27b>`_
|
||||
- ``pyt_vllm_gemma-2-27b``
|
||||
|
||||
* ``pyt_vllm_mixtral-8x22b_fp8``
|
||||
* - `C4AI Command R+ 08-2024 <https://huggingface.co/CohereForAI/c4ai-command-r-plus-08-2024>`_
|
||||
- ``pyt_vllm_c4ai-command-r-plus-08-2024``
|
||||
|
||||
* - `DeepSeek MoE 16B <https://huggingface.co/deepseek-ai/deepseek-moe-16b-chat>`_
|
||||
- ``pyt_vllm_deepseek-moe-16b-chat``
|
||||
|
||||
* - `Llama 3.1 70B FP8 <https://huggingface.co/amd/Llama-3.1-70B-Instruct-FP8-KV>`_
|
||||
- ``pyt_vllm_llama-3.1-70b_fp8``
|
||||
|
||||
* - `Llama 3.1 405B FP8 <https://huggingface.co/amd/Llama-3.1-405B-Instruct-FP8-KV>`_
|
||||
- ``pyt_vllm_llama-3.1-405b_fp8``
|
||||
|
||||
* - `Mixtral MoE 8x7B FP8 <https://huggingface.co/amd/Mixtral-8x7B-Instruct-v0.1-FP8-KV>`_
|
||||
- ``pyt_vllm_mixtral-8x7b_fp8``
|
||||
|
||||
* - `Mixtral MoE 8x22B FP8 <https://huggingface.co/amd/Mixtral-8x22B-Instruct-v0.1-FP8-KV>`_
|
||||
- ``pyt_vllm_mixtral-8x22b_fp8``
|
||||
|
||||
* - `Mistral 7B FP8 <https://huggingface.co/amd/Mistral-7B-v0.1-FP8-KV>`_
|
||||
- ``pyt_vllm_mistral-7b_fp8``
|
||||
|
||||
* - `DBRX Instruct FP8 <https://huggingface.co/amd/dbrx-instruct-FP8-KV>`_
|
||||
- ``pyt_vllm_dbrx_fp8``
|
||||
|
||||
* - `C4AI Command R+ 08-2024 FP8 <https://huggingface.co/amd/c4ai-command-r-plus-FP8-KV>`_
|
||||
- ``pyt_vllm_command-r-plus_fp8``
|
||||
|
||||
.. _vllm-benchmark-standalone:
|
||||
|
||||
@@ -181,8 +198,8 @@ snippet.
|
||||
|
||||
.. code-block::
|
||||
|
||||
docker pull rocm/vllm:rocm6.2_mi300_ubuntu20.04_py3.9_vllm_0.6.4
|
||||
docker run -it --device=/dev/kfd --device=/dev/dri --group-add video --shm-size 128G --security-opt seccomp=unconfined --security-opt apparmor=unconfined --cap-add=SYS_PTRACE -v $(pwd):/workspace --env HUGGINGFACE_HUB_CACHE=/workspace --name vllm_v0.6.4 rocm/vllm:rocm6.2_mi300_ubuntu20.04_py3.9_vllm_0.6.4
|
||||
docker pull rocm/vllm:rocm6.3.1_mi300_ubuntu22.04_py3.12_vllm_0.6.6
|
||||
docker run -it --device=/dev/kfd --device=/dev/dri --group-add video --shm-size 16G --security-opt seccomp=unconfined --security-opt apparmor=unconfined --cap-add=SYS_PTRACE -v $(pwd):/workspace --env HUGGINGFACE_HUB_CACHE=/workspace --name vllm_v0.6.6 rocm/vllm:rocm6.3.1_mi300_ubuntu22.04_py3.12_vllm_0.6.6
|
||||
|
||||
In the Docker container, clone the ROCm MAD repository and navigate to the
|
||||
benchmark scripts directory at ``~/MAD/scripts/vllm``.
|
||||
@@ -224,8 +241,8 @@ See the :ref:`examples <vllm-benchmark-run-benchmark>` for more information.
|
||||
|
||||
.. _vllm-benchmark-standalone-options:
|
||||
|
||||
Options
|
||||
-------
|
||||
Options and available models
|
||||
----------------------------
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
@@ -248,72 +265,100 @@ Options
|
||||
- Measure both throughput and latency
|
||||
|
||||
* - ``$model_repo``
|
||||
- ``meta-llama/Meta-Llama-3.1-8B-Instruct``
|
||||
- Llama 3.1 8B
|
||||
- ``meta-llama/Llama-3.1-8B-Instruct``
|
||||
- `Llama 3.1 8B <https://huggingface.co/meta-llama/Llama-3.1-8B>`_
|
||||
|
||||
* - (``float16``)
|
||||
- ``meta-llama/Meta-Llama-3.1-70B-Instruct``
|
||||
- Llama 3.1 70B
|
||||
- ``meta-llama/Llama-3.1-70B-Instruct``
|
||||
- `Llama 3.1 70B <https://huggingface.co/meta-llama/Llama-3.1-70B-Instruct>`_
|
||||
|
||||
* -
|
||||
- ``meta-llama/Meta-Llama-3.1-405B-Instruct``
|
||||
- Llama 3.1 405B
|
||||
- ``meta-llama/Llama-3.1-405B-Instruct``
|
||||
- `Llama 3.1 405B <https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct>`_
|
||||
|
||||
* -
|
||||
- ``meta-llama/Llama-3.2-11B-Vision-Instruct``
|
||||
- `Llama 3.2 11B Vision <https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct>`_
|
||||
|
||||
* -
|
||||
- ``meta-llama/Llama-2-7b-chat-hf``
|
||||
- Llama 2 7B
|
||||
- `Llama 2 7B <https://huggingface.co/meta-llama/Llama-2-7b-chat-hf>`_
|
||||
|
||||
* -
|
||||
- ``meta-llama/Llama-2-70b-chat-hf``
|
||||
- Llama 2 70B
|
||||
- `Llama 2 7B <https://huggingface.co/meta-llama/Llama-2-70b-chat-hf>`_
|
||||
|
||||
* -
|
||||
- ``mistralai/Mixtral-8x7B-Instruct-v0.1``
|
||||
- Mixtral 8x7B
|
||||
- `Mixtral MoE 8x7B <https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1>`_
|
||||
|
||||
* -
|
||||
- ``mistralai/Mixtral-8x22B-Instruct-v0.1``
|
||||
- Mixtral 8x22B
|
||||
- `Mixtral MoE 8x22B <https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1>`_
|
||||
|
||||
* -
|
||||
- ``mistralai/Mistral-7B-Instruct-v0.3``
|
||||
- Mixtral 7B
|
||||
- `Mistral 7B <https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3>`_
|
||||
|
||||
* -
|
||||
- ``Qwen/Qwen2-7B-Instruct``
|
||||
- Qwen2 7B
|
||||
- `Qwen2 7B <https://huggingface.co/Qwen/Qwen2-7B-Instruct>`_
|
||||
|
||||
* -
|
||||
- ``Qwen/Qwen2-72B-Instruct``
|
||||
- Qwen2 72B
|
||||
- `Qwen2 72B <https://huggingface.co/Qwen/Qwen2-72B-Instruct>`_
|
||||
|
||||
* -
|
||||
- ``core42/jais-13b-chat``
|
||||
- JAIS 13B
|
||||
- `JAIS 13B <https://huggingface.co/core42/jais-13b-chat>`_
|
||||
|
||||
* -
|
||||
- ``core42/jais-30b-chat-v3``
|
||||
- JAIS 30B
|
||||
|
||||
* - ``$model_repo``
|
||||
- ``amd/Meta-Llama-3.1-8B-Instruct-FP8-KV``
|
||||
- Llama 3.1 8B
|
||||
|
||||
* - (``float8``)
|
||||
- ``amd/Meta-Llama-3.1-70B-Instruct-FP8-KV``
|
||||
- Llama 3.1 70B
|
||||
- `JAIS 30B <https://huggingface.co/core42/jais-30b-chat-v3>`_
|
||||
|
||||
* -
|
||||
- ``amd/Meta-Llama-3.1-405B-Instruct-FP8-KV``
|
||||
- Llama 3.1 405B
|
||||
- ``databricks/dbrx-instruct``
|
||||
- `DBRX Instruct <https://huggingface.co/databricks/dbrx-instruct>`_
|
||||
|
||||
* -
|
||||
- ``google/gemma-2-27b``
|
||||
- `Gemma 2 27B <https://huggingface.co/google/gemma-2-27b>`_
|
||||
|
||||
* -
|
||||
- ``CohereForAI/c4ai-command-r-plus-08-2024``
|
||||
- `C4AI Command R+ 08-2024 <https://huggingface.co/CohereForAI/c4ai-command-r-plus-08-2024>`_
|
||||
|
||||
* -
|
||||
- ``deepseek-ai/deepseek-moe-16b-chat``
|
||||
- `DeepSeek MoE 16B <https://huggingface.co/deepseek-ai/deepseek-moe-16b-chat>`_
|
||||
|
||||
* - ``$model_repo``
|
||||
- ``amd/Llama-3.1-70B-Instruct-FP8-KV``
|
||||
- `Llama 3.1 70B FP8 <https://huggingface.co/amd/Llama-3.1-70B-Instruct-FP8-KV>`_
|
||||
|
||||
* - (``float8``)
|
||||
- ``amd/Llama-3.1-405B-Instruct-FP8-KV``
|
||||
- `Llama 3.1 405B FP8 <https://huggingface.co/amd/Llama-3.1-405B-Instruct-FP8-KV>`_
|
||||
|
||||
* -
|
||||
- ``amd/Mixtral-8x7B-Instruct-v0.1-FP8-KV``
|
||||
- Mixtral 8x7B
|
||||
- `Mixtral MoE 8x7B FP8 <https://huggingface.co/amd/Mixtral-8x7B-Instruct-v0.1-FP8-KV>`_
|
||||
|
||||
* -
|
||||
- ``amd/Mixtral-8x22B-Instruct-v0.1-FP8-KV``
|
||||
- Mixtral 8x22B
|
||||
- `Mixtral MoE 8x22B FP8 <https://huggingface.co/amd/Mixtral-8x22B-Instruct-v0.1-FP8-KV>`_
|
||||
|
||||
* -
|
||||
- ``amd/Mistral-7B-v0.1-FP8-KV``
|
||||
- `Mistral 7B FP8 <https://huggingface.co/amd/Mistral-7B-v0.1-FP8-KV>`_
|
||||
|
||||
* -
|
||||
- ``amd/dbrx-instruct-FP8-KV``
|
||||
- `DBRX Instruct FP8 <https://huggingface.co/amd/dbrx-instruct-FP8-KV>`_
|
||||
|
||||
* -
|
||||
- ``amd/c4ai-command-r-plus-FP8-KV``
|
||||
- `C4AI Command R+ 08-2024 FP8 <https://huggingface.co/amd/c4ai-command-r-plus-FP8-KV>`_
|
||||
|
||||
* - ``$num_gpu``
|
||||
- 1 or 8
|
||||
@@ -335,34 +380,34 @@ options and their descriptions.
|
||||
Example 1: latency benchmark
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Use this command to benchmark the latency of the Llama 3.1 8B model on one GPU with the ``float16`` and ``float8`` data types.
|
||||
Use this command to benchmark the latency of the Llama 3.1 70B model on eight GPUs with the ``float16`` and ``float8`` data types.
|
||||
|
||||
.. code-block::
|
||||
|
||||
./vllm_benchmark_report.sh -s latency -m meta-llama/Meta-Llama-3.1-8B-Instruct -g 1 -d float16
|
||||
./vllm_benchmark_report.sh -s latency -m amd/Meta-Llama-3.1-8B-Instruct-FP8-KV -g 1 -d float8
|
||||
./vllm_benchmark_report.sh -s latency -m meta-llama/Llama-3.1-70B-Instruct -g 8 -d float16
|
||||
./vllm_benchmark_report.sh -s latency -m amd/Llama-3.1-70B-Instruct-FP8-KV -g 8 -d float8
|
||||
|
||||
Find the latency reports at:
|
||||
|
||||
- ``./reports_float16/summary/Meta-Llama-3.1-8B-Instruct_latency_report.csv``
|
||||
- ``./reports_float16/summary/Llama-3.1-70B-Instruct_latency_report.csv``
|
||||
|
||||
- ``./reports_float8/summary/Meta-Llama-3.1-8B-Instruct-FP8-KV_latency_report.csv``
|
||||
- ``./reports_float8/summary/Llama-3.1-70B-Instruct-FP8-KV_latency_report.csv``
|
||||
|
||||
Example 2: throughput benchmark
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Use this command to benchmark the throughput of the Llama 3.1 8B model on one GPU with the ``float16`` and ``float8`` data types.
|
||||
Use this command to benchmark the throughput of the Llama 3.1 70B model on eight GPUs with the ``float16`` and ``float8`` data types.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
./vllm_benchmark_report.sh -s throughput -m meta-llama/Meta-Llama-3.1-8B-Instruct -g 1 -d float16
|
||||
./vllm_benchmark_report.sh -s throughput -m amd/Meta-Llama-3.1-8B-Instruct-FP8-KV -g 1 -d float8
|
||||
./vllm_benchmark_report.sh -s throughput -m meta-llama/Llama-3.1-70B-Instruct -g 8 -d float16
|
||||
./vllm_benchmark_report.sh -s throughput -m amd/Llama-3.1-70B-Instruct-FP8-KV -g 8 -d float8
|
||||
|
||||
Find the throughput reports at:
|
||||
|
||||
- ``./reports_float16/summary/Meta-Llama-3.1-8B-Instruct_throughput_report.csv``
|
||||
- ``./reports_float16/summary/Llama-3.1-70B-Instruct_throughput_report.csv``
|
||||
|
||||
- ``./reports_float8/summary/Meta-Llama-3.1-8B-Instruct-FP8-KV_throughput_report.csv``
|
||||
- ``./reports_float8/summary/Llama-3.1-70B-Instruct-FP8-KV_throughput_report.csv``
|
||||
|
||||
.. raw:: html
|
||||
|
||||
@@ -394,7 +439,7 @@ Further reading
|
||||
MI300X accelerators, see :doc:`../../system-optimization/mi300x`.
|
||||
|
||||
- To learn how to run LLM models from Hugging Face or your own model, see
|
||||
:doc:`Using ROCm for AI <../index>`.
|
||||
:doc:`Running models from Hugging Face <hugging-face-models>`.
|
||||
|
||||
- To learn how to optimize inference on LLMs, see
|
||||
:doc:`Inference optimization <../inference-optimization/index>`.
|
||||
@@ -402,6 +447,32 @@ Further reading
|
||||
- To learn how to fine-tune LLMs, see
|
||||
:doc:`Fine-tuning LLMs <../fine-tuning/index>`.
|
||||
|
||||
- To compare with the previous version of the ROCm vLLM Docker image for performance validation, refer to
|
||||
`LLM inference performance validation on AMD Instinct MI300X (ROCm 6.2.0) <https://rocm.docs.amd.com/en/docs-6.2.0/how-to/performance-validation/mi300x/vllm-benchmark.html>`_.
|
||||
Previous versions
|
||||
=================
|
||||
|
||||
This table lists previous versions of the ROCm vLLM Docker image for inference
|
||||
performance validation. For detailed information about available models for
|
||||
benchmarking, see the version-specific documentation.
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:stub-columns: 1
|
||||
|
||||
* - ROCm version
|
||||
- vLLM version
|
||||
- PyTorch version
|
||||
- Resources
|
||||
|
||||
* - 6.2.1
|
||||
- 0.6.4
|
||||
- 2.5.0
|
||||
-
|
||||
* `Documentation <https://rocm.docs.amd.com/en/docs-6.3.0/how-to/performance-validation/mi300x/vllm-benchmark.html>`_
|
||||
* `Docker Hub <https://hub.docker.com/layers/rocm/vllm/rocm6.2_mi300_ubuntu20.04_py3.9_vllm_0.6.4/images/sha256-ccbb74cc9e7adecb8f7bdab9555f7ac6fc73adb580836c2a35ca96ff471890d8>`_
|
||||
|
||||
* - 6.2.0
|
||||
- 0.4.3
|
||||
- 2.4.0
|
||||
-
|
||||
* `Documentation <https://rocm.docs.amd.com/en/docs-6.2.0/how-to/performance-validation/mi300x/vllm-benchmark.html>`_
|
||||
* `Docker Hub <https://hub.docker.com/layers/rocm/vllm/rocm6.2_mi300_ubuntu22.04_py3.9_vllm_7c5fd50/images/sha256-9e4dd4788a794c3d346d7d0ba452ae5e92d39b8dfac438b2af8efdc7f15d22c0>`_
|
||||
|
||||
@@ -14,6 +14,9 @@ Training models on AMD GPUs with the ROCm™ software platform allows you to use
|
||||
|
||||
The ROCm software platform makes it easier to train models on AMD GPUs while maintaining compatibility with existing code and tools. The platform also provides features like multi-GPU support, allowing for scaling and parallelization of model training across multiple GPUs to enhance performance.
|
||||
|
||||
The AI Developer Hub contains `AMD ROCm tutorials <https://rocm.docs.amd.com/projects/ai-developer-hub/en/latest/>`_ for
|
||||
training, fine-tuning, and inference. It leverages popular machine learning frameworks on AMD GPUs.
|
||||
|
||||
In this guide, you'll learn about:
|
||||
|
||||
- :doc:`Training a model <train-a-model>`
|
||||
|
||||
@@ -12,7 +12,7 @@ myst:
|
||||
This chapter reviews system settings that are required to configure the system
|
||||
for ROCm virtualization on RDNA2-based AMD Radeon™ PRO GPUs. Installing ROCm on
|
||||
Bare Metal follows the routine ROCm
|
||||
{doc}`installation procedure<rocm-install-on-linux:install/native-install/index>`.
|
||||
{doc}`installation procedure<rocm-install-on-linux:install/install-methods/package-manager-index>`.
|
||||
|
||||
To enable ROCm virtualization on V620, one has to setup Single Root I/O
|
||||
Virtualization (SR-IOV) in the BIOS via setting found in the following
|
||||
@@ -166,4 +166,4 @@ First, assign GPU virtual function (VF) to VM using the following steps.
|
||||
Then start the VM.
|
||||
|
||||
Finally install ROCm on the virtual machine (VM). For detailed instructions,
|
||||
refer to the {doc}`Linux install guide<rocm-install-on-linux:install/native-install/index>`.
|
||||
refer to the {doc}`Linux install guide<rocm-install-on-linux:install/install-methods/package-manager-index>`.
|
||||
|
||||
@@ -38,6 +38,7 @@ ROCm documentation is organized into the following categories:
|
||||
:class-body: rocm-card-banner rocm-hue-12
|
||||
|
||||
* [Use ROCm for AI](./how-to/rocm-for-ai/index.rst)
|
||||
* [AI tutorials](https://rocm.docs.amd.com/projects/ai-developer-hub/en/latest/)
|
||||
* [Use ROCm for HPC](./how-to/rocm-for-hpc/index.rst)
|
||||
* [System optimization](./how-to/system-optimization/index.rst)
|
||||
* [AMD Instinct MI300X performance validation and tuning](./how-to/tuning-guides/mi300x/index.rst)
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
.. meta::
|
||||
:description: Supported data types in ROCm
|
||||
:keywords: int8, float8, float8 (E4M3), float8 (E5M2), bfloat8, float16, half, bfloat16, tensorfloat32, float,
|
||||
float32, float64, double, AMD, ROCm, AMDGPU
|
||||
:description: Supported data types of AMD GPUs and libraries in ROCm.
|
||||
:keywords: precision, data types, HIP types, int8, float8, float8 (E4M3),
|
||||
float8 (E5M2), bfloat8, float16, half, bfloat16, tensorfloat32,
|
||||
float, float32, float64, double, AMD data types, HIP data types,
|
||||
ROCm precision, ROCm data types
|
||||
|
||||
*************************************************************
|
||||
Precision support
|
||||
Data types and precision support
|
||||
*************************************************************
|
||||
|
||||
Use the following sections to identify data types and HIP types ROCm™ supports.
|
||||
This topic lists the supported data types of AMD GPUs and ROCm libraries.
|
||||
Corresponding :doc:`HIP <hip:index>` data types are also noted.
|
||||
|
||||
Integral types
|
||||
==========================================
|
||||
|
||||
The signed and unsigned integral types that are supported by ROCm are listed in the following table,
|
||||
together with their corresponding HIP type and a short description.
|
||||
The signed and unsigned integral types supported by ROCm are listed in
|
||||
the following table, along with their corresponding HIP type and a short
|
||||
description.
|
||||
|
||||
|
||||
.. list-table::
|
||||
@@ -46,8 +50,8 @@ together with their corresponding HIP type and a short description.
|
||||
Floating-point types
|
||||
==========================================
|
||||
|
||||
The floating-point types that are supported by ROCm are listed in the following table, together with
|
||||
their corresponding HIP type and a short description.
|
||||
The floating-point types supported by ROCm are listed in the following
|
||||
table, along with their corresponding HIP type and a short description.
|
||||
|
||||
.. image:: ../data/about/compatibility/floating-point-data-types.png
|
||||
:alt: Supported floating-point types
|
||||
@@ -63,43 +67,62 @@ their corresponding HIP type and a short description.
|
||||
*
|
||||
- float8 (E4M3)
|
||||
- ``-``
|
||||
- An 8-bit floating-point number that mostly follows IEEE-754 conventions and **S1E4M3** bit layout, as described in `8-bit Numerical Formats for Deep Neural Networks <https://arxiv.org/abs/2206.02915>`_ , with expanded range and with no infinity or signed zero. NaN is represented as negative zero.
|
||||
- An 8-bit floating-point number that mostly follows IEEE-754 conventions
|
||||
and **S1E4M3** bit layout, as described in `8-bit Numerical Formats for Deep Neural Networks <https://arxiv.org/abs/2206.02915>`_ ,
|
||||
with expanded range and no infinity or signed zero. NaN is
|
||||
represented as negative zero.
|
||||
*
|
||||
- float8 (E5M2)
|
||||
- ``-``
|
||||
- An 8-bit floating-point number mostly following IEEE-754 conventions and **S1E5M2** bit layout, as described in `8-bit Numerical Formats for Deep Neural Networks <https://arxiv.org/abs/2206.02915>`_ , with expanded range and with no infinity or signed zero. NaN is represented as negative zero.
|
||||
- An 8-bit floating-point number mostly following IEEE-754 conventions and
|
||||
**S1E5M2** bit layout, as described in `8-bit Numerical Formats for Deep Neural Networks <https://arxiv.org/abs/2206.02915>`_ ,
|
||||
with expanded range and no infinity or signed zero. NaN is
|
||||
represented as negative zero.
|
||||
*
|
||||
- float16
|
||||
- ``half``
|
||||
- A 16-bit floating-point number that conforms to the IEEE 754-2008 half-precision storage format.
|
||||
- A 16-bit floating-point number that conforms to the IEEE 754-2008
|
||||
half-precision storage format.
|
||||
*
|
||||
- bfloat16
|
||||
- ``bfloat16``
|
||||
- A shortened 16-bit version of the IEEE 754 single-precision storage format.
|
||||
- A shortened 16-bit version of the IEEE 754 single-precision storage
|
||||
format.
|
||||
*
|
||||
- tensorfloat32
|
||||
- ``-``
|
||||
- A floating-point number that occupies 32 bits or less of storage, providing improved range compared to half (16-bit) format, at (potentially) greater throughput than single-precision (32-bit) formats.
|
||||
- A floating-point number that occupies 32 bits or less of storage,
|
||||
providing improved range compared to half (16-bit) format, at
|
||||
(potentially) greater throughput than single-precision (32-bit) formats.
|
||||
*
|
||||
- float32
|
||||
- ``float``
|
||||
- A 32-bit floating-point number that conforms to the IEEE 754 single-precision storage format.
|
||||
- A 32-bit floating-point number that conforms to the IEEE 754
|
||||
single-precision storage format.
|
||||
*
|
||||
- float64
|
||||
- ``double``
|
||||
- A 64-bit floating-point number that conforms to the IEEE 754 double-precision storage format.
|
||||
- A 64-bit floating-point number that conforms to the IEEE 754
|
||||
double-precision storage format.
|
||||
|
||||
.. note::
|
||||
|
||||
* The float8 and tensorfloat32 types are internal types used in calculations in Matrix Cores and can be stored in any type of the same size.
|
||||
* The encodings for FP8 (E5M2) and FP8 (E4M3) that are natively supported by MI300 differ from the FP8 (E5M2) and FP8 (E4M3) encodings used in H100 (`FP8 Formats for Deep Learning <https://arxiv.org/abs/2209.05433>`_).
|
||||
* The float8 and tensorfloat32 types are internal types used in calculations
|
||||
in Matrix Cores and can be stored in any type of the same size.
|
||||
|
||||
* The encodings for FP8 (E5M2) and FP8 (E4M3) that the
|
||||
MI300 series natively supports differ from the FP8 (E5M2) and FP8 (E4M3)
|
||||
encodings used in NVIDIA H100
|
||||
(`FP8 Formats for Deep Learning <https://arxiv.org/abs/2209.05433>`_).
|
||||
|
||||
* In some AMD documents and articles, float8 (E5M2) is referred to as bfloat8.
|
||||
|
||||
ROCm support icons
|
||||
==========================================
|
||||
|
||||
In the following sections, we use icons to represent the level of support. These icons, described in the
|
||||
following table, are also used on the library data type support pages.
|
||||
In the following sections, icons represent the level of support. These
|
||||
icons, described in the following table, are also used in the library data type
|
||||
support pages.
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
@@ -121,14 +144,27 @@ following table, are also used on the library data type support pages.
|
||||
|
||||
.. note::
|
||||
|
||||
* Full support means that the type is supported natively or with hardware emulation.
|
||||
* Native support means that the operations for that type are implemented in hardware. Types that are not natively supported are emulated with the available hardware. The performance of non-natively supported types can differ from the full instruction throughput rate. For example, 16-bit integer operations can be performed on the 32-bit integer ALUs at full rate; however, 64-bit integer operations might need several instructions on the 32-bit integer ALUs.
|
||||
* Any type can be emulated by software, but this page does not cover such cases.
|
||||
* Full support means that the type is supported natively or with hardware
|
||||
emulation.
|
||||
|
||||
Hardware type support
|
||||
* Native support means that the operations for that type are implemented in
|
||||
hardware. Types that are not natively supported are emulated with the
|
||||
available hardware. The performance of non-natively supported types can
|
||||
differ from the full instruction throughput rate. For example, 16-bit
|
||||
integer operations can be performed on the 32-bit integer ALUs at full rate;
|
||||
however, 64-bit integer operations might need several instructions on the
|
||||
32-bit integer ALUs.
|
||||
|
||||
* Any type can be emulated by software, but this page does not cover such
|
||||
cases.
|
||||
|
||||
Hardware data type support
|
||||
==========================================
|
||||
|
||||
AMD GPU hardware support for data types is listed in the following tables.
|
||||
The following tables provide information about AMD Instinct accelerators support
|
||||
for various data types. The MI200 series GPUs, which include MI210, MI250, and
|
||||
MI250X, are based on the CDNA2 architecture. The MI300 series GPUs, consisting
|
||||
of MI300A, MI300X, and MI325X, are built on the CDNA3 architecture.
|
||||
|
||||
Compute units support
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -375,21 +411,23 @@ The following table lists data type support for atomic operations.
|
||||
|
||||
.. note::
|
||||
|
||||
For cases that are not natively supported, you can emulate atomic operations using software.
|
||||
Software-emulated atomic operations have high negative performance impact when they frequently
|
||||
access the same memory address.
|
||||
You can emulate atomic operations using software for cases that are not
|
||||
natively supported. Software-emulated atomic operations have a high negative
|
||||
performance impact when they frequently access the same memory address.
|
||||
|
||||
Data Type support in ROCm Libraries
|
||||
Data type support in ROCm libraries
|
||||
==========================================
|
||||
|
||||
ROCm library support for int8, float8 (E4M3), float8 (E5M2), int16, float16, bfloat16, int32,
|
||||
tensorfloat32, float32, int64, and float64 is listed in the following tables.
|
||||
ROCm library support for int8, float8 (E4M3), float8 (E5M2), int16, float16,
|
||||
bfloat16, int32, tensorfloat32, float32, int64, and float64 is listed in the
|
||||
following tables.
|
||||
|
||||
Libraries input/output type support
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The following tables list ROCm library support for specific input and output data types. For a detailed
|
||||
description, refer to the corresponding library data type support page.
|
||||
The following tables list ROCm library support for specific input and output
|
||||
data types. Refer to the corresponding library data type support page for a
|
||||
detailed description.
|
||||
|
||||
.. tab-set::
|
||||
|
||||
@@ -516,8 +554,9 @@ description, refer to the corresponding library data type support page.
|
||||
Libraries internal calculations type support
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The following tables list ROCm library support for specific internal data types. For a detailed
|
||||
description, refer to the corresponding library data type support page.
|
||||
The following tables list ROCm library support for specific internal data types.
|
||||
Refer to the corresponding library data type support page for a detailed
|
||||
description.
|
||||
|
||||
.. tab-set::
|
||||
|
||||
|
||||
@@ -89,7 +89,10 @@ subtrees:
|
||||
title: Profile and debug
|
||||
- file: how-to/rocm-for-ai/inference-optimization/workload.rst
|
||||
title: Workload tuning
|
||||
|
||||
|
||||
- url: https://rocm.docs.amd.com/projects/ai-developer-hub/en/latest/
|
||||
title: AI tutorials
|
||||
|
||||
- file: how-to/rocm-for-hpc/index.rst
|
||||
title: Use ROCm for HPC
|
||||
- file: how-to/system-optimization/index.rst
|
||||
@@ -126,6 +129,7 @@ subtrees:
|
||||
- url: https://github.com/amd/rocm-examples
|
||||
title: ROCm examples
|
||||
|
||||
|
||||
- caption: Conceptual
|
||||
entries:
|
||||
- file: conceptual/gpu-arch.md
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
rocm-docs-core==1.13.0
|
||||
rocm-docs-core==1.17.0
|
||||
sphinx-reredirects
|
||||
sphinx-sitemap
|
||||
|
||||
@@ -8,6 +8,13 @@ accessible-pygments==0.0.5
|
||||
# via pydata-sphinx-theme
|
||||
alabaster==1.0.0
|
||||
# via sphinx
|
||||
asttokens==3.0.0
|
||||
# via stack-data
|
||||
attrs==25.1.0
|
||||
# via
|
||||
# jsonschema
|
||||
# jupyter-cache
|
||||
# referencing
|
||||
babel==2.16.0
|
||||
# via
|
||||
# pydata-sphinx-theme
|
||||
@@ -25,9 +32,17 @@ cffi==1.17.1
|
||||
charset-normalizer==3.4.0
|
||||
# via requests
|
||||
click==8.1.7
|
||||
# via sphinx-external-toc
|
||||
# via
|
||||
# jupyter-cache
|
||||
# sphinx-external-toc
|
||||
comm==0.2.2
|
||||
# via ipykernel
|
||||
cryptography==43.0.3
|
||||
# via pyjwt
|
||||
debugpy==1.8.12
|
||||
# via ipykernel
|
||||
decorator==5.1.1
|
||||
# via ipython
|
||||
deprecated==1.2.15
|
||||
# via pygithub
|
||||
docutils==0.21.2
|
||||
@@ -36,34 +51,103 @@ docutils==0.21.2
|
||||
# myst-parser
|
||||
# pydata-sphinx-theme
|
||||
# sphinx
|
||||
exceptiongroup==1.2.2
|
||||
# via ipython
|
||||
executing==2.2.0
|
||||
# via stack-data
|
||||
fastjsonschema==2.20.0
|
||||
# via rocm-docs-core
|
||||
# via
|
||||
# nbformat
|
||||
# rocm-docs-core
|
||||
gitdb==4.0.11
|
||||
# via gitpython
|
||||
gitpython==3.1.43
|
||||
# via rocm-docs-core
|
||||
greenlet==3.1.1
|
||||
# via sqlalchemy
|
||||
idna==3.10
|
||||
# via requests
|
||||
imagesize==1.4.1
|
||||
# via sphinx
|
||||
importlib-metadata==8.6.1
|
||||
# via
|
||||
# jupyter-cache
|
||||
# myst-nb
|
||||
ipykernel==6.29.5
|
||||
# via myst-nb
|
||||
ipython==8.31.0
|
||||
# via
|
||||
# ipykernel
|
||||
# myst-nb
|
||||
jedi==0.19.2
|
||||
# via ipython
|
||||
jinja2==3.1.5
|
||||
# via
|
||||
# myst-parser
|
||||
# sphinx
|
||||
jsonschema==4.23.0
|
||||
# via nbformat
|
||||
jsonschema-specifications==2024.10.1
|
||||
# via jsonschema
|
||||
jupyter-cache==1.0.1
|
||||
# via myst-nb
|
||||
jupyter-client==8.6.3
|
||||
# via
|
||||
# ipykernel
|
||||
# nbclient
|
||||
jupyter-core==5.7.2
|
||||
# via
|
||||
# ipykernel
|
||||
# jupyter-client
|
||||
# nbclient
|
||||
# nbformat
|
||||
markdown-it-py==3.0.0
|
||||
# via
|
||||
# mdit-py-plugins
|
||||
# myst-parser
|
||||
markupsafe==3.0.2
|
||||
# via jinja2
|
||||
matplotlib-inline==0.1.7
|
||||
# via
|
||||
# ipykernel
|
||||
# ipython
|
||||
mdit-py-plugins==0.4.2
|
||||
# via myst-parser
|
||||
mdurl==0.1.2
|
||||
# via markdown-it-py
|
||||
myst-parser==4.0.0
|
||||
myst-nb==1.1.2
|
||||
# via rocm-docs-core
|
||||
myst-parser==4.0.0
|
||||
# via myst-nb
|
||||
nbclient==0.10.2
|
||||
# via
|
||||
# jupyter-cache
|
||||
# myst-nb
|
||||
nbformat==5.10.4
|
||||
# via
|
||||
# jupyter-cache
|
||||
# myst-nb
|
||||
# nbclient
|
||||
nest-asyncio==1.6.0
|
||||
# via ipykernel
|
||||
packaging==24.2
|
||||
# via sphinx
|
||||
# via
|
||||
# ipykernel
|
||||
# sphinx
|
||||
parso==0.8.4
|
||||
# via jedi
|
||||
pexpect==4.9.0
|
||||
# via ipython
|
||||
platformdirs==4.3.6
|
||||
# via jupyter-core
|
||||
prompt-toolkit==3.0.50
|
||||
# via ipython
|
||||
psutil==6.1.1
|
||||
# via ipykernel
|
||||
ptyprocess==0.7.0
|
||||
# via pexpect
|
||||
pure-eval==0.2.3
|
||||
# via stack-data
|
||||
pycparser==2.22
|
||||
# via cffi
|
||||
pydata-sphinx-theme==0.16.0
|
||||
@@ -75,23 +159,42 @@ pygithub==2.5.0
|
||||
pygments==2.18.0
|
||||
# via
|
||||
# accessible-pygments
|
||||
# ipython
|
||||
# pydata-sphinx-theme
|
||||
# sphinx
|
||||
pyjwt[crypto]==2.10.0
|
||||
# via pygithub
|
||||
pynacl==1.5.0
|
||||
# via pygithub
|
||||
python-dateutil==2.9.0.post0
|
||||
# via jupyter-client
|
||||
pyyaml==6.0.2
|
||||
# via
|
||||
# jupyter-cache
|
||||
# myst-nb
|
||||
# myst-parser
|
||||
# rocm-docs-core
|
||||
# sphinx-external-toc
|
||||
pyzmq==26.2.0
|
||||
# via
|
||||
# ipykernel
|
||||
# jupyter-client
|
||||
referencing==0.36.2
|
||||
# via
|
||||
# jsonschema
|
||||
# jsonschema-specifications
|
||||
requests==2.32.3
|
||||
# via
|
||||
# pygithub
|
||||
# sphinx
|
||||
rocm-docs-core==1.13.0
|
||||
rocm-docs-core==1.17.0
|
||||
# via -r requirements.in
|
||||
rpds-py==0.22.3
|
||||
# via
|
||||
# jsonschema
|
||||
# referencing
|
||||
six==1.17.0
|
||||
# via python-dateutil
|
||||
smmap==5.0.1
|
||||
# via gitdb
|
||||
snowballstemmer==2.2.0
|
||||
@@ -101,6 +204,7 @@ soupsieve==2.6
|
||||
sphinx==8.1.3
|
||||
# via
|
||||
# breathe
|
||||
# myst-nb
|
||||
# myst-parser
|
||||
# pydata-sphinx-theme
|
||||
# rocm-docs-core
|
||||
@@ -137,15 +241,43 @@ sphinxcontrib-qthelp==2.0.0
|
||||
# via sphinx
|
||||
sphinxcontrib-serializinghtml==2.0.0
|
||||
# via sphinx
|
||||
sqlalchemy==2.0.37
|
||||
# via jupyter-cache
|
||||
stack-data==0.6.3
|
||||
# via ipython
|
||||
tabulate==0.9.0
|
||||
# via jupyter-cache
|
||||
tomli==2.1.0
|
||||
# via sphinx
|
||||
tornado==6.4.2
|
||||
# via
|
||||
# ipykernel
|
||||
# jupyter-client
|
||||
traitlets==5.14.3
|
||||
# via
|
||||
# comm
|
||||
# ipykernel
|
||||
# ipython
|
||||
# jupyter-client
|
||||
# jupyter-core
|
||||
# matplotlib-inline
|
||||
# nbclient
|
||||
# nbformat
|
||||
typing-extensions==4.12.2
|
||||
# via
|
||||
# ipython
|
||||
# myst-nb
|
||||
# pydata-sphinx-theme
|
||||
# pygithub
|
||||
# referencing
|
||||
# sqlalchemy
|
||||
urllib3==2.2.3
|
||||
# via
|
||||
# pygithub
|
||||
# requests
|
||||
wcwidth==0.2.13
|
||||
# via prompt-toolkit
|
||||
wrapt==1.17.0
|
||||
# via deprecated
|
||||
zipp==3.21.0
|
||||
# via importlib-metadata
|
||||
|
||||
@@ -103,7 +103,7 @@ $(call adddep,composable_kernel,lightning hipcc hip_on_rocclr rocm-cmake)
|
||||
$(call adddep,half,rocm-cmake)
|
||||
$(call adddep,hipblas-common,lightning)
|
||||
$(call adddep,hipblas,hip_on_rocclr rocblas rocsolver lightning hipcc)
|
||||
$(call adddep,hipblaslt,hip_on_rocclr openmp_extras lightning hipcc hipblas-common rocm-dev)
|
||||
$(call adddep,hipblaslt,hip_on_rocclr openmp_extras lightning hipcc hipblas-common roctracer)
|
||||
$(call adddep,hipcub,hip_on_rocclr rocprim lightning hipcc)
|
||||
$(call adddep,hipfft,hip_on_rocclr openmp_extras rocfft rocrand hiprand lightning hipcc)
|
||||
$(call adddep,hipfort,rocblas hipblas rocsparse hipsparse rocfft hipfft rocrand hiprand rocsolver hipsolver lightning hipcc)
|
||||
|
||||
@@ -10,7 +10,9 @@ printUsage() {
|
||||
echo " -c, --clean Removes all amd_smi build artifacts"
|
||||
echo " -r, --release Build non-debug version amd_smi (default is debug)"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -w, --wheel Creates python wheel package of amd-smi.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of type referred to by pkg_type"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -h, --help Prints this help"
|
||||
@@ -25,7 +27,6 @@ printUsage() {
|
||||
PROJ_NAME="amdsmi"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
TARGET="build"
|
||||
|
||||
PACKAGE_LIB=$(getLibPath)
|
||||
PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
AMDSMI_BUILD_DIR=$(getBuildPath $PROJ_NAME)
|
||||
@@ -42,7 +43,7 @@ SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
PKGTYPE="deb"
|
||||
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,static,address_sanitizer,outdir:,package: -- "$@"`
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,static,wheel,address_sanitizer,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
@@ -60,6 +61,8 @@ do
|
||||
ADDRESS_SANITIZER=true ; shift ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
@@ -99,6 +102,7 @@ build_amdsmi() {
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
$(rocm_common_cmake_params) \
|
||||
$(rocm_cmake_params) \
|
||||
${GEN_NINJA} \
|
||||
-DENABLE_LDCONFIG=OFF \
|
||||
-DAMD_SMI_PACKAGE="${AMDSMI_PKG_NAME}" \
|
||||
-DCPACK_PACKAGE_VERSION_MAJOR="1" \
|
||||
@@ -106,14 +110,14 @@ build_amdsmi() {
|
||||
-DCPACK_PACKAGE_VERSION_PATCH="0" \
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
-DBUILD_TESTS=ON \
|
||||
"$AMD_SMI_LIB_ROOT"
|
||||
-S "$AMD_SMI_LIB_ROOT"
|
||||
popd
|
||||
fi
|
||||
|
||||
echo "Making amd_smi package:"
|
||||
cmake --build "$AMDSMI_BUILD_DIR" -- $AMDSMI_MAKE_OPTS
|
||||
cmake --build "$AMDSMI_BUILD_DIR" -- $AMDSMI_MAKE_OPTS install
|
||||
cmake --build "$AMDSMI_BUILD_DIR" -- $AMDSMI_MAKE_OPTS package
|
||||
cmake --build "$AMDSMI_BUILD_DIR" -- $DASH_JAY
|
||||
cmake --build "$AMDSMI_BUILD_DIR" -- $DASH_JAY install
|
||||
cmake --build "$AMDSMI_BUILD_DIR" -- $DASH_JAY package
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$AMDSMI_PACKAGE_DEB_DIR" $AMDSMI_BUILD_DIR/*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$AMDSMI_PACKAGE_RPM_DIR" $AMDSMI_BUILD_DIR/*.rpm
|
||||
@@ -135,7 +139,7 @@ verifyEnvSetup
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_amdsmi ;;
|
||||
(build) build_amdsmi ;;
|
||||
(build) build_amdsmi; build_wheel "$AMDSMI_BUILD_DIR" "$PROJ_NAME" ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -1,41 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src AMDMIGraphX
|
||||
|
||||
build_amdmigraphx() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
if ! command -v rbuild &> /dev/null; then
|
||||
pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
|
||||
fi
|
||||
|
||||
# Remove CK
|
||||
xargs -d '\n' -a ${OUT_DIR}/ck.files rm -- || true
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
fi
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102;gfx942;gfx1200;gfx1201"
|
||||
fi
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
mkdir -p ${BUILD_DIR} && rm -rf ${BUILD_DIR}/* && mkdir -p ${HOME}/amdmigraphx && rm -rf ${HOME}/amdmigraphx/*
|
||||
rbuild package -d "${HOME}/amdmigraphx" -B "${BUILD_DIR}" \
|
||||
--cxx="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
--cc="${ROCM_PATH}/llvm/bin/clang" \
|
||||
--cxx="$(set_build_variables __CLANG++__)" \
|
||||
--cc="$(set_build_variables __CLANG__)" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_LIB_RPATH" \
|
||||
-DGPU_TARGETS="${GPU_TARGETS}" \
|
||||
-DCMAKE_INSTALL_RPATH=""
|
||||
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
cd $BUILD_DIR && cmake --build . -- install -j${PROC}
|
||||
|
||||
show_build_cache_stats
|
||||
@@ -50,7 +51,7 @@ clean_amdmigraphx() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_amdmigraphx ;;
|
||||
build) build_amdmigraphx; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_amdmigraphx ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -14,6 +14,7 @@ printUsage() {
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -w, --wheel Creates python wheel package of comgr. It needs to be used along with -r option"
|
||||
echo " -l, --link_llvm_static Link to LLVM statically. Default is to dynamically link to LLVM; requires that LLVM dylibs are created."
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
@@ -24,6 +25,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME=amd_comgr
|
||||
PROJ_NAME=$API_NAME
|
||||
LIB_NAME=lib${API_NAME}
|
||||
@@ -33,8 +35,8 @@ PACKAGE_ROOT=$(getPackageRoot)
|
||||
PACKAGE_LIB=$(getLibPath)
|
||||
PACKAGE_INCLUDE=$(getIncludePath)
|
||||
BUILD_DIR=$(getBuildPath $API_NAME)
|
||||
PACKAGE_DEB=$(getPackageRoot)/deb/$API_NAME
|
||||
PACKAGE_RPM=$(getPackageRoot)/rpm/$API_NAME
|
||||
PACKAGE_DEB=$PACKAGE_ROOT/deb/$PROJ_NAME
|
||||
PACKAGE_RPM=$PACKAGE_ROOT/rpm/$PROJ_NAME
|
||||
PACKAGE_PREFIX=$ROCM_INSTALL_PATH
|
||||
BUILD_TYPE=Debug
|
||||
MAKE_OPTS="$DASH_JAY CTEST_OUTPUT_ON_FAILURE=1 -C $BUILD_DIR"
|
||||
@@ -44,13 +46,17 @@ CLEAN_OR_OUT=0;
|
||||
PKGTYPE="deb"
|
||||
MAKETARGET="deb"
|
||||
|
||||
# link to LLVM dynamicaly. Default is to link to llvm dynamically.
|
||||
# temporarily set this default to OFF until we resolve Issues
|
||||
LINK_LLVM_DYLIB="OFF"
|
||||
|
||||
VALID_STR=`getopt -o hcraslo:p: --long help,clean,release,address_sanitizer,static,link_llvm_static,outdir:,package: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswlo:p: --long help,clean,release,address_sanitizer,static,wheel,link_llvm_static,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -63,6 +69,8 @@ do
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-l | --link_llvm_static)
|
||||
LINK_LLVM_DYLIB="OFF"; shift ;;
|
||||
(-o | --outdir)
|
||||
@@ -105,6 +113,7 @@ build() {
|
||||
echo " Building Shared Object "
|
||||
fi
|
||||
|
||||
# Remove CTEST var once SWDEV-381396 is fixed
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
@@ -143,7 +152,7 @@ verifyEnvSetup
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean ;;
|
||||
(build) build ;;
|
||||
(build) build; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
# Temporarily disable Address Sanitizer
|
||||
ENABLE_ADDRESS_SANITIZER=false
|
||||
|
||||
set_component_src composable_kernel
|
||||
|
||||
disable_debug_package_generation
|
||||
# Set the GPU_ARCH_LIST to the supported GPUs needed after https://github.com/ROCm/composable_kernel/pull/1536/
|
||||
GPU_ARCH_LIST="gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
|
||||
build_miopen_ck() {
|
||||
@@ -23,10 +27,17 @@ build_miopen_ck() {
|
||||
GPU_ARCH_LIST="gfx942"
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
# if ENABLE_GPU_ARCH is set in env by Job parameter ENABLE_GPU_ARCH, then set GPU_ARCH_LIST to that value
|
||||
# This needs to be removed when CK aligns with other component and uses -DAMDGPU_TARGET or _DGPO_TARGET
|
||||
# then we can use set_gpu_arch from compure_helper.sh and get rid of all if clauses
|
||||
if [ -n "$ENABLE_GPU_ARCH" ]; then
|
||||
GPU_ARCH_LIST="$ENABLE_GPU_ARCH"
|
||||
fi
|
||||
# Latest CK requiring Python 3.8 as the minimum.
|
||||
# Point CMake to that explicit location and adjust LD_LIBRARY_PATH.
|
||||
PYTHON_VERSION_WORKAROUND=''
|
||||
echo "DISTRO_ID: ${DISTRO_ID}"
|
||||
if [ "$DISTRO_ID" = "rhel-8.8" ] || [ "$DISTRO_ID" = "sles-15.5" ] ; then
|
||||
if [ "$DISTRO_ID" = "rhel-8.8" ] || [ "$DISTRO_NAME" == "sles" ] || [ "$DISTRO_ID" = "debian-10" ]; then
|
||||
EXTRA_PYTHON_PATH=/opt/Python-3.8.13
|
||||
PYTHON_VERSION_WORKAROUND="-DCK_USE_ALTERNATIVE_PYTHON=${EXTRA_PYTHON_PATH}/bin/python3.8"
|
||||
# For the python interpreter we need to export LD_LIBRARY_PATH.
|
||||
@@ -38,23 +49,25 @@ build_miopen_ck() {
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
-DBUILD_DEV=OFF \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
${PYTHON_VERSION_WORKAROUND} \
|
||||
-DCPACK_GENERATOR="${PKGTYPE^^}" \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
-DCMAKE_CXX_COMPILER=$(set_build_variables __CLANG++__) \
|
||||
-DCMAKE_C_COMPILER=$(set_build_variables __CLANG__) \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DGPU_ARCHS="${GPU_ARCH_LIST}" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_FLAGS=" -O3 " \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build . -- -j${PROC} package
|
||||
cmake --build "$BUILD_DIR" -- install
|
||||
mkdir -p $PACKAGE_DIR && cp ./*.${PKGTYPE} $PACKAGE_DIR
|
||||
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
}
|
||||
|
||||
# Use the function to unset the LDFLAGS and CXXFLAGS
|
||||
# specifically set for ASAN
|
||||
unset_asan_env_vars() {
|
||||
ASAN_CMAKE_PARAMS="false"
|
||||
export ADDRESS_SANITIZER="OFF"
|
||||
@@ -68,85 +81,6 @@ set_address_sanitizer_off() {
|
||||
export LDFLAGS=""
|
||||
}
|
||||
|
||||
build_miopen_ckProf() {
|
||||
ENABLE_ADDRESS_SANITIZER=false
|
||||
echo "Start Building Composable Kernel Profiler"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
else
|
||||
unset_asan_env_vars
|
||||
set_address_sanitizer_off
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
cd "$BUILD_DIR"
|
||||
rm -rf *
|
||||
|
||||
architectures='gfx10 gfx11 gfx90 gfx94'
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
architectures=$(echo ${GPU_ARCHS} | awk -F';' '{for(i=1;i<=NF;i++) a[substr($i,1,5)]} END{for(i in a) printf i" "}')
|
||||
fi
|
||||
|
||||
for arch in ${architectures}
|
||||
do
|
||||
if [ "${ASAN_CMAKE_PARAMS}" == "true" ] ; then
|
||||
cmake -DBUILD_DEV=OFF \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH%-*}/lib/cmake;${ROCM_PATH%-*}/$ASAN_LIBDIR;${ROCM_PATH%-*}/llvm;${ROCM_PATH%-*}" \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-'RelWithDebInfo'} \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--enable-new-dtags,--rpath,$ROCM_ASAN_LIB_RPATH" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS_INIT="-Wl,--enable-new-dtags,--rpath,$ROCM_ASAN_EXE_RPATH" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE \
|
||||
-DCMAKE_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DCMAKE_PACKAGING_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
|
||||
-DROCM_SYMLINK_LIBS=OFF \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DROCM_DISABLE_LDCONFIG=ON \
|
||||
-DROCM_PATH="${ROCM_PATH}" \
|
||||
-DCPACK_GENERATOR="${PKGTYPE^^}" \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DPROFILER_ONLY=ON \
|
||||
-DENABLE_ASAN_PACKAGING=true \
|
||||
-DGPU_ARCH="${arch}" \
|
||||
"$COMPONENT_SRC"
|
||||
else
|
||||
cmake -DBUILD_DEV=OFF \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH%-*}" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT='-Wl,--enable-new-dtags,--rpath,$ORIGIN' \
|
||||
-DCMAKE_EXE_LINKER_FLAGS_INIT='-Wl,--enable-new-dtags,--rpath,$ORIGIN/../lib' \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE \
|
||||
-DCMAKE_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DCMAKE_PACKAGING_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
|
||||
-DROCM_SYMLINK_LIBS=OFF \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DROCM_DISABLE_LDCONFIG=ON \
|
||||
-DROCM_PATH="${ROCM_PATH}" \
|
||||
-DCPACK_GENERATOR="${PKGTYPE^^}" \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DPROFILER_ONLY=ON \
|
||||
-DGPU_ARCH="${arch}" \
|
||||
"$COMPONENT_SRC"
|
||||
fi
|
||||
|
||||
cmake --build . -- -j${PROC} package
|
||||
cp ./*ckprofiler*.${PKGTYPE} $PACKAGE_DIR
|
||||
rm -rf *
|
||||
done
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
|
||||
echo "Finished building Composable Kernel"
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
clean_miopen_ck() {
|
||||
echo "Cleaning MIOpen-CK build directory: ${BUILD_DIR} ${PACKAGE_DIR}"
|
||||
rm -rf "$BUILD_DIR" "$PACKAGE_DIR"
|
||||
@@ -156,7 +90,7 @@ clean_miopen_ck() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_miopen_ck ;;
|
||||
build) build_miopen_ck; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_miopen_ck ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -11,6 +11,8 @@ printUsage() {
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " --enable-assertions Enable assertions"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -w, --wheel Creates python wheel package of dbgapi.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
@@ -25,6 +27,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME=rocm-dbgapi
|
||||
AMD_DBGAPI_NAME=amd-dbgapi
|
||||
MAKEINSTALL_MANIFEST=makeinstall_manifest.txt
|
||||
@@ -36,21 +39,24 @@ PACKAGE_ROOT=$(getPackageRoot)
|
||||
PACKAGE_LIB=$(getLibPath)
|
||||
PACKAGE_INCLUDE=$(getIncludePath)
|
||||
BUILD_DIR=$(getBuildPath $API_NAME)
|
||||
PACKAGE_DEB=$(getPackageRoot)/deb/$API_NAME
|
||||
PACKAGE_RPM=$(getPackageRoot)/rpm/$API_NAME
|
||||
PACKAGE_DEB=$(getPackageRoot)/deb/$PROJ_NAME
|
||||
PACKAGE_RPM=$(getPackageRoot)/rpm/$PROJ_NAME
|
||||
#PACKAGE_PREFIX=$ROCM_INSTALL_PATH
|
||||
BUILD_TYPE=Debug
|
||||
MAKE_OPTS=($DASH_JAY -C "$BUILD_DIR")
|
||||
MAKE_OPTS=($DASH_JAY -C "$BUILD_DIR") # Note that DASH_JAY might have a space after the -j
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
DODOCSBUILD=true
|
||||
|
||||
VALID_STR=$(getopt -o hcraso:p:M --long help,clean,release,enable-assertions,static,address_sanitizer,outdir:,package:skip_man_pages -- "$@")
|
||||
#parse the arguments
|
||||
VALID_STR=$(getopt -o hcraswo:p:M --long help,clean,release,enable-assertions,static,wheel,address_sanitizer,outdir:,package:skip_man_pages -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -66,12 +72,14 @@ do
|
||||
set_address_sanitizer_on ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; ((CLEAN_OR_OUT|=2)) ; shift 1 ;;
|
||||
(-M | --skip_man_pages) DODOCSBUILD=false;;
|
||||
(-p | --package)
|
||||
MAKETARGET="$2" ; shift 1;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -104,7 +112,7 @@ build() {
|
||||
then
|
||||
echo " No $ROCM_DBGAPI_ROOT/CMakeLists.txt file, skipping rocm-dbgapi" >&2
|
||||
echo " No $ROCM_DBGAPI_ROOT/CMakeLists.txt file, skipping rocm-dbgapi"
|
||||
exit 0
|
||||
exit 0 # THis is not an error
|
||||
fi
|
||||
echo "Building $PROJ_NAME"
|
||||
|
||||
@@ -121,11 +129,14 @@ build() {
|
||||
cmake --build "$BUILD_DIR" -- "${MAKE_OPTS[@]}"
|
||||
"$DODOCSBUILD" && cmake --build "$BUILD_DIR" -- "${MAKE_OPTS[@]}" doc
|
||||
cmake --build "$BUILD_DIR" -- "${MAKE_OPTS[@]}" install
|
||||
|
||||
#install_manifest.txt is created by make install and make package with same name unless
|
||||
#component packaging is enabled. To avoid overwriting by make package,move the manifest file
|
||||
#to a different name and can be used for build clean up
|
||||
mv "$BUILD_DIR/install_manifest.txt" "$BUILD_DIR/$MAKEINSTALL_MANIFEST"
|
||||
cmake --build "$BUILD_DIR" -- "${MAKE_OPTS[@]}" package
|
||||
|
||||
mkdir -p "$PACKAGE_LIB"
|
||||
# handle the library being in more than one place to avoid breaking the build.
|
||||
(
|
||||
shopt -s nullglob
|
||||
cp -R "$BUILD_DIR/lib/${LIB_NAME}"* "$BUILD_DIR/${LIB_NAME}"* "$PACKAGE_LIB"
|
||||
@@ -151,7 +162,7 @@ verifyEnvSetup
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean ;;
|
||||
(build) build ;;
|
||||
(build) build; build_wheel "$BUILD_DIR" "$PROJ_NAME";;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -10,7 +10,9 @@ printUsage() {
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -r, --release Build a release version of the package"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -w, --wheel Creates python wheel package of devicelibs.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
@@ -19,10 +21,11 @@ printUsage() {
|
||||
|
||||
return 0
|
||||
}
|
||||
PROJ_NAME="devicelibs"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_BIN="$(getBinPath)"
|
||||
PACKAGE_LIB="$(getLibPath)"
|
||||
BUILD_PATH="$(getBuildPath devicelibs)"
|
||||
BUILD_PATH="$(getBuildPath $PROJ_NAME)"
|
||||
INSTALL_PATH="$(getPackageRoot)"
|
||||
LIGHTNING_BUILD_PATH="$(getBuildPath lightning)"
|
||||
DEB_PATH="$(getDebPath devicelibs)"
|
||||
@@ -36,11 +39,13 @@ CLEAN_OR_OUT=0;
|
||||
PKGTYPE="deb"
|
||||
MAKETARGET="deb"
|
||||
|
||||
VALID_STR=`getopt -o hcraso: --long help,clean,release,static,address_sanitizer,outdir: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo: --long help,clean,release,static,wheel,address_sanitizer,outdir: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -53,6 +58,8 @@ do
|
||||
ack_and_ignore_asan ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
--) shift; break;; # end delimiter
|
||||
@@ -71,7 +78,9 @@ fi
|
||||
|
||||
|
||||
clean_devicelibs() {
|
||||
# Delete cmake output directory
|
||||
rm -rf "$BUILD_PATH"
|
||||
# Delete the *.bc files from the PACKAGE_LIB directory
|
||||
rm -f $PACKAGE_LIB/hc*.bc
|
||||
rm -f $PACKAGE_LIB/irif*.bc
|
||||
rm -f $PACKAGE_LIB/ockl*.bc
|
||||
@@ -80,6 +89,7 @@ clean_devicelibs() {
|
||||
rm -f $PACKAGE_LIB/opencl*.bc
|
||||
rm -f $PACKAGE_LIB/openmp*.bc
|
||||
rm -rf $PACKAGE_ROOT/amdgcn
|
||||
# Delete any packages generated
|
||||
rm -rf "$DEB_PATH"
|
||||
rm -rf "$RPM_PATH"
|
||||
}
|
||||
@@ -96,6 +106,7 @@ build_devicelibs() {
|
||||
if [ ! -e Makefile ]; then
|
||||
cmake $(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
${GEN_NINJA} \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW="$bitcodeInstallLoc/amdgcn" \
|
||||
-DROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD="amdgcn" \
|
||||
@@ -133,7 +144,7 @@ print_output_directory() {
|
||||
}
|
||||
case $TARGET in
|
||||
(clean) clean_devicelibs ;;
|
||||
(build) build_devicelibs; package_devicelibs ;;
|
||||
(build) build_devicelibs; package_devicelibs; build_wheel "$BUILD_PATH" "$PROJ_NAME" ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -1,22 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src half
|
||||
|
||||
build_half() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# ASAN packaging is not required for HALF, since its header only package
|
||||
# Setting the asan_cmake_params to false will disable ASAN packaging
|
||||
ASAN_CMAKE_PARAMS="false"
|
||||
fi
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX="$ROCM_PATH" \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX=${ROCM_PATH}\
|
||||
-DCPACK_SET_DESTDIR="OFF" \
|
||||
-DCPACK_RPM_PACKAGE_RELOCATABLE="ON" \
|
||||
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
@@ -25,7 +34,7 @@ build_half() {
|
||||
cmake --build "$BUILD_DIR" -- install
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -39,7 +48,7 @@ clean_half() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_half ;;
|
||||
build) build_half; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_half ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -10,6 +10,8 @@ printUsage() {
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -w, --wheel Creates python wheel package of hip-on-rocclr.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of type referred to by pkg_type"
|
||||
echo " -t, --offload-arch=<arch> Specify arch for catch tests ex: --offload-arch=gfx1030 --offload-arch=gfx1100"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
@@ -25,7 +27,6 @@ printUsage() {
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
PROJ_NAME="hip-on-rocclr"
|
||||
|
||||
BUILD_PATH="$(getBuildPath $PROJ_NAME)"
|
||||
|
||||
TARGET="build"
|
||||
@@ -36,7 +37,6 @@ PACKAGE_RPM="$PACKAGE_ROOT/rpm/$PROJ_NAME"
|
||||
PREFIX_PATH="$PACKAGE_ROOT"
|
||||
CORE_BUILD_DIR="$(getBuildPath hsa-core)"
|
||||
ROCclr_BUILD_DIR="$(getBuildPath rocclr)"
|
||||
HIPCC_BUILD_DIR="$(getBuildPath hipcc)"
|
||||
CATCH_BUILD_DIR="$(getBuildPath catch)"
|
||||
CATCH_SRC="$HIP_CATCH_TESTS_ROOT/catch"
|
||||
SAMPLES_SRC="$HIP_CATCH_TESTS_ROOT/samples"
|
||||
@@ -53,9 +53,10 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
OFFLOAD_ARCH=()
|
||||
|
||||
DEFAULT_OFFLOAD_ARCH=(gfx900 gfx906 gfx908 gfx90a gfx940 gfx941 gfx942 gfx1030 gfx1031 gfx1033 gfx1034 gfx1035 gfx1100 gfx1101 gfx1102 gfx1200 gfx1201)
|
||||
DEFAULT_OFFLOAD_ARCH=(gfx900 gfx906 gfx908 gfx90a gfx942 gfx1030 gfx1031 gfx1033 gfx1034 gfx1035 gfx1100 gfx1101 gfx1102 gfx1103 gfx1150 gfx1151 gfx1200 gfx1201)
|
||||
|
||||
VALID_STR=`getopt -o hcrast:o: --long help,clean,release,address_sanitizer,static,offload-arch=:,outdir: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswt:o: --long help,clean,release,address_sanitizer,static,wheel,offload-arch=:,outdir: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
@@ -72,11 +73,13 @@ do
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-t | --offload-arch=)
|
||||
OFFLOAD_ARCH+=( "$2" ); ((CLEAN_OR_OUT|=2)); shift 2 ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
@@ -98,7 +101,10 @@ if [ $RET_CONFLICT -ge 30 ]; then
|
||||
exit $RET_CONFLICT
|
||||
fi
|
||||
|
||||
|
||||
|
||||
clean_hip_on_rocclr() {
|
||||
# Delete cmake output directory
|
||||
rm -rf "$BUILD_PATH"
|
||||
rm -rf "$PACKAGE_DEB"
|
||||
rm -rf "$PACKAGE_RPM"
|
||||
@@ -106,17 +112,23 @@ clean_hip_on_rocclr() {
|
||||
}
|
||||
|
||||
build_hip_on_rocclr() {
|
||||
# TODO This if condition is a temporary workaround so that mainline builds dont error out
|
||||
# until build migrated from hipamd to clr repo
|
||||
if [ -e "$CLR_ROOT/CMakeLists.txt" ]; then
|
||||
# We are in a branch that has migrated to clr repo
|
||||
_HIP_CMAKELIST_DIR="$CLR_ROOT"
|
||||
_HIP_CMAKELIST_OPT="-DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF"
|
||||
if [ -e "$HIPOTHER_ROOT/hipnv" ]; then
|
||||
# We are in a branch that has hipnv headers migrated
|
||||
_HIP_CMAKELIST_OPT="$_HIP_CMAKELIST_OPT -DHIPNV_DIR=$HIPOTHER_ROOT/hipnv"
|
||||
fi
|
||||
elif [ ! -e "$HIPAMD_ROOT/CMakeLists.txt" ]; then
|
||||
# We seem to have hit a branch in which both the old and the new repo don't exist
|
||||
echo "No $HIPAMD_ROOT/CMakeLists.txt file, skipping hip on rocclr" >&2
|
||||
echo "No $HIPAMD_ROOT/CMakeLists.txt file, skipping hip on rocclr"
|
||||
exit 0
|
||||
exit 0 # This is not an error
|
||||
else
|
||||
# We are in a branch that has not yet migrated to clr repo yet
|
||||
_HIP_CMAKELIST_DIR="$HIPAMD_ROOT"
|
||||
_HIP_CMAKELIST_OPT=""
|
||||
fi
|
||||
@@ -125,6 +137,7 @@ build_hip_on_rocclr() {
|
||||
mkdir -p "$BUILD_PATH"
|
||||
pushd "$BUILD_PATH"
|
||||
|
||||
# FIXME: Remove -DROCclr_DIR/LIBROCclr_STATIC_DIR
|
||||
if [ ! -e Makefile ]; then
|
||||
echo "Building HIP-On-ROCclr CMake environment"
|
||||
print_lib_type $SHARED_LIBS
|
||||
@@ -140,7 +153,7 @@ build_hip_on_rocclr() {
|
||||
-DCMAKE_SKIP_BUILD_RPATH=TRUE \
|
||||
-DCPACK_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
-DROCM_PATH="$ROCM_INSTALL_PATH" \
|
||||
-DHIPCC_BIN_DIR="$HIPCC_BUILD_DIR" \
|
||||
-DHIPCC_BIN_DIR="$ROCM_PATH/bin" \
|
||||
-DHIP_CATCH_TEST=1 \
|
||||
$_HIP_CMAKELIST_OPT \
|
||||
"$_HIP_CMAKELIST_DIR"
|
||||
@@ -165,8 +178,13 @@ build_catch_tests() {
|
||||
rm -rf "$CATCH_BUILD_DIR"
|
||||
mkdir -p "$CATCH_BUILD_DIR"
|
||||
pushd "$CATCH_BUILD_DIR"
|
||||
# use the newly built hip as HIP for catch
|
||||
export HIP_PATH="$ROCM_INSTALL_PATH"
|
||||
export ROCM_PATH="$ROCM_INSTALL_PATH"
|
||||
# Note: The rocm_common_cmake_params will provide CMAKE_EXE_LINKER_FLAGS_INIT
|
||||
# for binaries located in /opt/rocm/bin
|
||||
# hip-catch binaries are located in each test folder under /opt/rocm/share/hip/catch_test/
|
||||
# Append the EXE LINKER flags with ROCm library path
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
@@ -177,6 +195,7 @@ build_catch_tests() {
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCPACK_RPM_DEBUGINFO_PACKAGE=FALSE \
|
||||
-DCPACK_DEBIAN_DEBUGINFO_PACKAGE=FALSE \
|
||||
-DCMAKE_EXE_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_EXE_RPATH:$ROCM_INSTALL_PATH/lib:/opt/rocm/lib \
|
||||
-DCPACK_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
"$CATCH_SRC"
|
||||
|
||||
@@ -190,6 +209,7 @@ build_catch_tests() {
|
||||
}
|
||||
|
||||
package_samples() {
|
||||
# TODO: To be removed once the issue related to ASAN builds are fixed
|
||||
if [ "$ASAN_CMAKE_PARAMS" == "true" ] ; then
|
||||
echo "Disable the packaging of HIP samples" >&2
|
||||
return
|
||||
@@ -198,13 +218,17 @@ package_samples() {
|
||||
if [ ! -e "$SAMPLES_SRC/CMakeLists.txt" ]; then
|
||||
echo "HIP samples source not found at: $SAMPLES_SRC" >&2
|
||||
echo "Using samples package from hip project: $BUILD_PATH" >&2
|
||||
# TODO: change to return failure after hip-tests samples change is available in mainline
|
||||
return
|
||||
fi
|
||||
|
||||
# package samples
|
||||
rm -rf "$SAMPLES_BUILD_DIR"
|
||||
mkdir -p "$SAMPLES_BUILD_DIR"
|
||||
pushd "$SAMPLES_BUILD_DIR"
|
||||
# The cmake path is different for asan and non-asan builds.
|
||||
# Fetch after getting build type. Default will be non-asan build
|
||||
local CMAKE_PATH="$(getCmakePath)"
|
||||
# use the newly built hip as HIP for samples
|
||||
export HIP_PATH="$ROCM_INSTALL_PATH"
|
||||
export ROCM_PATH="$ROCM_INSTALL_PATH"
|
||||
cmake \
|
||||
@@ -291,10 +315,24 @@ print_output_directory() {
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_hip_on_rocclr; clean_hip_tests ;;
|
||||
(build) build_hip_on_rocclr; build_catch_tests; package_hip_on_rocclr; package_samples; copy_hip_tests;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
(clean)
|
||||
clean_hip_on_rocclr
|
||||
clean_hip_tests
|
||||
;;
|
||||
(build)
|
||||
build_hip_on_rocclr
|
||||
build_catch_tests
|
||||
package_hip_on_rocclr
|
||||
package_samples
|
||||
build_wheel "$BUILD_PATH" "$PROJ_NAME"
|
||||
copy_hip_tests
|
||||
;;
|
||||
(outdir)
|
||||
print_output_directory
|
||||
;;
|
||||
(*)
|
||||
die "Invalid target $TARGET"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -2,26 +2,29 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipBLAS-common
|
||||
|
||||
build_hipblas-common() {
|
||||
echo "Start build"
|
||||
|
||||
CXX=$(set_build_variables __C_++__)
|
||||
cd $COMPONENT_SRC
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
echo "C compiler: $CC"
|
||||
echo "CXX compiler: $CXX"
|
||||
init_rocm_common_cmake_params
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
"$COMPONENT_SRC"
|
||||
cmake --build "$BUILD_DIR" -- install
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
@@ -34,7 +37,7 @@ clean_hipblas-common() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipblas-common ;;
|
||||
build) build_hipblas-common; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipblas-common ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,28 +2,32 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipBLAS
|
||||
|
||||
build_hipblas() {
|
||||
echo "Start build"
|
||||
|
||||
CXX="g++"
|
||||
CXX=$(set_build_variables __G_++__)
|
||||
CXX_FLAG=
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
CXX="amdclang++"
|
||||
CXX_FLAG="-DCMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++"
|
||||
CXX=$(set_build_variables __AMD_CLANG_++__)
|
||||
CXX_FLAG=$(set_build_variables __CMAKE_CXX_PARAMS__)
|
||||
fi
|
||||
|
||||
CLIENTS_SAMPLES="ON"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# fixme: remove CLIENTS_SAMPLES=OFF once SWDEV-417076 is fixed
|
||||
CLIENTS_SAMPLES="OFF"
|
||||
fi
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
echo "C compiler: $CC"
|
||||
echo "CXX compiler: $CXX"
|
||||
@@ -39,10 +43,10 @@ build_hipblas() {
|
||||
init_rocm_common_cmake_params
|
||||
cmake \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DUSE_CUDA=OFF \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DBUILD_CLIENTS_SAMPLES="${CLIENTS_SAMPLES}" \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
@@ -54,7 +58,7 @@ build_hipblas() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -68,7 +72,7 @@ clean_hipblas() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipblas ;;
|
||||
build) build_hipblas; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipblas ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipBLASLt
|
||||
|
||||
#not enabling the debug files by defalut
|
||||
disable_debug_package_generation
|
||||
# if ENABLE_GPU_ARCH is set in env by Job parameter ENABLE_GPU_ARCH, then set GFX_ARCH to that value
|
||||
if [ -n "$ENABLE_GPU_ARCH" ]; then
|
||||
set_gpu_arch "$ENABLE_GPU_ARCH"
|
||||
else
|
||||
# gfx90a:xnack+;gfx90a:xnack-;gfx942
|
||||
set_gpu_arch "all"
|
||||
fi
|
||||
|
||||
build_hipblaslt() {
|
||||
echo "Start build"
|
||||
|
||||
@@ -20,31 +30,31 @@ build_hipblaslt() {
|
||||
cd $COMPONENT_SRC
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
rebuild_lapack
|
||||
fi
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
# gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942
|
||||
GPU_TARGETS=all
|
||||
# hipblaslt requiring Python 3.12.
|
||||
# Point CMake to that explicit location and adjust LD_LIBRARY_PATH.
|
||||
if [ "$DISTRO_ID" = "rhel-8.8" ] || [ "$DISTRO_NAME" == "sles" ] || \
|
||||
[ "$DISTRO_ID" = "rhel-9.1" ] || [ "$DISTRO_ID" = "almalinux-8.10" ] || \
|
||||
[ "$DISTRO_ID" = "debian-10" ]; then
|
||||
EXTRA_PYTHON_PATH=/opt/Python-3.12.7
|
||||
EXTRA_CMAKE_OPTIONS="-DPython_ROOT=/opt/Python-3.12.7"
|
||||
export LD_LIBRARY_PATH=${EXTRA_PYTHON_PATH}/lib
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
CXX=$(set_build_variables CXX)\
|
||||
CXX=$(set_build_variables __CXX__)\
|
||||
cmake \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DTensile_LOGIC= \
|
||||
-DTensile_CODE_OBJECT_VERSION=default \
|
||||
-DTensile_CPU_THREADS= \
|
||||
-DTensile_CODE_OBJECT_VERSION=4 \
|
||||
-DTensile_CPU_THREADS=$((PROC / 4)) \
|
||||
-DTensile_LIBRARY_FORMAT=msgpack \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DLINK_BLIS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
${EXTRA_CMAKE_OPTIONS} \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
@@ -52,8 +62,7 @@ build_hipblaslt() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
@@ -66,7 +75,7 @@ clean_hipblaslt() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipblaslt ;;
|
||||
build) build_hipblaslt; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipblaslt ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -9,6 +9,8 @@ printUsage() {
|
||||
echo "Options:"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -w, --wheel Creates python wheel package of hipcc.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -r, --release Makes a release build"
|
||||
@@ -21,6 +23,7 @@ printUsage() {
|
||||
}
|
||||
|
||||
|
||||
## Build environment variables
|
||||
API_NAME=hipcc
|
||||
PROJ_NAME=$API_NAME
|
||||
|
||||
@@ -29,10 +32,11 @@ MAKEOPTS="$DASH_JAY"
|
||||
BUILD_TYPE="Debug"
|
||||
SHARED_LIBS="ON"
|
||||
BUILD_DIR=$(getBuildPath $API_NAME)
|
||||
PACKAGE_DEB=$(getPackageRoot)/deb/$API_NAME
|
||||
PACKAGE_RPM=$(getPackageRoot)/rpm/$API_NAME
|
||||
PACKAGE_DEB=$(getPackageRoot)/deb/$PROJ_NAME
|
||||
PACKAGE_RPM=$(getPackageRoot)/rpm/$PROJ_NAME
|
||||
PACKAGE_SRC="$(getSrcPath)"
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,address_sanitizer,static,outdir,wheel:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
@@ -45,13 +49,15 @@ do
|
||||
TARGET="clean" ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 1 ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ;;
|
||||
(-r | --release)
|
||||
BUILD_TYPE="RelWithDebInfo" ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ;;
|
||||
(-h | --help)
|
||||
printUsage ; exit 0 ;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo "Invalid option [$1]" >&2; printUsage; exit 1 ;;
|
||||
esac
|
||||
@@ -87,11 +93,12 @@ build() {
|
||||
fi
|
||||
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DHIPCC_BACKWARD_COMPATIBILITY=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX="$OUT_DIR" \
|
||||
-DCMAKE_INSTALL_PREFIX="$ROCM_PATH" \
|
||||
$HIPCC_ROOT
|
||||
popd
|
||||
|
||||
@@ -118,10 +125,20 @@ print_output_directory() {
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean ;;
|
||||
(build) build ; copy_hipcc_sources ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
(clean)
|
||||
clean
|
||||
;;
|
||||
(build)
|
||||
build
|
||||
build_wheel "$BUILD_DIR" "$PROJ_NAME"
|
||||
copy_hipcc_sources
|
||||
;;
|
||||
(outdir)
|
||||
print_output_directory
|
||||
;;
|
||||
(*)
|
||||
die "Invalid target $TARGET"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipCUB
|
||||
|
||||
@@ -17,26 +17,22 @@ build_hipcub() {
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# ASAN packaging is not required for HIPCUB, since its header only package
|
||||
# Setting the asan_cmake_params to false will disable ASAN packaging
|
||||
ASAN_CMAKE_PARAMS="false"
|
||||
fi
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
CXX=$(set_build_variables CXX)\
|
||||
CXX=$(set_build_variables __CXX__)\
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DCMAKE_MODULE_PATH="${ROCM_PATH}/lib/cmake/hip;${ROCM_PATH}/hip/cmake" \
|
||||
-Drocprim_DIR="${ROCM_PATH}/rocprim" \
|
||||
-DBUILD_TEST=ON \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
@@ -44,7 +40,7 @@ build_hipcub() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -58,7 +54,7 @@ clean_hipcub() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipcub ;;
|
||||
build) build_hipcub; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipcub ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,13 +2,17 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipFFT
|
||||
|
||||
build_hipfft() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -18,17 +22,10 @@ build_hipfft() {
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
cmake \
|
||||
-DCMAKE_CXX_COMPILER=$(set_build_variables CXX) \
|
||||
"$(set_build_variables __CMAKE_CXX_PARAMS__)" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DCMAKE_MODULE_PATH="${ROCM_PATH}/lib/cmake/hip" \
|
||||
-DCMAKE_SKIP_BUILD_RPATH=TRUE \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
@@ -41,7 +38,7 @@ build_hipfft() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -55,7 +52,7 @@ clean_hipfft() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipfft ;;
|
||||
build) build_hipfft; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipfft ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipfort
|
||||
|
||||
build_hipfort() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
@@ -26,7 +31,7 @@ build_hipfort() {
|
||||
-DCMAKE_Fortran_FLAGS_DEBUG="" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DROCM_SYMLINK_LIBS=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DCMAKE_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DHIPFORT_AR="${ROCM_PATH}/${ROCM_LLVMDIR}/bin/llvm-ar" \
|
||||
-DHIPFORT_RANLIB="${ROCM_PATH}/${ROCM_LLVMDIR}/bin/llvm-ranlib" \
|
||||
"$COMPONENT_SRC"
|
||||
@@ -36,7 +41,7 @@ build_hipfort() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -50,7 +55,7 @@ clean_hipfort() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipfort ;;
|
||||
build) build_hipfort; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipfort ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -10,22 +10,33 @@ printUsage() {
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -r, --release Make a release build"
|
||||
echo " -r, --release Make a release build"
|
||||
echo " -n, --skip_hipify_tests Skip hipify-clang testing"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -i, --clang_headers Install clang headers"
|
||||
echo " -w, --wheel Creates python wheel package of hipify-clang.
|
||||
It needs to be used along with -r option"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Build Environmental Variables
|
||||
PROJ_NAME="hipify"
|
||||
TARGET="build"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
NINJAOPTS="$DASH_JAY"
|
||||
HIPIFY_CLANG_BUILD_DIR="$(getBuildPath $HIPIFY_ROOT)"
|
||||
BUILD_TYPE="Debug"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
HIPIFY_CLANG_HASH=""
|
||||
LIGHTNING_PATH="$ROCM_INSTALL_PATH/llvm"
|
||||
LIGHTNING_BUILD_PATH="$PACKAGE_ROOT/build/lightning"
|
||||
RUN_HIPIFY_TESTS=true
|
||||
CUDA_DEFAULT_VERSION="12.3.2"
|
||||
CUDNN_DEFAULT_VERSION="9.2.0"
|
||||
GCC_MIN_VERSION="9.2"
|
||||
ADDRESS_SANITIZER=false
|
||||
INSTALL_CLANG_HEADERS="OFF"
|
||||
DEB_PATH="$(getDebPath hipify)"
|
||||
@@ -36,7 +47,8 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
|
||||
VALID_STR=`getopt -o hcraso: --long help,clean,release,static,address_sanitizer,outdir: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcrnawsio: --long help,clean,release,skip_hipify_tests,wheel,static,address_sanitizer,clang_headers,outdir: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
@@ -48,15 +60,21 @@ do
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
(-r | --release)
|
||||
BUILD_TYPE="RelWithDebInfo" ; shift ;;
|
||||
(-n | --skip_hipify_tests)
|
||||
RUN_HIPIFY_TESTS=false; shift ;;
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
ADDRESS_SANITIZER=true ; shift ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-i | --clang_headers)
|
||||
INSTALL_CLANG_HEADERS="ON" ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -79,6 +97,7 @@ clean_hipify() {
|
||||
}
|
||||
|
||||
package_hipify() {
|
||||
# set-up dirs
|
||||
if [ "$PACKAGEEXT" = "deb" ]; then
|
||||
rm -rf "$DEB_PATH"
|
||||
mkdir -p "$DEB_PATH"
|
||||
@@ -89,8 +108,9 @@ package_hipify() {
|
||||
mkdir -p "$RPM_PATH"
|
||||
fi
|
||||
|
||||
# make the pkg
|
||||
pushd "$HIPIFY_CLANG_BUILD_DIR"
|
||||
make $MAKEOPTS package_hipify-clang
|
||||
ninja $NINJAOPTS package_hipify-clang
|
||||
popd
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$DEB_PATH" $HIPIFY_CLANG_BUILD_DIR/hipify*.deb
|
||||
@@ -102,7 +122,38 @@ build_hipify() {
|
||||
mkdir -p "$HIPIFY_CLANG_BUILD_DIR"
|
||||
|
||||
pushd "$HIPIFY_CLANG_BUILD_DIR"
|
||||
|
||||
# Check the installed GCC version
|
||||
INSTALLED_GCC_VERSION=$(gcc --version | head -n 1 | sed -E 's/[^0-9]*([0-9]+\.[0-9]+).*/\1/')
|
||||
if echo "$INSTALLED_GCC_VERSION $GCC_MIN_VERSION" | awk '{exit !($1 < $2)}'; then
|
||||
RUN_HIPIFY_TESTS=false
|
||||
echo "Minimum required GCC version: $GCC_MIN_VERSION"
|
||||
echo "Installed GCC version $INSTALLED_GCC_VERSION does not meet the minimum GCC version requirement."
|
||||
echo "Skipping hipify tests"
|
||||
fi
|
||||
|
||||
if $ADDRESS_SANITIZER ; then
|
||||
echo "Skipping hipify tests becasue of Address Sanitizer"
|
||||
RUN_HIPIFY_TESTS=false
|
||||
fi
|
||||
|
||||
if $RUN_HIPIFY_TESTS ; then
|
||||
# TODO: Add option for user defined cuda version?
|
||||
CUDA_VERSION="${CUDA_DEFAULT_VERSION}"
|
||||
CUDNN_VERSION="${CUDNN_DEFAULT_VERSION}"
|
||||
|
||||
if [[ "$DISTRO_ID" == "rhel-8"* || "$DISTRO_NAME" == "sles" || "$DISTRO_ID" == "debian-10" ]]; then
|
||||
EXTRA_PYTHON_PATH=/opt/Python-3.8.13
|
||||
export LD_LIBRARY_PATH=${EXTRA_PYTHON_PATH}/lib:$LD_LIBRARY_PATH
|
||||
fi
|
||||
|
||||
echo "Copy FileCheck into ROCM_INSTALL_PATH"
|
||||
cp "$LIGHTNING_BUILD_PATH/bin/FileCheck" "$LIGHTNING_PATH/bin/FileCheck"
|
||||
fi
|
||||
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
-DHIPIFY_CLANG_TESTS="$RUN_HIPIFY_TESTS" \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCMAKE_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
@@ -110,10 +161,20 @@ build_hipify() {
|
||||
-DCMAKE_PREFIX_PATH="$LIGHTNING_PATH" \
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
-DHIPIFY_INSTALL_CLANG_HEADERS="$INSTALL_CLANG_HEADERS" \
|
||||
-DCUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-${CUDA_DEFAULT_VERSION}" \
|
||||
-DCUDA_DNN_ROOT_DIR="/usr/local/cuDNN/${CUDNN_DEFAULT_VERSION}" \
|
||||
-DCUDA_CUB_ROOT_DIR="/usr/local/cuda-${CUDA_DEFAULT_VERSION}" \
|
||||
-DLLVM_EXTERNAL_LIT="${LIGHTNING_BUILD_PATH}/bin/llvm-lit" \
|
||||
$HIPIFY_ROOT
|
||||
|
||||
cmake --build . -- $MAKEOPTS install
|
||||
if $RUN_HIPIFY_TESTS ; then
|
||||
echo "Running hipify tests"
|
||||
cmake --build . -- $NINJAOPTS test-hipify
|
||||
fi
|
||||
|
||||
cmake --build . -- $NINJAOPTS install
|
||||
popd
|
||||
|
||||
pushd "$HIPIFY_ROOT"
|
||||
HIPIFY_CLANG_HASH=`git describe --dirty --long --match [0-9]* --always`
|
||||
popd
|
||||
@@ -132,10 +193,20 @@ print_output_directory() {
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_hipify ;;
|
||||
(build) build_hipify; package_hipify ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
(clean)
|
||||
clean_hipify
|
||||
;;
|
||||
(build)
|
||||
build_hipify
|
||||
package_hipify
|
||||
build_wheel "$HIPIFY_CLANG_BUILD_DIR" "$PROJ_NAME"
|
||||
;;
|
||||
(outdir)
|
||||
print_output_directory
|
||||
;;
|
||||
(*)
|
||||
die "Invalid target $TARGET"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipRAND
|
||||
|
||||
@@ -41,17 +41,10 @@ build_hiprand() {
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
CXX=$(set_build_variables CXX)\
|
||||
CXX=$(set_build_variables __CXX__)\
|
||||
cmake \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DBUILD_TEST=ON \
|
||||
-DBUILD_BENCHMARK=ON \
|
||||
@@ -67,7 +60,7 @@ build_hiprand() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
}
|
||||
|
||||
clean_hiprand() {
|
||||
@@ -89,7 +82,7 @@ print_output_directory() {
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
build) build_hiprand ;;
|
||||
build) build_hiprand; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hiprand ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipSOLVER
|
||||
|
||||
@@ -10,12 +10,12 @@ build_hipsolver() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
CXX_FLAG="-DCMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++"
|
||||
CXX_FLAG=$(set_build_variables __CMAKE_CXX_PARAMS__)
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
CXX="amdclang++"
|
||||
CXX=$(set_build_variables __AMD_CLANG_++__)
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -39,7 +39,7 @@ build_hipsolver() {
|
||||
init_rocm_common_cmake_params
|
||||
cmake \
|
||||
-DUSE_CUDA=OFF \
|
||||
-DCMAKE_CXX_COMPILER=${CXX} \
|
||||
-DCMAKE_CXX_COMPILER=${CXX} \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
@@ -55,7 +55,7 @@ build_hipsolver() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -69,7 +69,7 @@ clean_hipsolver() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipsolver ;;
|
||||
build) build_hipsolver; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipsolver ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
PATH=${ROCM_PATH}/bin:$PATH
|
||||
set_component_src hipSPARSE
|
||||
@@ -10,12 +10,12 @@ set_component_src hipSPARSE
|
||||
build_hipsparse() {
|
||||
echo "Start build"
|
||||
|
||||
CXX="g++"
|
||||
CXX=$(set_build_variables __G_++__)
|
||||
CXX_FLAG=
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
CXX="${ROCM_PATH}/llvm/bin/clang++"
|
||||
CXX_FLAG="-DCMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++"
|
||||
CXX=$(set_build_variables __CXX__)
|
||||
CXX_FLAG=$(set_build_variables __CMAKE_CXX_PARAMS__)
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
@@ -54,7 +54,7 @@ build_hipsparse() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -68,7 +68,7 @@ clean_hipsparse() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipsparse ;;
|
||||
build) build_hipsparse; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipsparse ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipSPARSELt
|
||||
|
||||
disable_debug_package_generation
|
||||
# if ENABLE_GPU_ARCH is set in env by Job parameter ENABLE_GPU_ARCH, then set GFX_ARCH to that value
|
||||
if [ -n "$ENABLE_GPU_ARCH" ]; then
|
||||
set_gpu_arch "$ENABLE_GPU_ARCH"
|
||||
else
|
||||
# gfx90a:xnack+;gfx90a:xnack-;gfx942
|
||||
set_gpu_arch "all"
|
||||
fi
|
||||
while [ "$1" != "" ];
|
||||
do
|
||||
case $1 in
|
||||
@@ -18,6 +26,31 @@ do
|
||||
shift 1
|
||||
done
|
||||
|
||||
create_blis_link()
|
||||
{
|
||||
#find the pre-installed blis library and create the link under $BUILD_DIR/deps/blis
|
||||
BLIS_REF_ROOT="$BUILD_DIR/deps/blis"
|
||||
mkdir -p "$BLIS_REF_ROOT"/include
|
||||
for blis_path in "/opt/AMD/aocl/aocl-linux-gcc-4.2.0/gcc" \
|
||||
"/opt/AMD/aocl/aocl-linux-gcc-4.1.0/gcc" \
|
||||
"/opt/AMD/aocl/aocl-linux-gcc-4.0.0/gcc";
|
||||
do
|
||||
if [ -e "${blis_path}/lib_ILP64/libblis-mt.a" ] ; then
|
||||
ln -sf "${blis_path}/include_ILP64" "${BLIS_REF_ROOT}/include/blis"
|
||||
ln -sf "${blis_path}/lib_ILP64" "${BLIS_REF_ROOT}/lib"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -e "/usr/local/lib/libblis.a" ]]; then
|
||||
ln -sf /usr/local/include/blis ${BLIS_REF_ROOT}/include/blis
|
||||
ln -sf /usr/local/lib ${BLIS_REF_ROOT}/lib
|
||||
return
|
||||
fi
|
||||
echo "error: BLIS lib not found" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
build_hipsparselt() {
|
||||
echo "Start build"
|
||||
|
||||
@@ -32,23 +65,19 @@ build_hipsparselt() {
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
# gfx940;gfx941;gfx942
|
||||
GPU_TARGETS=all
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
create_blis_link
|
||||
EXTRA_CMAKE_OPTIONS=("-DLINK_BLIS=ON" "-DBUILD_DIR=${BUILD_DIR}")
|
||||
fi
|
||||
|
||||
FC=gfortran \
|
||||
CXX="${ROCM_PATH}/bin/hipcc" \
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
CXX=$(set_build_variables __CXX__) \
|
||||
cmake \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DTensile_LOGIC= \
|
||||
-DTensile_CODE_OBJECT_VERSION=default \
|
||||
-DTensile_CODE_OBJECT_VERSION=4 \
|
||||
-DTensile_CPU_THREADS= \
|
||||
-DTensile_LIBRARY_FORMAT=msgpack \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
@@ -56,13 +85,14 @@ build_hipsparselt() {
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
${EXTRA_CMAKE_OPTIONS[@]} \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
cmake --build "$BUILD_DIR" -- install
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
$SCCACHE_BIN -s || echo "Unable to display sccache stats"
|
||||
}
|
||||
@@ -86,7 +116,7 @@ print_output_directory() {
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipsparselt ;;
|
||||
build) build_hipsparselt; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipsparselt ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src hipTensor
|
||||
disable_debug_package_generation
|
||||
|
||||
build_hiptensor() {
|
||||
echo "Start build hipTensor"
|
||||
@@ -22,17 +23,11 @@ build_hiptensor() {
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942"
|
||||
fi
|
||||
|
||||
cmake \
|
||||
-B "${BUILD_DIR}" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
$(set_build_variables CMAKE_C_CXX) \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
"$(set_build_variables __CMAKE_CC_PARAMS__)" \
|
||||
"$(set_build_variables __CMAKE_CXX_PARAMS__)" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
@@ -41,7 +36,7 @@ build_hiptensor() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p "$PACKAGE_DIR" && cp ${BUILD_DIR}/*.${PKGTYPE} "$PACKAGE_DIR"
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -55,7 +50,7 @@ clean_hiptensor() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hiptensor ;;
|
||||
build) build_hiptensor; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hiptensor ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -60,7 +60,7 @@ MAKETARGET="deb"
|
||||
ASSERT_LLVM_VERSION_MAJOR=""
|
||||
ASSERT_LLVM_VERSION_MINOR=""
|
||||
|
||||
SKIP_LIT_TESTS=0
|
||||
SKIP_LIT_TESTS=1
|
||||
BUILD_MANPAGES="ON"
|
||||
STATIC_FLAG=
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src MIOpen
|
||||
|
||||
@@ -19,18 +19,18 @@ build_miopen_mlir() {
|
||||
mkdir build && cd build
|
||||
cmake \
|
||||
-G Ninja \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="$(set_build_variables __CLANG__)" \
|
||||
-DCMAKE_CXX_COMPILER="$(set_build_variables __CLANG++__)" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH};${HOME}/miopen-deps" \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH};${HOME}/miopen-deps" \
|
||||
-DCMAKE_INSTALL_PREFIX="$ROCM_PATH" \
|
||||
-DBUILD_FAT_LIBROCKCOMPILER=1 \
|
||||
..
|
||||
..
|
||||
cmake --build . -- librockCompiler -j${PROC}
|
||||
cmake --build . -- install
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
|
||||
|
||||
echo "Finished building rocMLIR"
|
||||
}
|
||||
|
||||
@@ -43,12 +43,6 @@ build_miopen_deps() {
|
||||
echo "Start build"
|
||||
cd "$COMPONENT_SRC"
|
||||
|
||||
# Update rocm-recipes for boost link
|
||||
# https://github.com/ROCm/MIOpen/pull/3457/files
|
||||
sed -i 's/329203d79f9fe77ae5d0d742af0966bc57f4dfc8/92c6695449c85887962f45509b376f2eb0d284f7/g' \
|
||||
rbuild.ini \
|
||||
install_deps.cmake \
|
||||
dev-requirements.txt
|
||||
# Commenting the rocMLIR & composable_kernel from requirements.txt
|
||||
sed -i '/ROCm\/rocMLIR@\|ROCm\/composable_kernel@/s/^/#/' requirements.txt
|
||||
# Extract MLIR commit from requirements.txt
|
||||
@@ -56,7 +50,7 @@ build_miopen_deps() {
|
||||
|
||||
|
||||
pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
|
||||
PATH="${PATH}:${ROCM_PATH}:${HOME}/.local/bin" rbuild prepare -d "$HOME/miopen-deps" --cxx=${ROCM_PATH}/llvm/bin/clang++ --cc ${ROCM_PATH}/llvm/bin/clang
|
||||
PATH="${PATH}:${ROCM_PATH}:${HOME}/.local/bin" rbuild prepare -d "$HOME/miopen-deps" --cxx="$(set_build_variables __CLANG++__)" --cc "$(set_build_variables __CLANG__)"
|
||||
build_miopen_mlir "$MLIR_COMMIT"
|
||||
|
||||
show_build_cache_stats
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src MIOpen
|
||||
|
||||
@@ -9,6 +9,8 @@ PACKAGE_DIR=${PACKAGE_DIR%\/*}/miopen-hip
|
||||
DEB_PATH=$PACKAGE_DIR
|
||||
RPM_PATH=$PACKAGE_DIR
|
||||
|
||||
disable_debug_package_generation
|
||||
|
||||
build_miopen_hip() {
|
||||
echo "Start build"
|
||||
|
||||
@@ -31,19 +33,19 @@ build_miopen_hip() {
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DMIOPEN_BACKEND=HIP \
|
||||
-DMIOPEN_OFFLINE_COMPILER_PATHS_V2=1 \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH};${ROCM_PATH}/hip;${HOME}/miopen-deps" \
|
||||
-DCMAKE_CXX_COMPILER=$(set_build_variables __CLANG++__) \
|
||||
-DCMAKE_C_COMPILER=$(set_build_variables __CLANG__) \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH};${ROCM_PATH}/hip;/tmp/miopen-deps" \
|
||||
-DHIP_OC_COMPILER="${ROCM_PATH}/bin/clang-ocl" \
|
||||
-DMIOPEN_TEST_DISCRETE=OFF \
|
||||
"$COMPONENT_SRC"
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
cmake --build "$BUILD_DIR" -- install
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf $BUILD_DIR/_CPack_Packages/ && find $BUILD_DIR -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -62,7 +64,7 @@ checkout_lfs() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_miopen_hip ;;
|
||||
build) build_miopen_hip; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_miopen_hip ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,39 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src MIVisionX
|
||||
BUILD_DEV=ON
|
||||
|
||||
build_mivisionx() {
|
||||
|
||||
if [ "$DISTRO_ID" = "mariner-2.0" ] || [ "$DISTRO_ID" = "azurelinux-3.0" ] ; then
|
||||
echo "Not building mivisionx for ${DISTRO_ID}. Exiting..."
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
CXX=$(set_build_variables __AMD_CLANG_++__)
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# Setting BUILD_DEV to OFF. This will prevent the installation of
|
||||
# header files, other files in share,libexec folder. ASAN pkg doesn't need this
|
||||
BUILD_DEV=OFF
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
echo "C compiler: $CC"
|
||||
echo "CXX compiler: $CXX"
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DROCM_PATH="$ROCM_PATH" \
|
||||
-DBUILD_DEV=$BUILD_DEV \
|
||||
-DCMAKE_INSTALL_LIBDIR=$(getInstallLibDir) \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DROCM_DEP_ROCMCORE=ON \
|
||||
-DROCAL_PYTHON=OFF \
|
||||
${LAUNCHER_FLAGS} \
|
||||
@@ -44,7 +49,7 @@ build_mivisionx() {
|
||||
cpack -G ${PKGTYPE^^}
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -58,7 +63,7 @@ clean_mivisionx() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_mivisionx ;;
|
||||
build) build_mivisionx; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_mivisionx ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -26,6 +26,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME="omniperf"
|
||||
PROJ_NAME="$API_NAME"
|
||||
LIB_NAME="lib${API_NAME}"
|
||||
@@ -33,18 +34,16 @@ TARGET="build"
|
||||
MAKETARGET="deb"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_LIB="$(getLibPath)"
|
||||
# PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
BUILD_DIR="$(getBuildPath $API_NAME)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/$API_NAME"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/$API_NAME"
|
||||
ROCM_WHEEL_DIR="${BUILD_DIR}/_wheel"
|
||||
BUILD_TYPE="Debug"
|
||||
MAKE_OPTS="$DASH_JAY -C $BUILD_DIR"
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
WHEEL_PACKAGE=false
|
||||
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=$(getopt -o hcraso:p:w --long help,clean,release,static,address_sanitizer,outdir:,package:,wheel -- "$@")
|
||||
@@ -52,6 +51,7 @@ eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -86,7 +86,6 @@ fi
|
||||
|
||||
clean() {
|
||||
echo "Cleaning $PROJ_NAME"
|
||||
rm -rf "$ROCM_WHEEL_DIR"
|
||||
rm -rf "$BUILD_DIR"
|
||||
rm -rf "$PACKAGE_DEB"
|
||||
rm -rf "$PACKAGE_RPM"
|
||||
@@ -100,7 +99,6 @@ build() {
|
||||
echo "Skip make and uploading packages for Omniperf on Centos7 distro, due to python dependency"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d "$BUILD_DIR" ]; then
|
||||
mkdir -p "$BUILD_DIR"
|
||||
pushd "$BUILD_DIR" || exit
|
||||
@@ -108,6 +106,8 @@ build() {
|
||||
echo "ROCm CMake Params: $(rocm_cmake_params)"
|
||||
echo "ROCm Common CMake Params: $(rocm_common_cmake_params)"
|
||||
|
||||
#install python deps
|
||||
#python3 -m pip install -t ${BUILD_DIR}/python-libs -r ${OMNIPERF_ROOT}/requirements.txt
|
||||
print_lib_type $SHARED_LIBS
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
@@ -117,7 +117,6 @@ build() {
|
||||
-DMOD_INSTALL_PATH=${BUILD_DIR}/modulefiles \
|
||||
"$OMNIPERF_ROOT"
|
||||
fi
|
||||
|
||||
make $MAKE_OPTS
|
||||
make $MAKE_OPTS install
|
||||
make $MAKE_OPTS package
|
||||
@@ -126,22 +125,6 @@ build() {
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_RPM" "$BUILD_DIR/${API_NAME}"*.rpm
|
||||
}
|
||||
|
||||
create_wheel_package() {
|
||||
echo "Creating Omniperf wheel package"
|
||||
|
||||
# Copy the setup.py generator to build folder
|
||||
mkdir -p "$ROCM_WHEEL_DIR"
|
||||
cp -f "$SCRIPT_ROOT"/generate_setup_py.py "$ROCM_WHEEL_DIR"
|
||||
cp -f "$SCRIPT_ROOT"/repackage_wheel.sh "$ROCM_WHEEL_DIR"
|
||||
cd "$ROCM_WHEEL_DIR" || exit
|
||||
|
||||
# Currently only supports python3.6
|
||||
./repackage_wheel.sh "$BUILD_DIR"/*.rpm python3.6
|
||||
|
||||
# Copy the wheel created to RPM folder which will be uploaded to artifactory
|
||||
copy_if WHL "WHL" "$PACKAGE_RPM" "$ROCM_WHEEL_DIR"/dist/*.whl
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
@@ -158,14 +141,9 @@ verifyEnvSetup
|
||||
|
||||
case "$TARGET" in
|
||||
(clean) clean ;;
|
||||
(build) build ;;
|
||||
(build) build; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
if [[ $WHEEL_PACKAGE == true ]]; then
|
||||
echo "Wheel Package build started !!!!"
|
||||
create_wheel_package
|
||||
fi
|
||||
|
||||
echo "Operation complete"
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -26,6 +26,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME="omnitrace"
|
||||
PROJ_NAME="$API_NAME"
|
||||
LIB_NAME="lib${API_NAME}"
|
||||
@@ -33,9 +34,11 @@ TARGET="build"
|
||||
MAKETARGET="deb"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_LIB="$(getLibPath)"
|
||||
# PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
BUILD_DIR="$(getBuildPath $API_NAME)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/$API_NAME"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/$API_NAME"
|
||||
# PACKAGE_PREFIX="$ROCM_INSTALL_PATH"
|
||||
BUILD_TYPE="Debug"
|
||||
MAKE_OPTS="-j 8"
|
||||
SHARED_LIBS="ON"
|
||||
@@ -49,6 +52,7 @@ VALID_STR=$(getopt -o hcraso:p:w --long help,clean,release,address_sanitizer,sta
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true; do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
printUsage
|
||||
@@ -65,6 +69,8 @@ while true; do
|
||||
;;
|
||||
-a | --address_sanitizer)
|
||||
ack_and_ignore_asan
|
||||
# set_asan_env_vars
|
||||
# set_address_sanitizer_on
|
||||
|
||||
ASAN=1
|
||||
shift
|
||||
@@ -76,6 +82,7 @@ while true; do
|
||||
-o | --outdir)
|
||||
TARGET="outdir"
|
||||
PKGTYPE=$2
|
||||
# OUT_DIR_SPECIFIED=1
|
||||
((CLEAN_OR_OUT |= 2))
|
||||
shift 2
|
||||
;;
|
||||
@@ -84,13 +91,13 @@ while true; do
|
||||
shift 2
|
||||
;;
|
||||
-w | --wheel)
|
||||
echo "omnitrace: wheel build option accepted and ignored"
|
||||
WHEEL_PACKAGE=true
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
;; # end delimiter
|
||||
*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] " >&2
|
||||
exit 20
|
||||
@@ -131,23 +138,68 @@ build_omnitrace() {
|
||||
echo "Created build directory: $BUILD_DIR"
|
||||
fi
|
||||
|
||||
cd $OMNITRACE_ROOT || exit
|
||||
|
||||
echo "Current submodule status"
|
||||
git submodule status
|
||||
echo "Cached (old) submodule status"
|
||||
git submodule status --cached
|
||||
cat .git/config
|
||||
|
||||
echo "Updating submodules"
|
||||
git submodule init
|
||||
# copy the new URL to your local config
|
||||
git submodule sync --recursive
|
||||
# force update the submodule from the new URL
|
||||
git submodule update --init --recursive --force
|
||||
|
||||
echo "Updated submodule status"
|
||||
git submodule status
|
||||
cat .git/config
|
||||
|
||||
echo "Build directory: $BUILD_DIR"
|
||||
pushd "$BUILD_DIR" || exit
|
||||
print_lib_type $SHARED_LIBS
|
||||
|
||||
ELFUTIL_URL="https://compute-artifactory.amd.com/artifactory/rocm-generic-local/dev-tools/omnitrace/elfutils-0.188.tar.bz2"
|
||||
BINUTIL_URL="https://compute-artifactory.amd.com/artifactory/rocm-generic-local/dev-tools/omnitrace/binutils-2.40.tar.gz"
|
||||
|
||||
echo "ROCm CMake Params: $(rocm_cmake_params)"
|
||||
echo "ROCm Common CMake Params: $(rocm_common_cmake_params)"
|
||||
|
||||
echo "ELFUTIL_URL=$ELFUTIL_URL, BINUTIL_URL=$BINUTIL_URL"
|
||||
|
||||
if [ $ASAN == 1 ]; then
|
||||
echo "Address Sanitizer path"
|
||||
|
||||
# Commenting out the below cmake command as it is not working as expected
|
||||
# LD_LIBRARY_PATH=$ROCM_INSTALL_PATH/lib/asan:$LD_LIBRARY_PATH
|
||||
# cmake \
|
||||
# $(rocm_cmake_params) \
|
||||
# $(rocm_common_cmake_params) \
|
||||
# -DOMNITRACE_BUILD_{LIBUNWIND,DYNINST}=ON \
|
||||
# -DDYNINST_BUILD_{TBB,BOOST,ELFUTILS,LIBIBERTY}=ON \
|
||||
# -DAMDDeviceLibs_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/AMDDeviceLibs" \
|
||||
# -Dhip_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/hip" \
|
||||
# -Dhip-lang_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/hip-lang" \
|
||||
# -Damd_comgr_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/amd_comgr" \
|
||||
# -Dhsa-runtime64_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/hsa-runtime64" \
|
||||
# -Dhsakmt_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/hsakmt" \
|
||||
# -DROCM_PATH="${ROCM_INSTALL_PATH}/lib/asan" \
|
||||
# -Drocprofiler_ROOT_DIR="${ROCM_INSTALL_PATH}/lib/asan" \
|
||||
# -DCMAKE_HIP_COMPILER_ROCM_ROOT="${ROCM_INSTALL_PATH}" \
|
||||
# -DCMAKE_PREFIX_PATH="${ROCM_INSTALL_PATH};${ROCM_INSTALL_PATH}/lib/asan" \
|
||||
# -DCMAKE_LIBRARY_PATH="${ROCM_INSTALL_PATH}/lib/asan" \
|
||||
# -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=OFF \
|
||||
# "$OMNITRACE_ROOT"
|
||||
|
||||
else
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DOMNITRACE_BUILD_{LIBUNWIND,DYNINST}=ON \
|
||||
-DDYNINST_BUILD_{TBB,BOOST,ELFUTILS,LIBIBERTY}=ON \
|
||||
-DElfUtils_DOWNLOAD_URL="$ELFUTIL_URL" \
|
||||
-D{DYNINST,TIMEMORY}_BINUTILS_DOWNLOAD_URL="$BINUTIL_URL" \
|
||||
"$OMNITRACE_ROOT"
|
||||
fi
|
||||
|
||||
@@ -182,10 +234,10 @@ print_output_directory() {
|
||||
verifyEnvSetup
|
||||
|
||||
case "$TARGET" in
|
||||
clean) clean ;;
|
||||
build) build_omnitrace ;;
|
||||
outdir) print_output_directory ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
clean) clean ;;
|
||||
build) build_omnitrace; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
outdir) print_output_directory ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
PROJ_NAME=OpenCL-ICD-Loader
|
||||
PROJ_NAME="OpenCL-ICD-Loader"
|
||||
TARGET="build"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
BUILD_TYPE="Debug"
|
||||
OPENCL_ICD_LOADER_BUILD_DIR="$(getBuildPath ${PROJ_NAME})"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/${PROJ_NAME,,}"
|
||||
PACKAGE_RPM="$PACKAGE_ROOT/rpm/${PROJ_NAME,,}"
|
||||
CLEAN_OR_OUT=0;
|
||||
PKGTYPE="deb"
|
||||
MAKETARGET="deb"
|
||||
API_NAME="rocm-opencl-icd-loader"
|
||||
|
||||
printUsage() {
|
||||
echo
|
||||
@@ -21,6 +20,8 @@ printUsage() {
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -w, --wheel Creates python wheel package of opencl-icd-loader.
|
||||
It needs to be used along with -r option"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -o, --outdir Print path of output directory containing packages"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
@@ -41,57 +42,46 @@ fi
|
||||
|
||||
clean_opencl_icd_loader() {
|
||||
echo "Cleaning $PROJ_NAME"
|
||||
rm -rf "$OPENCL_ICD_LOADER_BUILD_DIR"
|
||||
rm -rf "$PACKAGE_DEB"
|
||||
rm -rf "$PACKAGE_RPM"
|
||||
rm -rf "$PACKAGE_ROOT/${PROJ_NAME,,}"
|
||||
}
|
||||
|
||||
copy_pkg_files_to_rocm() {
|
||||
local comp_folder=$1
|
||||
local comp_pkg_name=$2
|
||||
|
||||
cd "${OUT_DIR}/${PKGTYPE}/${comp_folder}"|| exit 2
|
||||
if [ "${PKGTYPE}" = 'deb' ]; then
|
||||
dpkg-deb -x ${comp_pkg_name}_*.deb pkg/
|
||||
else
|
||||
mkdir pkg && pushd pkg/ || exit 2
|
||||
if [[ "${comp_pkg_name}" != *-dev* ]]; then
|
||||
rpm2cpio ../${comp_pkg_name}-*.rpm | cpio -idmv
|
||||
else
|
||||
rpm2cpio ../${comp_pkg_name}el-*.rpm | cpio -idmv
|
||||
fi
|
||||
popd || exit 2
|
||||
fi
|
||||
ls ./pkg -alt
|
||||
cp -r ./pkg/*/rocm*/* "${ROCM_PATH}" || exit 2
|
||||
rm -rf pkg/
|
||||
rm -rf "$PACKAGE_ROOT/opencl-icd-loader"
|
||||
}
|
||||
|
||||
build_opencl_icd_loader() {
|
||||
echo "Downloading $PROJ_NAME" package
|
||||
if [ "$DISTRO_NAME" = ubuntu ]; then
|
||||
mkdir -p "$PACKAGE_DEB"
|
||||
local rocm_ver=${ROCM_VERSION}
|
||||
if [ ${ROCM_VERSION##*.} = 0 ]; then
|
||||
rocm_ver=${ROCM_VERSION%.*}
|
||||
fi
|
||||
local url="https://repo.radeon.com/rocm/apt/${rocm_ver}/pool/main/r/${API_NAME}/"
|
||||
local package
|
||||
package=$(curl -s "$url" | grep -Po 'href="\K[^"]*' | grep "${DISTRO_RELEASE}" | head -n 1)
|
||||
|
||||
if [ -z "$package" ]; then
|
||||
echo "No package found for Ubuntu version $DISTRO_RELEASE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wget -t3 -P "$PACKAGE_DEB" "${url}${package}"
|
||||
copy_pkg_files_to_rocm ${PROJ_NAME,,} ${API_NAME}
|
||||
else
|
||||
echo "$DISTRO_ID is not supported..."
|
||||
exit 2
|
||||
echo "Building $PROJ_NAME"
|
||||
if [ ! -e "$OPENCL_ICD_LOADER_ROOT/CMakeLists.txt" ]
|
||||
then
|
||||
echo "No $OPENCL_ICD_LOADER_ROOT/CMakeLists.txt file, skipping opencl icd loader" >&2
|
||||
echo "No $OPENCL_ICD_LOADER_ROOT/CMakeLists.txt file, skipping opencl icd loader"
|
||||
exit 0 # This is not an error
|
||||
fi
|
||||
|
||||
echo "Installing $PROJ_NAME" package
|
||||
mkdir -p "$OPENCL_ICD_LOADER_BUILD_DIR"
|
||||
pushd "$OPENCL_ICD_LOADER_BUILD_DIR"
|
||||
if [ ! -e Makefile ]; then
|
||||
cmake \
|
||||
-S "$OPENCL_ICD_LOADER_ROOT" \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DENABLE_OPENCL_LAYERS="OFF" \
|
||||
-DOPENCL_ICD_LOADER_HEADERS_DIR="$OPENCL_HEADERS_ROOT"
|
||||
fi
|
||||
cmake --build . -- $MAKEOPTS
|
||||
echo "Installing opencl-icd-loader"
|
||||
cmake --build . -- $MAKEOPTS install
|
||||
popd
|
||||
}
|
||||
|
||||
package_opencl_icd_loader() {
|
||||
echo "Packaging $PROJ_NAME"
|
||||
pushd "$OPENCL_ICD_LOADER_BUILD_DIR"
|
||||
cmake --build . -- package
|
||||
mkdir -p $PACKAGE_DEB
|
||||
mkdir -p $PACKAGE_RPM
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_DEB" *.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_RPM" *.rpm
|
||||
popd
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
@@ -106,7 +96,8 @@ print_output_directory() {
|
||||
exit
|
||||
}
|
||||
|
||||
VALID_STR=`getopt -o hcraswlo:p: --long help,clean,release,outdir:,package: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswlo:p: --long help,clean,release,wheel,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
while true ;
|
||||
do
|
||||
@@ -119,23 +110,35 @@ do
|
||||
printUsage ; exit 0 ;;
|
||||
(-a | --address_sanitizer)
|
||||
ack_and_ignore_asan ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
MAKETARGET="$2" ; shift 2;;
|
||||
(-s | --static)
|
||||
echo "-s parameter accepted but ignored" ; shift ;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
done
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_opencl_icd_loader ;;
|
||||
(build) build_opencl_icd_loader ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
(clean)
|
||||
clean_opencl_icd_loader
|
||||
;;
|
||||
(build)
|
||||
build_opencl_icd_loader
|
||||
package_opencl_icd_loader
|
||||
build_wheel "$OPENCL_ICD_LOADER_BUILD_DIR" "$PROJ_NAME"
|
||||
;;
|
||||
(outdir)
|
||||
print_output_directory
|
||||
;;
|
||||
(*)
|
||||
die "Invalid target $TARGET"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -8,11 +8,13 @@ printUsage() {
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of type referred to by pkg_type"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -w, --wheel Creates python wheel package of opencl.
|
||||
It needs to be used along with -r option"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
echo " deb -> Debian format (default)"
|
||||
@@ -23,9 +25,7 @@ printUsage() {
|
||||
}
|
||||
PROJ_NAME="opencl-on-rocclr"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
|
||||
BUILD_PATH="$(getBuildPath $PROJ_NAME)"
|
||||
|
||||
TARGET="build"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/$PROJ_NAME"
|
||||
@@ -39,7 +39,8 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
|
||||
VALID_STR=`getopt -o hcraso: --long help,clean,release,static,address_sanitizer,outdir: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcrawso: --long help,clean,release,static,wheel,address_sanitizer,outdir: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
@@ -56,9 +57,11 @@ do
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -73,6 +76,7 @@ if [ $RET_CONFLICT -ge 30 ]; then
|
||||
fi
|
||||
|
||||
clean_opencl_on_rocclr() {
|
||||
# Delete cmake output directory
|
||||
rm -rf "$BUILD_PATH"
|
||||
rm -rf "$PACKAGE_DEB"
|
||||
rm -rf "$PACKAGE_RPM"
|
||||
@@ -83,14 +87,19 @@ clean_opencl_on_rocclr() {
|
||||
}
|
||||
|
||||
build_opencl_on_rocclr() {
|
||||
# TODO This if condition is a temporary workaround so that mainline builds dont error out
|
||||
# until build migrated from opencl to clr repo
|
||||
if [ -e "$CLR_ROOT/CMakeLists.txt" ]; then
|
||||
# We are in a branch that has migrated to clr repo
|
||||
_OCL_CMAKELIST_DIR="$CLR_ROOT"
|
||||
_OCL_CMAKELIST_OPT="-DCLR_BUILD_HIP=OFF -DCLR_BUILD_OCL=ON"
|
||||
elif [ ! -e "$OPENCL_ON_ROCclr_ROOT/CMakeLists.txt" ]; then
|
||||
# We seem to have hit a branch in which both the old and the new repo don't exist
|
||||
echo "No $OPENCL_ON_ROCclr_ROOT/CMakeLists.txt file, skipping opencl on rocclr" >&2
|
||||
echo "No $OPENCL_ON_ROCclr_ROOT/CMakeLists.txt file, skipping opencl on rocclr"
|
||||
exit 0
|
||||
exit 0 # This is not an error
|
||||
else
|
||||
# We are in a branch that has not yet migrated to clr repo yet
|
||||
_OCL_CMAKELIST_DIR="$OPENCL_ON_ROCclr_ROOT"
|
||||
_OCL_CMAKELIST_OPT=""
|
||||
fi
|
||||
@@ -99,10 +108,12 @@ build_opencl_on_rocclr() {
|
||||
mkdir -p "$BUILD_PATH"
|
||||
pushd "$BUILD_PATH"
|
||||
|
||||
# FIXME: Remove -DROCclr_DIR/LIBROCclr_STATIC_DIR
|
||||
if [ ! -e Makefile ]; then
|
||||
echo "Building OpenCL-On-ROCclr CMake environment"
|
||||
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
$(rocm_cmake_params) \
|
||||
-DUSE_COMGR_LIBRARY=ON \
|
||||
$(rocm_common_cmake_params) \
|
||||
@@ -147,10 +158,20 @@ print_output_directory() {
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_opencl_on_rocclr ;;
|
||||
(build) build_opencl_on_rocclr ; package_opencl_on_rocclr ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
(clean)
|
||||
clean_opencl_on_rocclr
|
||||
;;
|
||||
(build)
|
||||
build_opencl_on_rocclr
|
||||
package_opencl_on_rocclr
|
||||
build_wheel "$BUILD_PATH" "$PROJ_NAME"
|
||||
;;
|
||||
(outdir)
|
||||
print_output_directory
|
||||
;;
|
||||
(*)
|
||||
die "Invalid target $TARGET"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -10,6 +10,8 @@ printUsage() {
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -w, --wheel Creates python wheel package of openmp-extras.
|
||||
It needs to be used along with -r option"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
@@ -23,9 +25,8 @@ printUsage() {
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
PROJ_NAME="openmp-extras"
|
||||
packageMajorVersion="18.63"
|
||||
packageMajorVersion="19.65"
|
||||
packageMinorVersion="0"
|
||||
packageVersion="${packageMajorVersion}.${packageMinorVersion}.${ROCM_LIBPATCH_VERSION}"
|
||||
BUILD_PATH="$(getBuildPath $PROJ_NAME)"
|
||||
@@ -35,9 +36,12 @@ TARGET="build"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
STATIC_PKG_DEPS="OFF"
|
||||
|
||||
# Should only need to update this variable when moving
|
||||
# to the new ROCM_INSTALL_PATH.
|
||||
export INSTALL_PREFIX=${ROCM_INSTALL_PATH}
|
||||
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,address_sanitizer,static,outdir,package: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,address_sanitizer,static,outdir,wheel:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
@@ -52,17 +56,23 @@ do
|
||||
-a | --address_sanitizer )
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# The path will be appended to cmake prefix path for asan builds
|
||||
# Required for finding cmake config files for asan builds
|
||||
export ROCM_CMAKECONFIG_PATH="$INSTALL_PREFIX/lib/asan/cmake"
|
||||
export VERBOSE=1
|
||||
# openmp debug build of ompd uses python build, which defaults to gcc
|
||||
export LDSHARED="$INSTALL_PREFIX/lib/llvm/bin/clang -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2"
|
||||
# SANITIZER is used in openmp-debug build scripts so that the asan C/CXX Flags are not overwritten
|
||||
export SANITIZER=1 ;;
|
||||
-o | --outdir )
|
||||
shift 1; PKGTYPE=$1 ; TARGET="outdir" ;;
|
||||
-w | --wheel )
|
||||
WHEEL_PACKAGE=true ;;
|
||||
-s | --static )
|
||||
export STATIC_PKG_DEPS="ON" ;;
|
||||
-h | --help )
|
||||
printUsage ; exit 0 ;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
*)
|
||||
MAKEARG=$@ ; break ;;
|
||||
esac
|
||||
@@ -71,6 +81,7 @@ done
|
||||
|
||||
|
||||
clean_openmp_extras() {
|
||||
# Delete cmake output and install directory
|
||||
rm -rf "$BUILD_PATH"
|
||||
rm -rf "$INSTALL_PREFIX/openmp-extras"
|
||||
}
|
||||
@@ -93,6 +104,9 @@ build_openmp_extras() {
|
||||
echo BUILD_PATH: $BUILD_PATH
|
||||
echo "INSTALL_PREFIX:$INSTALL_PREFIX"
|
||||
export AOMP_STANDALONE_BUILD=0
|
||||
# FIXME: Check the build scripts to see if support for DEVEL package
|
||||
# is on. This can be removed once the old packaging logic is gone. This
|
||||
# may return a non-zero, so for now do not error out the script.
|
||||
set +e
|
||||
checkDevel=$(grep "ENABLE_DEVEL_PACKAGE=ON" $AOMP_REPOS/aomp/bin/build_openmp.sh)
|
||||
set -e
|
||||
@@ -104,6 +118,7 @@ build_openmp_extras() {
|
||||
fi
|
||||
export BUILD_AOMP=$BUILD_PATH
|
||||
|
||||
# EPSDB does not build hsa, we need to pick it up from ROCm install location.
|
||||
if [ "$EPSDB" == "1" ]; then
|
||||
export ROCM_DIR=$ROCM_INSTALL_PATH
|
||||
else
|
||||
@@ -130,10 +145,17 @@ build_openmp_extras() {
|
||||
echo "--------------------------"
|
||||
fi
|
||||
|
||||
export AOMP_JENKINS_BUILD_LIST="extras openmp pgmath flang flang_runtime"
|
||||
# can we stop building flang-classic ?
|
||||
if [ -e $AOMP_REPOS/aomp/bin/disableClassic ]; then
|
||||
export AOMP_JENKINS_BUILD_LIST="extras openmp"
|
||||
export AOMP_SKIP_FLANG=1
|
||||
else
|
||||
export AOMP_JENKINS_BUILD_LIST="extras openmp pgmath flang flang_runtime"
|
||||
fi
|
||||
echo "BEGIN Build of openmp-extras"
|
||||
"$AOMP_REPOS"/aomp/bin/build_aomp.sh $MAKEARG
|
||||
|
||||
# Create symlinks for omp headers. Stage 2 components need these.
|
||||
local llvm_ver=`$INSTALL_PREFIX/lib/llvm/bin/clang --print-resource-dir | sed 's^/llvm/lib/clang/^ ^' | awk '{print $2}'`
|
||||
if [ ! -e $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/omp.h ] ; then
|
||||
if [ ! -h $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/omp.h ] ; then
|
||||
@@ -154,6 +176,7 @@ build_openmp_extras() {
|
||||
}
|
||||
|
||||
package_openmp_extras_deb() {
|
||||
# Debian packaging
|
||||
local packageName=$1
|
||||
local packageDeb="$packageDir/deb"
|
||||
local packageArch="amd64"
|
||||
@@ -184,14 +207,20 @@ package_openmp_extras_deb() {
|
||||
debDependencies="$debDependencies, openmp-extras-runtime, hsa-rocr-static-dev"
|
||||
fi
|
||||
fi
|
||||
|
||||
# copyPath = /opt/rocm
|
||||
# installPath = /opt/rocm/lib/llvm
|
||||
# FIXME: openmp-extras/devel logic can be removed once the new packaging lands
|
||||
# New packaging uses installed_files.txt the openmp-extras/devel
|
||||
# directory will no longer exist.
|
||||
if [ -f "$BUILD_PATH"/build/installed_files.txt ] && [ ! -d "$INSTALL_PREFIX"/openmp-extras/devel ]; then
|
||||
if [ "$packageType" == "runtime" ]; then
|
||||
# Cleanup previous packages
|
||||
rm -rf "$packageDir"
|
||||
rm -rf "$DEB_PATH"
|
||||
mkdir -p "$DEB_PATH"
|
||||
mkdir -p $packageDeb/openmp-extras
|
||||
|
||||
# Licensing
|
||||
# Copy licenses into share/doc/openmp-extras
|
||||
mkdir -p $packageDeb/openmp-extras$copyPath/share/doc/openmp-extras
|
||||
cp -r $AOMP_REPOS/aomp/LICENSE $packageDeb/openmp-extras$copyPath/share/doc/openmp-extras/LICENSE.apache2
|
||||
cp -r $AOMP_REPOS/aomp-extras/LICENSE $packageDeb/openmp-extras$copyPath/share/doc/openmp-extras/LICENSE.mit
|
||||
@@ -199,20 +228,29 @@ package_openmp_extras_deb() {
|
||||
else
|
||||
rm -rf $packageDeb/openmp-extras/*
|
||||
mkdir -p $packageDeb/openmp-extras$copyPath/bin
|
||||
cp -r --parents "$installPath"/lib-debug/src $packageDeb/openmp-extras
|
||||
if [ -d "$installPath"/lib-debug/src ]; then
|
||||
cp -r --parents "$installPath"/lib-debug/src $packageDeb/openmp-extras
|
||||
else
|
||||
cp -r --parents "$ompdSrcDir" $packageDeb/openmp-extras
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# FIXME: Old packaging method, can delete once new packaging lands.
|
||||
if [ "$packageType" == "runtime" ]; then
|
||||
# Cleanup previous packages
|
||||
rm -rf "$packageDir"
|
||||
rm -rf "$DEB_PATH"
|
||||
mkdir -p "$DEB_PATH"
|
||||
mkdir -p $packageDeb/openmp-extras$installPath
|
||||
mkdir -p $packageDeb/openmp-extras$installPath/lib/clang/$llvm_ver/include
|
||||
# Licensing
|
||||
# Copy licenses into share/doc/openmp-extras
|
||||
mkdir -p $packageDeb/openmp-extras$copyPath/share/doc/openmp-extras
|
||||
cp -r $AOMP_REPOS/aomp/LICENSE $packageDeb/openmp-extras$copyPath/share/doc/openmp-extras/LICENSE.apache2
|
||||
cp -r $AOMP_REPOS/aomp-extras/LICENSE $packageDeb/openmp-extras$copyPath/share/doc/openmp-extras/LICENSE.mit
|
||||
cp -r $AOMP_REPOS/flang/LICENSE.txt $packageDeb/openmp-extras$copyPath/share/doc/openmp-extras/LICENSE.flang
|
||||
else
|
||||
# Clean packageDeb for devel build
|
||||
rm -rf $packageDeb/openmp-extras$installPath/*
|
||||
rm -rf $packageDeb/openmp-extras/bin
|
||||
rm -rf $packageDeb/openmp-extras$copyPath/share
|
||||
@@ -224,10 +262,13 @@ package_openmp_extras_deb() {
|
||||
|
||||
mkdir -p "$(dirname $controlFile)"
|
||||
|
||||
# Copy openmp-extras files, bin will turn into llvm/bin
|
||||
if [ -f "$BUILD_PATH"/build/installed_files.txt ] && [ ! -d "$INSTALL_PREFIX"/openmp-extras/devel ]; then
|
||||
if [ "$packageType" == "runtime" ]; then
|
||||
cat "$BUILD_PATH"/build/installed_files.txt | grep -P '\.so|\.a' | cut -d":" -f2 | cut -d" " -f2 | xargs -I {} cp -d --parents {} "$packageDeb"/openmp-extras
|
||||
|
||||
# libgomp and libiomp5 are not on the install_manifest.txt and need
|
||||
# to be manually copied. Waiting on trunk patch to flow into amd-staging
|
||||
# to ensure these symlinks are in the manifest.
|
||||
cp -d --parents "$installPath/lib/libgomp.so" "$packageDeb"/openmp-extras
|
||||
cp -d --parents "$installPath/lib/libiomp5.so" "$packageDeb"/openmp-extras
|
||||
cp -d --parents "$installPath/lib-debug/libgomp.so" "$packageDeb"/openmp-extras
|
||||
@@ -236,9 +277,11 @@ package_openmp_extras_deb() {
|
||||
cat "$BUILD_PATH"/build/installed_files.txt | grep -Pv '\.so|\.a' | cut -d":" -f2 | cut -d" " -f2 | xargs -I {} cp -d --parents {} "$packageDeb"/openmp-extras
|
||||
fi
|
||||
else
|
||||
# FIXME: Old packaging method, can delete once new packaging lands.
|
||||
cp -r "$AOMP"/"$packageType"/* "$packageDeb"/openmp-extras"$installPath"
|
||||
fi
|
||||
|
||||
# Copy examples
|
||||
if [ "$packageType" == "devel" ]; then
|
||||
mkdir -p "$packageDeb"/openmp-extras"$copyPath"/share/openmp-extras/examples
|
||||
echo cp -r "$AOMP_REPOS"/aomp/examples/fortran "$packageDeb"/openmp-extras"$copyPath"/share/openmp-extras/examples
|
||||
@@ -252,9 +295,11 @@ package_openmp_extras_deb() {
|
||||
fi
|
||||
|
||||
if [ "$packageType" == "devel" ]; then
|
||||
# Create symbolic links for openmp header files
|
||||
ln -s ../../../../include/omp.h $packageDeb/openmp-extras$installPath/lib/clang/$llvm_ver/include/omp.h
|
||||
ln -s ../../../../include/ompt.h $packageDeb/openmp-extras$installPath/lib/clang/$llvm_ver/include/ompt.h
|
||||
ln -s ../../../../include/omp-tools.h $packageDeb/openmp-extras$installPath/lib/clang/$llvm_ver/include/omp-tools.h
|
||||
# Only create symlinks if file exists
|
||||
if [ ! -h "$packageDeb"/openmp-extras"$copyPath"/bin/aompcc ] && [ -e "$packageDeb"/openmp-extras"$installPath"/bin/aompcc ]; then
|
||||
ln -s ../lib/llvm/bin/aompcc "$packageDeb"/openmp-extras"$copyPath"/bin/aompcc
|
||||
fi
|
||||
@@ -266,12 +311,14 @@ package_openmp_extras_deb() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# Inspect
|
||||
ls -l "$packageDeb"/openmp-extras"$installPath"
|
||||
if [ "$packageType" == "devel" ]; then
|
||||
ls -l "$packageDeb"/openmp-extras"$installPath"/bin
|
||||
ls -l "$packageDeb"/openmp-extras"$copyPath"/bin
|
||||
fi
|
||||
|
||||
# Create control file
|
||||
{
|
||||
echo "Package: $packageName"
|
||||
echo "Architecture: $packageArch"
|
||||
@@ -293,7 +340,9 @@ package_openmp_extras_deb() {
|
||||
"$DEB_PATH/${packageName}_${packageVersion}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${packageArch}.deb"
|
||||
}
|
||||
|
||||
# ASAN debian package
|
||||
package_openmp_extras_asan_deb() {
|
||||
# Debian packaging
|
||||
local packageName=$1
|
||||
local packageDeb="$packageDir/deb"
|
||||
local packageArch="amd64"
|
||||
@@ -308,6 +357,8 @@ package_openmp_extras_asan_deb() {
|
||||
rm -rf "$packageDir"
|
||||
rm -rf "$DEB_PATH"
|
||||
mkdir -p "$DEB_PATH"
|
||||
# Licensing
|
||||
# Copy licenses into share/doc/openmp-extras-asan
|
||||
local licenseDir="$packageDeb/openmp-extras$copyPath/share/doc/openmp-extras-asan"
|
||||
mkdir -p $licenseDir
|
||||
cp -r $AOMP_REPOS/aomp/LICENSE $licenseDir/LICENSE.apache2
|
||||
@@ -317,15 +368,18 @@ package_openmp_extras_asan_deb() {
|
||||
mkdir -p "$(dirname $controlFile)"
|
||||
if [ -f "$BUILD_PATH"/build/installed_files.txt ] && [ ! -d "$INSTALL_PREFIX"/openmp-extras ]; then
|
||||
cat "$BUILD_PATH"/build/installed_files.txt | grep -P 'asan' | cut -d":" -f2 | cut -d" " -f2 | xargs -I {} cp -d --parents {} "$packageDeb"/openmp-extras
|
||||
|
||||
# libgomp and libiomp5 are not on the install_manifest.txt and need
|
||||
# to be manually copied. Waiting on trunk patch to flow into amd-staging
|
||||
# to ensure these symlinks are in the manifest.
|
||||
cp -d --parents "$installPath/lib/asan/libgomp.so" "$packageDeb"/openmp-extras
|
||||
cp -d --parents "$installPath/lib/asan/libiomp5.so" "$packageDeb"/openmp-extras
|
||||
cp -d --parents "$installPath/lib-debug/asan/libgomp.so" "$packageDeb"/openmp-extras
|
||||
cp -d --parents "$installPath/lib-debug/asan/libiomp5.so" "$packageDeb"/openmp-extras
|
||||
|
||||
# FIXME: Old packaging method, can delete once new packaging lands.
|
||||
else
|
||||
mkdir -p $packageDeb/openmp-extras$installPath/lib/asan
|
||||
mkdir -p $packageDeb/openmp-extras$installPath/lib-debug/asan
|
||||
# runtime folder have asan libraries. Copy to asan folder for packaging
|
||||
cp -r "$AOMP"/lib/asan/* "$packageDeb"/openmp-extras"$installPath"/lib/asan/
|
||||
cp -r "$AOMP"/lib-debug/asan/* "$packageDeb"/openmp-extras"$installPath"/lib-debug/asan/
|
||||
cp -r "$AOMP"/"$asanLibDir"/lib/asan/* "$packageDeb"/openmp-extras"$installPath"/lib/asan/
|
||||
@@ -334,6 +388,7 @@ package_openmp_extras_asan_deb() {
|
||||
cp -r "$AOMP"/devel/lib-debug/asan/* "$packageDeb"/openmp-extras"$installPath"/lib-debug/asan/
|
||||
fi
|
||||
|
||||
# Create control file
|
||||
{
|
||||
echo "Package: $packageName"
|
||||
echo "Architecture: $packageArch"
|
||||
@@ -352,6 +407,7 @@ package_openmp_extras_asan_deb() {
|
||||
|
||||
|
||||
package_openmp_extras_rpm() {
|
||||
# RPM packaging
|
||||
local packageName=$1
|
||||
local packageRpm="$packageDir/rpm"
|
||||
local specFile="$packageDir/$packageName.spec"
|
||||
@@ -376,6 +432,7 @@ package_openmp_extras_rpm() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# Cleanup previous packages
|
||||
if [ "$packageType" == "runtime" ]; then
|
||||
rm -rf "$packageDir"
|
||||
rm -rf "$RPM_PATH"
|
||||
@@ -386,6 +443,8 @@ package_openmp_extras_rpm() {
|
||||
mkdir -p "$(dirname $specFile)"
|
||||
|
||||
{
|
||||
# FIXME: Remove all conditions for empty packageType when
|
||||
# devel and runtime packaging changes land in mainline.
|
||||
echo "%define is_runtime %( if [ $packageType == runtime ]; then echo "1" ; else echo "0"; fi )"
|
||||
echo "%define is_devel %( if [ $packageType == devel ]; then echo "1" ; else echo "0"; fi )"
|
||||
|
||||
@@ -403,6 +462,7 @@ package_openmp_extras_rpm() {
|
||||
echo "Obsoletes: $rpmObsoletes"
|
||||
echo "%endif"
|
||||
echo "%define debug_package %{nil}"
|
||||
# Redefining __os_install_post to remove stripping
|
||||
echo "%define __os_install_post %{nil}"
|
||||
echo "%description"
|
||||
echo "$packageSummaryLong"
|
||||
@@ -419,6 +479,7 @@ package_openmp_extras_rpm() {
|
||||
echo " mkdir -p \$RPM_BUILD_ROOT$copyPath/bin"
|
||||
echo " mkdir -p \$RPM_BUILD_ROOT$installPath/lib/clang/$llvm_ver/include"
|
||||
echo " %endif"
|
||||
# FIXME: Old packaging method, can delete once new packaging lands.
|
||||
echo "else"
|
||||
echo " %if %is_runtime"
|
||||
echo " mkdir -p \$RPM_BUILD_ROOT$installPath"
|
||||
@@ -430,10 +491,13 @@ package_openmp_extras_rpm() {
|
||||
echo " %endif"
|
||||
echo "fi"
|
||||
|
||||
# Copy openmp-extras files, bin will turn into llvm/bin
|
||||
echo "if [ -f $BUILD_PATH/build/installed_files.txt ] && [ ! -d $INSTALL_PREFIX/openmp-extras/devel ]; then"
|
||||
echo " %if %is_runtime"
|
||||
echo " cat $BUILD_PATH/build/installed_files.txt | grep -P '\.so|\.a' | cut -d':' -f2 | cut -d' ' -f2 | xargs -I {} cp -d --parents {} \$RPM_BUILD_ROOT"
|
||||
|
||||
# libgomp and libiomp5 are not on the install_manifest.txt and need
|
||||
# to be manually copied. Waiting on trunk patch to flow into amd-staging
|
||||
# to ensure these symlinks are in the manifest.
|
||||
echo " cp -d --parents "$installPath/lib/libgomp.so" \$RPM_BUILD_ROOT"
|
||||
echo " cp -d --parents "$installPath/lib/libiomp5.so" \$RPM_BUILD_ROOT"
|
||||
echo " cp -d --parents "$installPath/lib-debug/libgomp.so" \$RPM_BUILD_ROOT"
|
||||
@@ -442,14 +506,17 @@ package_openmp_extras_rpm() {
|
||||
echo "%if %is_devel"
|
||||
echo " cat "$BUILD_PATH"/build/installed_files.txt | grep -Pv '\.so|\.a' | cut -d':' -f2 | cut -d' ' -f2 | xargs -I {} cp -d --parents {} \$RPM_BUILD_ROOT"
|
||||
echo "%endif"
|
||||
|
||||
# FIXME: Old packaging method, can delete once new packaging lands.
|
||||
echo "else"
|
||||
echo " cp -r $AOMP/$packageType/* \$RPM_BUILD_ROOT$installPath"
|
||||
# Devel does not have examples in the llvm dir
|
||||
echo " %if %is_devel"
|
||||
echo " rm -rf \$RPM_BUILD_ROOT$installPath/share"
|
||||
echo " %endif"
|
||||
echo "fi"
|
||||
|
||||
# Create symbolic links from /opt/rocm/bin to /opt/rocm/lib/llvm/bin utilities
|
||||
#echo "ls \$RPM_BUILD_ROOT$installPath"
|
||||
echo "%if %is_devel"
|
||||
echo " if [ ! -h \$RPM_BUILD_ROOT$copyPath/bin/aompcc ] && [ -e \$RPM_BUILD_ROOT$installPath/bin/aompcc ]; then"
|
||||
echo " ln -s ../lib/llvm/bin/aompcc \$RPM_BUILD_ROOT$copyPath/bin/aompcc"
|
||||
@@ -462,18 +529,23 @@ package_openmp_extras_rpm() {
|
||||
echo " fi"
|
||||
echo " ls \$RPM_BUILD_ROOT$copyPath"
|
||||
|
||||
# Create symbolic links for openmp header files
|
||||
echo " ln -s ../../../../include/omp.h \$RPM_BUILD_ROOT/$installPath/lib/clang/$llvm_ver/include/omp.h"
|
||||
echo " ln -s ../../../../include/ompt.h \$RPM_BUILD_ROOT/$installPath/lib/clang/$llvm_ver/include/ompt.h"
|
||||
echo " ln -s ../../../../include/omp-tools.h \$RPM_BUILD_ROOT/$installPath/lib/clang/$llvm_ver/include/omp-tools.h"
|
||||
echo "%endif"
|
||||
echo 'find $RPM_BUILD_ROOT \! -type d | sed "s|$RPM_BUILD_ROOT||"> files.list'
|
||||
# Copy examples
|
||||
|
||||
echo "%if %is_runtime"
|
||||
# Licensing
|
||||
# Copy licenses into share/doc/openmp-extras
|
||||
echo " mkdir -p \$RPM_BUILD_ROOT$copyPath/share/doc/openmp-extras"
|
||||
echo " cp -r $AOMP_REPOS/aomp/LICENSE \$RPM_BUILD_ROOT$copyPath/share/doc/openmp-extras/LICENSE.apache2"
|
||||
echo " cp -r $AOMP_REPOS/aomp-extras/LICENSE \$RPM_BUILD_ROOT$copyPath/share/doc/openmp-extras/LICENSE.mit"
|
||||
echo " cp -r $AOMP_REPOS/flang/LICENSE.txt \$RPM_BUILD_ROOT$copyPath/share/doc/openmp-extras/LICENSE.flang"
|
||||
echo "%else"
|
||||
# Copy devel examples to share/openmp-extras/examples
|
||||
echo " mkdir -p \$RPM_BUILD_ROOT$copyPath/share/openmp-extras/examples"
|
||||
echo " cp -r $AOMP_REPOS/aomp/examples/fortran \$RPM_BUILD_ROOT$copyPath/share/openmp-extras/examples"
|
||||
echo " cp -r $AOMP_REPOS/aomp/examples/openmp \$RPM_BUILD_ROOT$copyPath/share/openmp-extras/examples"
|
||||
@@ -493,6 +565,12 @@ package_openmp_extras_rpm() {
|
||||
echo " $copyPath/share/openmp-extras"
|
||||
echo "%endif"
|
||||
echo "%defattr(-,root,root,-)"
|
||||
# Note: In some OS like SLES, during upgrade rocm-core is getting upgraded first and followed by other packages
|
||||
# rocm-core cannot delete rocm-ver folder, since it contains files of other packages that are yet to be upgraded
|
||||
# To remove rocm-ver folder after upgrade the spec file of other packages should contain the rocm-ver directory
|
||||
# Otherwise after upgrade empty old rocm-ver folder will be left out.
|
||||
# If empty remove /opt/rocm-ver folder and its subdirectories created by
|
||||
# openmp-extras runtime and devel package
|
||||
echo "%if %is_runtime || %is_devel"
|
||||
echo " $copyPath"
|
||||
echo "%endif"
|
||||
@@ -502,15 +580,19 @@ package_openmp_extras_rpm() {
|
||||
mv $packageRpm/RPMS/x86_64/*.rpm $RPM_PATH
|
||||
}
|
||||
|
||||
# ASAN RPM packaging
|
||||
package_openmp_extras_asan_rpm() {
|
||||
# RPM packaging
|
||||
local packageName=$1
|
||||
local packageRpm="$packageDir/rpm"
|
||||
local specFile="$packageDir/$packageName.spec"
|
||||
local packageSummary="AddressSanitizer OpenMP Extras provides instrumented openmp and flang libraries."
|
||||
local packageSummaryLong="openmp-extras $packageVersion is based on LLVM 17 and is used for offloading to Radeon GPUs."
|
||||
local rpmRequires="hsa-rocr-asan, rocm-core-asan"
|
||||
# After build,runtime folder will have ASAN libaries.
|
||||
local asanLibDir="runtime"
|
||||
|
||||
# Cleanup previous packages
|
||||
rm -rf "$packageDir"
|
||||
rm -rf "$RPM_PATH"
|
||||
mkdir -p "$RPM_PATH"
|
||||
@@ -527,6 +609,7 @@ package_openmp_extras_asan_rpm() {
|
||||
echo "License: MIT and ASL 2.0 and ASL 2.0 with exceptions"
|
||||
echo "Vendor: Advanced Micro Devices, Inc."
|
||||
echo "Requires: $rpmRequires"
|
||||
# Redefining __os_install_post to prevent binary stripping
|
||||
echo "%define __os_install_post %{nil}"
|
||||
echo "%description"
|
||||
echo "%undefine _debugsource_packages"
|
||||
@@ -539,11 +622,16 @@ package_openmp_extras_asan_rpm() {
|
||||
echo "%install"
|
||||
echo "if [ -f $BUILD_PATH/build/installed_files.txt ] && [ ! -d "$INSTALL_PREFIX"/openmp-extras ]; then"
|
||||
echo " cat $BUILD_PATH/build/installed_files.txt | grep -P 'asan' | cut -d':' -f2 | cut -d' ' -f2 | xargs -I {} cp -d --parents {} \$RPM_BUILD_ROOT"
|
||||
# libgomp and libiomp5 are not on the install_manifest.txt and need
|
||||
# to be manually copied. Waiting on trunk patch to flow into amd-staging
|
||||
# to ensure these symlinks are in the manifest.
|
||||
echo " cp -d --parents "$installPath/lib/asan/libgomp.so" \$RPM_BUILD_ROOT"
|
||||
echo " cp -d --parents "$installPath/lib/asan/libiomp5.so" \$RPM_BUILD_ROOT"
|
||||
echo " cp -d --parents "$installPath/lib-debug/asan/libgomp.so" \$RPM_BUILD_ROOT"
|
||||
echo " cp -d --parents "$installPath/lib-debug/asan/libiomp5.so" \$RPM_BUILD_ROOT"
|
||||
# FIXME: Old packaging method, can delete once new packaging lands.
|
||||
echo "else"
|
||||
# Copy openmp-extras ASAN libraries to ASAN folders
|
||||
echo " mkdir -p \$RPM_BUILD_ROOT$installPath/lib/asan"
|
||||
echo " mkdir -p \$RPM_BUILD_ROOT$installPath/lib-debug/asan"
|
||||
echo " cp -r $AOMP/lib/asan/* \$RPM_BUILD_ROOT$installPath/lib/asan"
|
||||
@@ -554,8 +642,11 @@ package_openmp_extras_asan_rpm() {
|
||||
echo " cp -r $AOMP/devel/lib-debug/asan/* \$RPM_BUILD_ROOT$installPath/lib-debug/asan"
|
||||
echo "fi"
|
||||
|
||||
# Create symbolic links from /opt/rocm/bin to /opt/rocm/lib/llvm/bin utilities
|
||||
echo 'find $RPM_BUILD_ROOT \! -type d | sed "s|$RPM_BUILD_ROOT||"> files.list'
|
||||
|
||||
# Licensing
|
||||
# Copy licenses into share/doc/openmp-extras
|
||||
echo " mkdir -p \$RPM_BUILD_ROOT$copyPath/share/doc/openmp-extras-asan"
|
||||
echo " cp -r $AOMP_REPOS/aomp/LICENSE \$RPM_BUILD_ROOT$copyPath/share/doc/openmp-extras-asan/LICENSE.apache2"
|
||||
echo " cp -r $AOMP_REPOS/aomp-extras/LICENSE \$RPM_BUILD_ROOT$copyPath/share/doc/openmp-extras-asan/LICENSE.mit"
|
||||
@@ -566,6 +657,12 @@ package_openmp_extras_asan_rpm() {
|
||||
echo "%files -f files.list"
|
||||
echo " $copyPath/share/doc/openmp-extras-asan"
|
||||
echo "%defattr(-,root,root,-)"
|
||||
# Note: In some OS like SLES, during upgrade rocm-core is getting upgraded first and followed by other packages
|
||||
# rocm-core cannot delete rocm-ver folder, since it contains files of other packages that are yet to be upgraded
|
||||
# To remove rocm-ver folder after upgrade the spec file of other packages should contain the rocm-ver directory
|
||||
# Otherwise after upgrade empty old rocm-ver folder will be left out.
|
||||
# If empty remove /opt/rocm-ver folder and its subdirectories created by
|
||||
# openmp-extras runtime and devel package
|
||||
echo " $copyPath"
|
||||
|
||||
} > $specFile
|
||||
@@ -581,21 +678,29 @@ package_openmp_extras() {
|
||||
local llvm_ver=`$INSTALL_PREFIX/lib/llvm/bin/clang --print-resource-dir | sed 's^/llvm/lib/clang/^ ^' | awk '{print $2}'`
|
||||
local debNames="openmp-extras-runtime openmp-extras-dev"
|
||||
local rpmNames="openmp-extras-runtime openmp-extras-devel"
|
||||
ompdSrcDir="$INSTALL_PREFIX/lib/llvm/share/gdb/python/ompd/src"
|
||||
if [ "$SANITIZER" == "1" ]; then
|
||||
local asanPkgName="openmp-extras-asan"
|
||||
if [[ $DISTRO_NAME =~ "Ubuntu" ]]; then
|
||||
if [[ $DISTRO_NAME =~ "Ubuntu" ]] || [[ $DISTRO_NAME =~ "Debian" ]]; then
|
||||
echo "Warning: Assuming DEBs"
|
||||
package_openmp_extras_asan_deb $asanPkgName
|
||||
else
|
||||
echo "Warning: Assuming RPMs"
|
||||
package_openmp_extras_asan_rpm $asanPkgName
|
||||
fi
|
||||
# For ASAN build, create only ASAN package
|
||||
# Devel and runtime pkg should be created from non-asan build. So return the execution
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ $DISTRO_NAME =~ "Ubuntu" ]]; then
|
||||
# Only build deb in Ubuntu environment
|
||||
if [[ $DISTRO_NAME =~ "Ubuntu" ]] || [[ $DISTRO_NAME =~ "Debian" ]]; then
|
||||
echo "Warning: Assuming DEBs"
|
||||
for name in $debNames; do
|
||||
package_openmp_extras_deb $name
|
||||
done
|
||||
# Only build RPM in CENTOS/SLES environment
|
||||
else
|
||||
echo "Warning: Assuming RPMs"
|
||||
for name in $rpmNames; do
|
||||
package_openmp_extras_rpm $name
|
||||
done
|
||||
@@ -603,6 +708,7 @@ package_openmp_extras() {
|
||||
}
|
||||
|
||||
package_tests_deb(){
|
||||
# Openmp-extras debian test packaging
|
||||
local packageDir="$BUILD_PATH/package"
|
||||
local packageDeb="$packageDir/deb"
|
||||
local packageArch="amd64"
|
||||
@@ -615,6 +721,7 @@ package_tests_deb(){
|
||||
local installPath="$ROCM_INSTALL_PATH/share/openmp-extras/tests"
|
||||
local packageName="openmp-extras-tests"
|
||||
|
||||
# Cleanup previous packages
|
||||
rm -rf "$packageDir"
|
||||
|
||||
mkdir -p $packageDeb/openmp-extras"$installPath"
|
||||
@@ -622,9 +729,15 @@ package_tests_deb(){
|
||||
rm $(dirname $controlFile)
|
||||
fi
|
||||
mkdir -p "$(dirname $controlFile)"
|
||||
# Copy openmp-extras files
|
||||
cp -r "$AOMP_REPOS/aomp/." "$packageDeb/openmp-extras/$installPath"
|
||||
rm -rf "$packageDeb"/openmp-extras"$installPath"/.git "$packageDeb"/openmp-extras"$installPath"/.github
|
||||
cp "$OUT_DIR/build/lightning/bin/FileCheck" "$packageDeb/openmp-extras/$installPath/bin"
|
||||
# Copy FileCheck
|
||||
if [ -f "$OUT_DIR"/build/lightning/bin/FileCheck ]; then
|
||||
cp "$OUT_DIR/build/lightning/bin/FileCheck" "$packageDeb/openmp-extras/$installPath/bin"
|
||||
fi
|
||||
|
||||
# Create control file
|
||||
{
|
||||
echo "Package: $packageName"
|
||||
echo "Architecture: $packageArch"
|
||||
@@ -642,16 +755,19 @@ package_tests_deb(){
|
||||
}
|
||||
|
||||
package_tests_rpm(){
|
||||
# RPM packaging
|
||||
AOMP_STANDALONE_BUILD=1 $AOMP_REPOS/aomp/bin/build_fixups.sh
|
||||
local copyPath="$ROCM_INSTALL_PATH"
|
||||
local packageDir="$BUILD_PATH/package"
|
||||
local packageRpm="$packageDir/rpm"
|
||||
local installPath="$ROCM_INSTALL_PATH/share/openmp-extras/tests"
|
||||
local packageName="openmp-extras-tests"
|
||||
local rpmRequires="openmp-extras-devel, rocm-core"
|
||||
local specFile="$packageDir/$packageName.spec"
|
||||
local packageSummary="Tests for openmp-extras."
|
||||
local packageSummaryLong="Tests for openmp-extras $packageVersion is based on LLVM 18 and is used for offloading to Radeon GPUs."
|
||||
|
||||
# Cleanup previous packages
|
||||
rm -rf "$packageDir"
|
||||
mkdir -p "$packageRpm/openmp-extras/$installPath"
|
||||
{
|
||||
@@ -679,7 +795,9 @@ package_tests_rpm(){
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT$installPath"
|
||||
echo "cp -R $AOMP_REPOS/aomp/. \$RPM_BUILD_ROOT$installPath"
|
||||
echo "rm -rf \$RPM_BUILD_ROOT$installPath/.git \$RPM_BUILD_ROOT$installPath/.github"
|
||||
echo "cp $OUT_DIR/build/lightning/bin/FileCheck \$RPM_BUILD_ROOT$installPath/bin"
|
||||
echo "if [ -f $OUT_DIR/build/lightning/bin/FileCheck ]; then"
|
||||
echo " cp $OUT_DIR/build/lightning/bin/FileCheck \$RPM_BUILD_ROOT$installPath/bin"
|
||||
echo "fi"
|
||||
echo 'find $RPM_BUILD_ROOT \! -type d | sed "s|$RPM_BUILD_ROOT||"> files.list'
|
||||
|
||||
echo "%clean"
|
||||
@@ -698,8 +816,10 @@ package_tests_rpm(){
|
||||
|
||||
package_tests() {
|
||||
local DISTRO_NAME=$(cat /etc/os-release | grep -e ^NAME=)
|
||||
# Only build deb in Ubuntu environment
|
||||
if [[ $DISTRO_NAME =~ "Ubuntu" ]]; then
|
||||
package_tests_deb
|
||||
# Only build RPM in CENTOS/SLES environment
|
||||
else
|
||||
package_tests_rpm
|
||||
fi
|
||||
@@ -718,10 +838,21 @@ print_output_directory() {
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_openmp_extras ;;
|
||||
(build) build_openmp_extras; package_openmp_extras; package_tests ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
(clean)
|
||||
clean_openmp_extras
|
||||
;;
|
||||
(build)
|
||||
build_openmp_extras
|
||||
package_openmp_extras
|
||||
package_tests
|
||||
build_wheel "$BUILD_PATH" "$PROJ_NAME"
|
||||
;;
|
||||
(outdir)
|
||||
print_output_directory
|
||||
;;
|
||||
(*)
|
||||
die "Invalid target $TARGET"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src rccl
|
||||
|
||||
ENABLE_ADDRESS_SANITIZER=false
|
||||
|
||||
build_rccl() {
|
||||
echo "Start build"
|
||||
|
||||
@@ -24,19 +22,12 @@ build_rccl() {
|
||||
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
CC=${ROCM_PATH}/bin/amdclang \
|
||||
CXX=$(set_build_variables CXX) \
|
||||
CXX=$(set_build_variables __CXX__) \
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DHIP_COMPILER=clang \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH};${ROCM_PATH}/share/rocm/cmake/" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
@@ -50,7 +41,7 @@ build_rccl() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -64,7 +55,7 @@ clean_rccl() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rccl ;;
|
||||
build) build_rccl; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rccl ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,121 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$(dirname "$BASH_SOURCE")/compute_utils.sh"
|
||||
set -ex
|
||||
|
||||
printUsage() {
|
||||
echo
|
||||
echo "Usage: $(basename $0) [-c|-r|-h] [makeopts]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -c, --clean Removes all rdc build artifacts, except grpc"
|
||||
echo " -g, --clean_grpc Removes the grpc files and artifacts"
|
||||
echo " -r, --release Build release version of RDC (default is debug)"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
return 0
|
||||
}
|
||||
### Set up RPATH for RDC to simplify finding RDC libraries. Please note that
|
||||
### ROCm has a setup_env.sh script which already populates these variables.
|
||||
### These variables are then used inside compute_utils.sh.
|
||||
###
|
||||
### We need to append additional paths to these variables BEFORE sourcing
|
||||
### compute_utils.sh
|
||||
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
RDC_BUILD_DIR=$(getBuildPath rdc)
|
||||
GRPC_BUILD_DIR=$(getBuildPath grpc)
|
||||
TARGET="build"
|
||||
PACKAGE_LIB=$(getLibPath)
|
||||
PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
PACKAGE_BIN="$(getBinPath)"
|
||||
RDC_PACKAGE_DEB_DIR="$PACKAGE_ROOT/deb/rdc"
|
||||
RDC_PACKAGE_RPM_DIR="$PACKAGE_ROOT/rpm/rdc"
|
||||
BUILD_TYPE="Debug"
|
||||
MAKETARGET="deb"
|
||||
MAKEARG="$DASH_JAY O=$RDC_BUILD_DIR"
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
CLEAN_GRPC="no"
|
||||
PKGTYPE="deb"
|
||||
RDC_MAKE_OPTS="$DASH_JAY O=$RDC_BUILD_DIR -C $RDC_BUILD_DIR"
|
||||
BUILD_DOCS="no"
|
||||
RDC_PKG_NAME_ROOT="rdc"
|
||||
RDC_PKG_NAME="${RDC_PKG_NAME_ROOT}"
|
||||
GRPC_PROTOC_ROOT="${RDC_BUILD_DIR}/grpc"
|
||||
GRPC_SEARCH_ROOT="/usr/grpc"
|
||||
GRPC_DESIRED_VERSION="1.61.0"
|
||||
|
||||
RDC_LIB_RPATH='$ORIGIN'
|
||||
RDC_LIB_RPATH=$RDC_LIB_RPATH:'$ORIGIN/..'
|
||||
RDC_LIB_RPATH=$RDC_LIB_RPATH:'$ORIGIN/rdc/grpc/lib'
|
||||
RDC_LIB_RPATH=$RDC_LIB_RPATH:'$ORIGIN/grpc/lib'
|
||||
RDC_EXE_RPATH='$ORIGIN/../lib'
|
||||
RDC_EXE_RPATH=$RDC_EXE_RPATH:'$ORIGIN/../lib/rdc/grpc/lib'
|
||||
|
||||
VALID_STR=`getopt -o hcgradso:p: --long help,clean,clean_grpc,release,documentation,static,address_sanitizer,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
(-c | --clean)
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
(-g | --clean_grpc)
|
||||
TARGET="clean_grpc" ; shift ;;
|
||||
(-r | --release)
|
||||
BUILD_TYPE="Release" ; shift ;;
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-d | --documentation )
|
||||
BUILD_DOCS="yes" ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
MAKETARGET="$2" ; shift 2;;
|
||||
--) shift; break;;
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
RET_CONFLICT=1
|
||||
check_conflicting_options $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
if [ $RET_CONFLICT -ge 30 ]; then
|
||||
print_vars $API_NAME $TARGET $BUILD_TYPE $SHARED_LIBS $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
exit $RET_CONFLICT
|
||||
# lib/rdc/librdc_rocp.so needs lib/librdc_bootstrap.so
|
||||
# this also covers the ASAN usecase
|
||||
ROCM_LIB_RPATH=$ROCM_LIB_RPATH:'$ORIGIN/..'
|
||||
# grpc
|
||||
ROCM_LIB_RPATH=$ROCM_LIB_RPATH:'$ORIGIN/rdc/grpc/lib'
|
||||
ROCM_LIB_RPATH=$ROCM_LIB_RPATH:'$ORIGIN/grpc/lib'
|
||||
# help RDC executables find RDC libraries
|
||||
# lib/librdc_bootstrap.so.0 and grpc
|
||||
ROCM_EXE_RPATH=$ROCM_EXE_RPATH:'$ORIGIN/../lib/rdc/grpc/lib'
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
ROCM_EXE_RPATH="$ROCM_ASAN_EXE_RPATH:$ROCM_EXE_RPATH"
|
||||
fi
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
clean_rdc() {
|
||||
rm -rf "$RDC_BUILD_DIR"
|
||||
rm -rf "$RDC_PACKAGE_DEB_DIR"
|
||||
rm -rf "$RDC_PACKAGE_RPM_DIR"
|
||||
rm -rf "$RDC_BUILD_DIR/rdc"
|
||||
set_component_src rdc
|
||||
|
||||
rm -rf "$PACKAGE_INCLUDE/rdc"
|
||||
rm -f $PACKAGE_LIB/librdc*
|
||||
rm -f $PACKAGE_BIN/rdci
|
||||
return 0
|
||||
}
|
||||
|
||||
clean_grpc() {
|
||||
rm -rf "$GRPC_BUILD_DIR"
|
||||
}
|
||||
# RDC
|
||||
# BUILD ARGUMENTS
|
||||
BUILD_DOCS="no"
|
||||
GRPC_PROTOC_ROOT="${BUILD_DIR}/grpc"
|
||||
GRPC_SEARCH_ROOT="/usr/grpc"
|
||||
GRPC_DESIRED_VERSION="1.67.1" # do not include 'v'
|
||||
# lib/librocm_smi64.so and lib/libamd_smi.so
|
||||
|
||||
# check if exact version of gRPC is installed
|
||||
find_grpc() {
|
||||
grep -s -F "$GRPC_DESIRED_VERSION" ${GRPC_SEARCH_ROOT}/*/cmake/grpc/gRPCConfigVersion.cmake &&
|
||||
GRPC_PROTOC_ROOT=$GRPC_SEARCH_ROOT
|
||||
}
|
||||
|
||||
rdc_backwards_compat_cmake_params() {
|
||||
grep -q "RDC_CLIENT_INSTALL_PREFIX" "$RDC_ROOT/CMakeLists.txt" &&
|
||||
echo "-DRDC_CLIENT_INSTALL_PREFIX=$PACKAGE_ROOT"
|
||||
}
|
||||
|
||||
build_rdc() {
|
||||
if ! find_grpc; then
|
||||
echo "ERROR: GRPC SEARCH FAILED!"
|
||||
@@ -125,81 +49,96 @@ build_rdc() {
|
||||
fi
|
||||
echo "gRPC [${GRPC_DESIRED_VERSION}] found!"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
CXX=$(set_build_variables __C_++__)
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# NOTE: Temp fix for ASAN failures SWDEV-515858
|
||||
export ASAN_OPTIONS="detect_leaks=0:new_delete_type_mismatch=0"
|
||||
fi
|
||||
|
||||
echo "Building RDC"
|
||||
echo "RDC_BUILD_DIR: ${RDC_BUILD_DIR}"
|
||||
echo "GRPC_PROTOC_ROOT: ${GRPC_PROTOC_ROOT}"
|
||||
|
||||
export LD_PRELOAD="$ASAN_LIB_PATH"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
# NOTE: Temp workaround for libasan not being first in the library list.
|
||||
# libasan not being first causes ADDRESS_SANITIZER builds to fail.
|
||||
# This value is set by set_asan_env_vars. Which is only called when -a arg is passed.
|
||||
export LD_PRELOAD="$ASAN_LIB_PATH"
|
||||
fi
|
||||
|
||||
if [ ! -d "$RDC_BUILD_DIR/rdc_libs" ]; then
|
||||
mkdir -p $RDC_BUILD_DIR
|
||||
pushd $RDC_BUILD_DIR
|
||||
echo "C compiler: $CC"
|
||||
echo "CXX compiler: $CXX"
|
||||
init_rocm_common_cmake_params
|
||||
if [ ! -d "$BUILD_DIR/rdc_libs" ]; then
|
||||
mkdir -p "$BUILD_DIR"
|
||||
pushd "$BUILD_DIR"
|
||||
cmake \
|
||||
-DGRPC_ROOT="$GRPC_PROTOC_ROOT" \
|
||||
-DGRPC_DESIRED_VERSION="$GRPC_DESIRED_VERSION" \
|
||||
-DCMAKE_MODULE_PATH="$RDC_ROOT/cmake_modules" \
|
||||
$(rocm_cmake_params) \
|
||||
$(rdc_backwards_compat_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DROCM_DIR=$ROCM_INSTALL_PATH \
|
||||
-DRDC_PACKAGE="${RDC_PKG_NAME}" \
|
||||
-DCMAKE_MODULE_PATH="$COMPONENT_SRC/cmake_modules" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DCPACK_GENERATOR="${PKGTYPE^^}" \
|
||||
-DROCM_DIR=$ROCM_PATH \
|
||||
-DCPACK_PACKAGE_VERSION_MAJOR="1" \
|
||||
-DCPACK_PACKAGE_VERSION_MINOR="$ROCM_LIBPATCH_VERSION" \
|
||||
-DCPACK_PACKAGE_VERSION_PATCH="0" \
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
-DBUILD_TESTS=ON \
|
||||
-DBUILD_PROFILER=ON \
|
||||
-DBUILD_RVS=ON \
|
||||
-DCMAKE_SKIP_BUILD_RPATH=TRUE \
|
||||
-DCMAKE_EXE_LINKER_FLAGS_INIT="-Wl,--no-as-needed,-z,origin,--enable-new-dtags,--build-id=sha1,--rpath,$RDC_EXE_RPATH" \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--no-as-needed,-z,origin,--enable-new-dtags,--build-id=sha1,--rpath,$RDC_LIB_RPATH" \
|
||||
"$RDC_ROOT"
|
||||
"$COMPONENT_SRC"
|
||||
popd
|
||||
fi
|
||||
echo "Making rdc package:"
|
||||
cmake --build "$RDC_BUILD_DIR" -- $RDC_MAKE_OPTS
|
||||
cmake --build "$RDC_BUILD_DIR" -- $RDC_MAKE_OPTS install
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
cmake --build "$BUILD_DIR" -- install
|
||||
|
||||
unset LD_PRELOAD
|
||||
cmake --build "$RDC_BUILD_DIR" -- $RDC_MAKE_OPTS package
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$RDC_PACKAGE_DEB_DIR" "$RDC_BUILD_DIR/$RDC_PKG_NAME"*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$RDC_PACKAGE_RPM_DIR" "$RDC_BUILD_DIR/$RDC_PKG_NAME"*.rpm
|
||||
|
||||
if [ ! -e $ROCM_INSTALL_PATH/include/rdc/rdc.h ]; then
|
||||
cp -r "$ROCM_INSTALL_PATH/rdc/lib/." "$PACKAGE_LIB"
|
||||
cp -r "$ROCM_INSTALL_PATH/rdc/bin/." "$PACKAGE_BIN"
|
||||
cp -r "$ROCM_INSTALL_PATH/rdc/include/." "$PACKAGE_INCLUDE"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
# NOTE: Must disable LD_PRELOAD hack before packaging!
|
||||
# cmake fails with cryptic error on RHEL:
|
||||
#
|
||||
# AddressSanitizer:DEADLYSIGNAL
|
||||
# ==17083==ERROR: AddressSanitizer: stack-overflow on address ...
|
||||
#
|
||||
# The issue is likely in python3.6 cpack scripts
|
||||
unset LD_PRELOAD
|
||||
fi
|
||||
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
if [ "$BUILD_DOCS" = "yes" ]; then
|
||||
echo "Building Docs"
|
||||
cmake --build "$RDC_BUILD_DIR" -- $RDC_MAKE_OPTS doc
|
||||
pushd $RDC_BUILD_DIR/latex
|
||||
cmake --build "$BUILD_DIR" -- doc
|
||||
pushd "$BUILD_DIR"/latex
|
||||
cmake --build . --
|
||||
mv refman.pdf "$ROCM_INSTALL_PATH/rdc/RDC_Manual.pdf"
|
||||
mv refman.pdf "$ROCM_PATH/rdc/RDC_Manual.pdf"
|
||||
popd
|
||||
fi
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
echo ${RDC_PACKAGE_DEB_DIR};;
|
||||
("rpm")
|
||||
echo ${RDC_PACKAGE_RPM_DIR};;
|
||||
(*)
|
||||
echo "Invalid package type \"${PKGTYPE}\" provided for -o" >&2; exit 1;;
|
||||
esac
|
||||
exit
|
||||
clean_rdc() {
|
||||
echo "Cleaning RDC build directory: ${BUILD_DIR} ${PACKAGE_DIR}"
|
||||
rm -rf "$BUILD_DIR" "$PACKAGE_DIR"
|
||||
return 0
|
||||
}
|
||||
|
||||
verifyEnvSetup
|
||||
stage2_command_args "$@"
|
||||
disable_debug_package_generation
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_rdc ;;
|
||||
(clean_grpc) clean_grpc ;;
|
||||
(build) build_rdc ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
clean) clean_rdc ;;
|
||||
build) build_rdc ;;
|
||||
outdir) print_output_directory ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -1,35 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src rocAL
|
||||
|
||||
build_rocal() {
|
||||
|
||||
echo "Start build"
|
||||
|
||||
# Enable ASAN
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
if [ "$DISTRO_ID" = "mariner-2.0" ] || [ "$DISTRO_ID" = "azurelinux-3.0" ] ; then
|
||||
echo "Not building rocal for ${DISTRO_ID}. Exiting..."
|
||||
return 0
|
||||
fi
|
||||
|
||||
# python3 ${COMPONENT_SRC}/rocAL-setup.py
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
# Enable ASAN
|
||||
# Temporarily disable ASAN for rocal - SWDEV-471302
|
||||
#if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
# set_asan_env_vars
|
||||
# set_address_sanitizer_on
|
||||
#fi
|
||||
pushd /tmp
|
||||
|
||||
# PyBind11
|
||||
rm -rf pybind11
|
||||
git clone -b v2.11.1 https://github.com/pybind/pybind11
|
||||
cd pybind11 && mkdir build && cd build
|
||||
cmake -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON ../
|
||||
make -j$(nproc) && sudo make install
|
||||
cd ../..
|
||||
|
||||
# Turbo JPEG
|
||||
rm -rf libjpeg-turbo
|
||||
git clone -b 3.0.2 https://github.com/libjpeg-turbo/libjpeg-turbo.git
|
||||
cd libjpeg-turbo && mkdir build && cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib -DWITH_JPEG8=TRUE ..
|
||||
make -j$(nproc) && sudo make install
|
||||
cd ../..
|
||||
|
||||
# RapidJSON
|
||||
rm -rf rapidjson
|
||||
git clone https://github.com/Tencent/rapidjson.git
|
||||
cd rapidjson && mkdir build && cd build
|
||||
cmake .. && make -j$(nproc) && sudo make install
|
||||
@@ -37,16 +51,19 @@ build_rocal() {
|
||||
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
|
||||
cmake -DAMDRPP_PATH=$ROCM_PATH ${COMPONENT_SRC}
|
||||
make -j${PROC}
|
||||
# python3 ../rocAL-setup.py
|
||||
|
||||
if [[ "${DISTRO_ID}" == almalinux-8* ]]; then
|
||||
cmake -DPYTHON_VERSION_SUGGESTED=3.8 -DAMDRPP_PATH=$ROCM_PATH ${COMPONENT_SRC}
|
||||
else
|
||||
cmake -DAMDRPP_PATH=$ROCM_PATH ${COMPONENT_SRC}
|
||||
fi
|
||||
make -j8
|
||||
cmake --build . --target PyPackageInstall
|
||||
sudo make install
|
||||
sudo make package
|
||||
sudo chown -R $(id -u):$(id -g) ${BUILD_DIR}
|
||||
make package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR
|
||||
cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
@@ -59,7 +76,7 @@ clean_rocal() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocal ;;
|
||||
build) build_rocal; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocal ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
PATH=${ROCM_PATH}/bin:$PATH
|
||||
set_component_src rocALUTION
|
||||
@@ -16,7 +16,7 @@ build_rocalution() {
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
CXX="g++"
|
||||
CXX=$(set_build_variables __G_++__)
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -28,17 +28,11 @@ build_rocalution() {
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
-DSUPPORT_HIP=ON \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
@@ -51,7 +45,7 @@ build_rocalution() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -65,7 +59,7 @@ clean_rocalution() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocalution ;;
|
||||
build) build_rocalution; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocalution ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src rocBLAS
|
||||
DEPS_DIR=${HOME}/rocblas
|
||||
|
||||
stage2_command_args "$@"
|
||||
disable_debug_package_generation
|
||||
|
||||
build_rocblas() {
|
||||
echo "Start build"
|
||||
@@ -17,28 +18,37 @@ build_rocblas() {
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
#Removed GPU ARCHS from here as it will be part of compute_utils.sh ROCMOPS-7302 & ROCMOPS-8091
|
||||
# Temporary workaround for rocBLAS to build with ASAN as suggested in #SWDEV-314505
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
export ASAN_OPTIONS="detect_leaks=0:verify_asan_link_order=0"
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
export ASAN_OPTIONS="detect_leaks=0:verify_asan_link_order=0"
|
||||
# updating GPU_ARCHS for ASAN build to supported gpu arch only SWDEV-479178
|
||||
#GPU_ARCHS="gfx90a:xnack+;gfx942:xnack+" #This will be part of compute_utils.sh ROCMOPS-7302 & ROCMOPS-8091
|
||||
fi
|
||||
|
||||
LAZY_LOADING=ON
|
||||
SEPARATE_ARCHES=ON
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
CXX=$(set_build_variables __AMD_CLANG_++__)
|
||||
mkdir -p $DEPS_DIR && cp -r /usr/blis $DEPS_DIR
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
# if ENABLE_GPU_ARCH is set in env by Job parameter ENABLE_GPU_ARCH, then set GFX_ARCH to that value. This will override any of the case values above
|
||||
if [ -n "$ENABLE_GPU_ARCH" ]; then
|
||||
#setting gfx arch as part of rocm_common_cmake_params
|
||||
set_gpu_arch "${ENABLE_GPU_ARCH}"
|
||||
fi
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
echo "C compiler: $CC"
|
||||
echo "CXX compiler: $CXX"
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
cmake \
|
||||
-DCMAKE_TOOLCHAIN_FILE=toolchain-linux.cmake \
|
||||
-DBUILD_DIR="${BUILD_DIR}" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DROCM_DIR="${ROCM_PATH}" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
@@ -47,11 +57,10 @@ build_rocblas() {
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DLINK_BLIS=ON \
|
||||
-DAMDGPU_TARGETS="${GPU_TARGETS}" \
|
||||
-DTensile_CODE_OBJECT_VERSION=default \
|
||||
-DTensile_LOGIC=asm_full \
|
||||
-DTensile_SEPARATE_ARCHITECTURES=ON \
|
||||
-DTensile_LAZY_LIBRARY_LOADING=ON \
|
||||
-DTensile_SEPARATE_ARCHITECTURES="${SEPARATE_ARCHES}" \
|
||||
-DTensile_LAZY_LIBRARY_LOADING="${LAZY_LOADING}" \
|
||||
-DTensile_LIBRARY_FORMAT=msgpack \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
-DTENSILE_VENV_UPGRADE_PIP=ON \
|
||||
@@ -63,7 +72,7 @@ build_rocblas() {
|
||||
|
||||
rm -rf _CPack_Packages/ && rm -rf ./library/src/build_tmp && find -name '*.o' -delete
|
||||
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -75,7 +84,7 @@ clean_rocblas() {
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocblas ;;
|
||||
build) build_rocblas; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocblas ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
set_component_src rocDecode
|
||||
BUILD_DEV=ON
|
||||
build_rocdecode() {
|
||||
if [ "$DISTRO_ID" = "centos-7" ] || \
|
||||
[ "$DISTRO_ID" = "mariner-2.0" ] || \
|
||||
[ "$DISTRO_ID" = "azurelinux-3.0" ] || \
|
||||
[ "$DISTRO_ID" = "debian-10" ]; then
|
||||
echo "Not building rocDecode for ${DISTRO_ID}. Exiting..."
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
@@ -11,18 +19,27 @@ build_rocdecode() {
|
||||
fi
|
||||
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
# python3 ${COMPONENT_SRC}/rocDecode-setup.py --developer OFF
|
||||
|
||||
cmake -DROCM_DEP_ROCMCORE=ON ${COMPONENT_SRC}
|
||||
make -j8
|
||||
make install
|
||||
make package
|
||||
|
||||
# for i in {1..5}; do
|
||||
# python3 ../rocDecode-setup.py --developer OFF && break || {
|
||||
# echo "Attempt $i failed! Retrying in $((i * 30)) seconds..."
|
||||
# sleep $((i * 30))
|
||||
# }
|
||||
# done
|
||||
# python3 ${COMPONENT_SRC}/rocDecode-setup.py --developer OFF
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DROCM_DEP_ROCMCORE=ON \
|
||||
-DROCDECODE_ENABLE_ROCPROFILER_REGISTER=ON \
|
||||
"${COMPONENT_SRC}"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
cpack -G ${PKGTYPE^^} -B ${BUILD_DIR}
|
||||
cmake --build "$BUILD_DIR" -- install
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR
|
||||
cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
show_build_cache_stats
|
||||
}
|
||||
clean_rocdecode() {
|
||||
@@ -32,7 +49,7 @@ clean_rocdecode() {
|
||||
}
|
||||
stage2_command_args "$@"
|
||||
case $TARGET in
|
||||
build) build_rocdecode ;;
|
||||
build) build_rocdecode; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocdecode ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
PATH=${ROCM_PATH}/bin:$PATH
|
||||
set_component_src rocFFT
|
||||
@@ -9,6 +9,10 @@ set_component_src rocFFT
|
||||
build_rocfft() {
|
||||
echo "Start Build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
@@ -18,17 +22,14 @@ build_rocfft() {
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
#Removed GPU ARCHS from here as it will be part of compute_utils.sh ROCMOPS-7302 & ROCMOPS-8091
|
||||
|
||||
CXX="${ROCM_PATH}/bin/hipcc" \
|
||||
# Work around for HIP sources with C++ suffix, and force CXXFLAGS for both
|
||||
# HIP and C++ compiles
|
||||
CXX=$(set_build_variables __HIP_CC__) \
|
||||
cmake \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DUSE_HIP_CLANG=ON \
|
||||
-DHIP_COMPILER=clang \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
@@ -41,7 +42,7 @@ build_rocfft() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -55,7 +56,7 @@ clean_rocfft() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocfft ;;
|
||||
build) build_rocfft; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocfft ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
set_component_src rocJPEG
|
||||
BUILD_DEV=ON
|
||||
build_rocjpeg() {
|
||||
if [ "$DISTRO_ID" = "centos-7" ] || [ "$DISTRO_ID" = "sles-15.4" ] || [ "$DISTRO_ID" = "azurelinux-3.0" ] || [ "$DISTRO_ID" = "debian-10" ]; then
|
||||
echo "Not building rocJPEG for ${DISTRO_ID}. Exiting..."
|
||||
return 0
|
||||
fi
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
@@ -13,16 +17,15 @@ build_rocjpeg() {
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
# python3 ../rocJPEG-setup.py
|
||||
|
||||
cmake -DROCM_DEP_ROCMCORE=ON "$COMPONENT_SRC"
|
||||
make -j8
|
||||
make install
|
||||
make package
|
||||
cmake ${GEN_NINJA} -DROCM_DEP_ROCMCORE=ON -DROCJPEG_ENABLE_ROCPROFILER_REGISTER=ON "$COMPONENT_SRC"
|
||||
ninja -j8
|
||||
ninja install
|
||||
ninja package
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
cpack -G ${PKGTYPE^^}
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR
|
||||
cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
show_build_cache_stats
|
||||
}
|
||||
clean_rocjpeg() {
|
||||
|
||||
@@ -23,16 +23,15 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## ROCm cmake build (using Makefile) environment variables
|
||||
PROJ_NAME="rocm-cmake"
|
||||
TARGET="build"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/rocm-cmake"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/rocm-cmake"
|
||||
ROCM_CMAKE_BUILD_DIR="$(getBuildPath rocm-cmake)"
|
||||
|
||||
ROCM_CMAKE_BUILD_DIR="$(getBuildPath rocm-cmake)"
|
||||
ROCM_CMAKE_PACKAGE_DEB="$(getPackageRoot)/deb/rocm-cmake"
|
||||
ROCM_CMAKE_PACKAGE_RPM="$(getPackageRoot)/rpm/rocm-cmake"
|
||||
ROCM_WHEEL_DIR="${ROCM_CMAKE_BUILD_DIR}/_wheel"
|
||||
## ROCm cmake build (using CMake) environment variables
|
||||
ROCM_CMAKE_BUILD_DIR="$(getBuildPath $PROJ_NAME)"
|
||||
ROCM_CMAKE_PACKAGE_DEB="$PACKAGE_ROOT/deb/$PROJ_NAME"
|
||||
ROCM_CMAKE_PACKAGE_RPM="$PACKAGE_ROOT/rpm/$PROJ_NAME"
|
||||
ROCM_CMAKE_BUILD_TYPE="debug"
|
||||
BUILD_TYPE="Debug"
|
||||
SHARED_LIBS="ON"
|
||||
@@ -40,11 +39,13 @@ CLEAN_OR_OUT=0;
|
||||
PKGTYPE="deb"
|
||||
MAKETARGET="deb"
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,static,wheel,address_sanitizer,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -57,12 +58,12 @@ do
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
MAKETARGET="$2" ; shift 2;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -78,7 +79,6 @@ fi
|
||||
|
||||
|
||||
clean_rocm_cmake() {
|
||||
rm -rf "$ROCM_WHEEL_DIR"
|
||||
rm -rf $ROCM_CMAKE_BUILD_DIR
|
||||
rm -rf $ROCM_CMAKE_PACKAGE_DEB
|
||||
rm -rf $ROCM_CMAKE_PACKAGE_RPM
|
||||
@@ -106,19 +106,6 @@ build_rocm_cmake() {
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$ROCM_CMAKE_PACKAGE_RPM" $ROCM_CMAKE_BUILD_DIR/rocm-cmake*.rpm
|
||||
}
|
||||
|
||||
create_wheel_package() {
|
||||
echo "Creating rocm-cmake wheel package"
|
||||
# Copy the setup.py generator to build folder
|
||||
mkdir -p $ROCM_WHEEL_DIR
|
||||
cp -f $SCRIPT_ROOT/generate_setup_py.py $ROCM_WHEEL_DIR
|
||||
cp -f $SCRIPT_ROOT/repackage_wheel.sh $ROCM_WHEEL_DIR
|
||||
cd $ROCM_WHEEL_DIR
|
||||
# Currently only supports python3.6
|
||||
./repackage_wheel.sh $ROCM_CMAKE_BUILD_DIR/rocm-cmake*.rpm python3.6
|
||||
# Copy the wheel created to RPM folder which will be uploaded to artifactory
|
||||
copy_if WHL "WHL" "$ROCM_CMAKE_PACKAGE_RPM" "$ROCM_WHEEL_DIR"/dist/*.whl
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
@@ -132,15 +119,19 @@ print_output_directory() {
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_rocm_cmake ;;
|
||||
(build) build_rocm_cmake ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
(clean)
|
||||
clean_rocm_cmake
|
||||
;;
|
||||
(build)
|
||||
build_rocm_cmake
|
||||
build_wheel "$ROCM_CMAKE_BUILD_DIR" "$PROJ_NAME"
|
||||
;;
|
||||
(outdir)
|
||||
print_output_directory
|
||||
;;
|
||||
(*)
|
||||
die "Invalid target $TARGET"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ $WHEEL_PACKAGE == true ]]; then
|
||||
echo "Wheel Package build started !!!!"
|
||||
create_wheel_package
|
||||
fi
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -13,8 +13,10 @@ printUsage() {
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -w, --wheel Creates python wheel package of rocm-core.
|
||||
It needs to be used along with -r option"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
echo " deb -> Debian format (default)"
|
||||
@@ -24,6 +26,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## ROCm build (using CMake) environment variables
|
||||
PROJ_NAME="rocm-core"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
ROCM_CORE_BUILD_DIR="$(getBuildPath rocm_core)"
|
||||
@@ -38,7 +41,8 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
ADDRESS_SANITIZER=false
|
||||
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,static,address_sanitizer,outdir:,package: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,static,address_sanitizer,outdir,wheel:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
@@ -56,6 +60,8 @@ do
|
||||
ADDRESS_SANITIZER=true ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package )
|
||||
@@ -87,14 +93,11 @@ build_rocm_core() {
|
||||
if [ ! -d "$ROCM_CORE_BUILD_DIR" ]; then
|
||||
mkdir -p "$ROCM_CORE_BUILD_DIR"
|
||||
fi
|
||||
|
||||
pushd "$ROCM_CORE_BUILD_DIR"
|
||||
cmake \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCMAKE_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
-DCPACK_GENERATOR="${CPACKGEN:-"DEB;RPM"}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DCPACK_DEBIAN_PACKAGE_RELEASE=$CPACK_DEBIAN_PACKAGE_RELEASE \
|
||||
-DCPACK_RPM_PACKAGE_RELEASE=$CPACK_RPM_PACKAGE_RELEASE \
|
||||
-DROCM_VERSION="$ROCM_VERSION" \
|
||||
@@ -109,24 +112,33 @@ build_rocm_core() {
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
echo ${ROCM_CORE_PACKAGE_DEB};;
|
||||
("rpm")
|
||||
echo ${ROCM_CORE_PACKAGE_RPM};;
|
||||
(*)
|
||||
echo "Invalid package type \"${PKGTYPE}\" provided for -o" >&2; exit 1;;
|
||||
esac
|
||||
exit
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
verifyEnvSetup
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_rocm_core ;;
|
||||
(build) build_rocm_core ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
(clean)
|
||||
clean_rocm_core
|
||||
;;
|
||||
(build)
|
||||
build_rocm_core
|
||||
build_wheel "$ROCM_CORE_BUILD_DIR" "$PROJ_NAME"
|
||||
;;
|
||||
(outdir)
|
||||
print_output_directory
|
||||
;;
|
||||
(*)
|
||||
die "Invalid target $TARGET"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -2,13 +2,18 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
stage2_command_args "$@"
|
||||
build_rocm-dev(){
|
||||
$(dirname "${BASH_SOURCE[0]}")/build_rocm.sh -d
|
||||
mv ${OUT_DIR}/${PKGTYPE}/meta ${OUT_DIR}/${PKGTYPE}/rocm-dev
|
||||
}
|
||||
|
||||
|
||||
case $TARGET in
|
||||
build) echo "end of rocm-dev build..." ;;
|
||||
outdir) ;;
|
||||
clean) echo "Cleaning rocm-dev is not required..." ;;
|
||||
build) build_rocm-dev ;;
|
||||
outdir) echo "${OUT_DIR}/${PKGTYPE}/rocm-dev" ;;
|
||||
clean) rm -rf ${OUT_DIR}/${PKGTYPE}/rocm-dev ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "${BASH_SOURCE%/*}/compute_utils.sh" || return
|
||||
|
||||
# Can't use -R or -r in here
|
||||
remove_make_r_flags
|
||||
|
||||
printUsage() {
|
||||
@@ -15,8 +14,10 @@ printUsage() {
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -w, --wheel Creates python wheel package of rocm-gdb.
|
||||
It needs to be used along with -r option"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
echo " deb -> Debian format (default)"
|
||||
@@ -32,23 +33,32 @@ toStdoutStderr(){
|
||||
}
|
||||
|
||||
linkFiles(){
|
||||
# Attempt to use hard links first for speed and save disk,
|
||||
# if that fails do a copy
|
||||
cp -lfR "$1" "$2" || cp -fR "$1" "$2"
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
PROJ_NAME=rocm-gdb
|
||||
TARGET=build
|
||||
MAKETARGET=deb
|
||||
BUILD_DIR=$(getBuildPath $PROJ_NAME)
|
||||
PACKAGE_DEB=$(getPackageRoot)/deb/$PROJ_NAME
|
||||
PACKAGE_RPM=$(getPackageRoot)/rpm/$PROJ_NAME
|
||||
MAKE_OPTS="$DASH_JAY"
|
||||
MAKETARGET=deb # Not currently used
|
||||
BUILD_DIR=$(getBuildPath $PROJ_NAME) # e.g. out/ubuntu.16.04/16.04/build/rocm-gdb
|
||||
PACKAGE_DEB=$(getPackageRoot)/deb/$PROJ_NAME # e.g. out/ubuntu.16.04/16.04/deb
|
||||
PACKAGE_RPM=$(getPackageRoot)/rpm/$PROJ_NAME # e.g. out/ubuntu.16.04/16.04/rpm
|
||||
MAKE_OPTS="$DASH_JAY" # e.g. -j 56
|
||||
BUG_URL="https://github.com/ROCm-Developer-Tools/ROCgdb/issues"
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
|
||||
LIB_AMD_PYTHON="libamdpython.so"
|
||||
LIB_AMD_PYTHON="amdpythonlib.so" #lib name which replaces required python lib
|
||||
LIB_AMD_PYTHON_DIR_PATH=${ROCM_INSTALL_PATH}/lib
|
||||
|
||||
|
||||
# A curated list of things to keep. It would be safer to have a list
|
||||
# of things to remove, as failing to remove something is usually much
|
||||
# less harmful than removeing too much.
|
||||
|
||||
tokeep=(
|
||||
main${ROCM_INSTALL_PATH}/bin/rocgdb
|
||||
@@ -77,13 +87,18 @@ tokeep=(
|
||||
keep_wanted_files(){
|
||||
(
|
||||
cd "$BUILD_DIR/package/"
|
||||
# generate the keep pattern as one name per line
|
||||
printf -v keeppattern '%s\n' "${tokeep[@]}"
|
||||
find main/opt -type f | grep -xv "$keeppattern" | xargs -r rm
|
||||
# prune empty directories
|
||||
find main/opt -type d -empty -delete
|
||||
)
|
||||
return 0
|
||||
}
|
||||
|
||||
# Move to a function so that both package_deb and package_rpm can call
|
||||
# and remove the depenency of package_rpm_tests on package_deb.
|
||||
# Copy the required files to create a stand-alone testsuite.
|
||||
copy_testsuite_files() {
|
||||
(
|
||||
dest="$BUILD_DIR/package/tests${ROCM_INSTALL_PATH}/test/gdb/"
|
||||
@@ -113,43 +128,57 @@ clean() {
|
||||
rm -rf $PACKAGE_RPM
|
||||
}
|
||||
|
||||
# set the lexically bound variable VERSION to the current version
|
||||
# A passed parameter gives the default
|
||||
# Note that this might need to be stripped further as it might have
|
||||
# things like "-git" which is not acceptable as a version to rpm.
|
||||
get_version(){
|
||||
VERSION=$(sed -n 's/^.*char version[^"]*"\([^"]*\)".*;.*/\1/p' $BUILD_DIR/gdb/version.c || : )
|
||||
VERSION=${VERSION:-$1}
|
||||
}
|
||||
|
||||
package_deb(){
|
||||
# Package main binary.
|
||||
# TODO package documentation when we build some.
|
||||
mkdir -p "$BUILD_DIR/package/main/DEBIAN"
|
||||
# Extract version from build
|
||||
local VERSION
|
||||
get_version unknown
|
||||
# add upgrade related version sub-field
|
||||
VERSION="${VERSION}.${ROCM_LIBPATCH_VERSION}"
|
||||
|
||||
#create postinstall and prerm
|
||||
grep -v '^# ' > "$BUILD_DIR/package/main/DEBIAN/preinst" <<EOF
|
||||
grep -v '^# ' > "$BUILD_DIR/package/main/DEBIAN/postinst" <<EOF
|
||||
#!/bin/sh
|
||||
# Pre-installation script commands
|
||||
echo "Running pre-installation script..."
|
||||
mkdir -p ${ROCM_INSTALL_PATH}/lib
|
||||
PYTHON_LIB_INSTALLED=\$(ldconfig -p | awk '/libpython3/ { print \$NF; exit}')
|
||||
ln -s \$PYTHON_LIB_INSTALLED ${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON
|
||||
echo "pre-installation done."
|
||||
|
||||
# Post-installation script commands
|
||||
echo "Running post-installation script..."
|
||||
mkdir -p $LIB_AMD_PYTHON_DIR_PATH
|
||||
# Choosing the lowest version of the libpython3 installed.
|
||||
PYTHON_LIB_INSTALLED=\$(find /lib/ -name 'libpython3*.so' | head -n 1)
|
||||
echo "Installing rocm-gdb with [\$PYTHON_LIB_INSTALLED]."
|
||||
ln -s \$PYTHON_LIB_INSTALLED $LIB_AMD_PYTHON_DIR_PATH/$LIB_AMD_PYTHON
|
||||
echo "post-installation done."
|
||||
EOF
|
||||
grep -v '^# ' > "$BUILD_DIR/package/main/DEBIAN/postrm" <<EOF
|
||||
|
||||
|
||||
grep -v '^# ' > "$BUILD_DIR/package/main/DEBIAN/prerm" <<EOF
|
||||
#!/bin/sh
|
||||
# Post-uninstallation script commands
|
||||
echo "Running post-uninstallation script..."
|
||||
PYTHON_LINK_BY_OPENCL=\$(ldconfig -p | awk '/libpython3/ { print \$NF; exit}' | awk -F'/' '{print \$NF}')
|
||||
rm -f ${ROCM_INSTALL_PATH}/lib/\$PYTHON_LINK_BY_OPENCL
|
||||
rm -f ${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON
|
||||
if [ -L "${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON" ] || \
|
||||
[ -L "${ROCM_INSTALL_PATH}/lib/\$PYTHON_LINK_BY_OPENCL" ] ; then
|
||||
|
||||
# Pre-uninstallation script commands
|
||||
echo "Running pre-uninstallation script..."
|
||||
rm -f $LIB_AMD_PYTHON_DIR_PATH/$LIB_AMD_PYTHON
|
||||
if [ -L "$LIB_AMD_PYTHON_DIR_PATH/$LIB_AMD_PYTHON" ] ; then
|
||||
echo " some rocm-gdb requisite libs could not be removed"
|
||||
else
|
||||
echo " all requisite libs removed successfully "
|
||||
fi
|
||||
echo "post-uninstallation done."
|
||||
echo "pre-uninstallation done."
|
||||
EOF
|
||||
chmod +x $BUILD_DIR/package/main/DEBIAN/postrm
|
||||
chmod +x $BUILD_DIR/package/main/DEBIAN/preinst
|
||||
|
||||
chmod +x $BUILD_DIR/package/main/DEBIAN/prerm
|
||||
chmod +x $BUILD_DIR/package/main/DEBIAN/postinst
|
||||
|
||||
# Create control file, with variable substitution.
|
||||
# Lines with # at the start are removed, to allow for comments
|
||||
mkdir "$BUILD_DIR/debian"
|
||||
@@ -167,8 +196,9 @@ Section: utils
|
||||
Architecture: amd64
|
||||
Essential: no
|
||||
Priority: optional
|
||||
Depends: \${shlibs:Depends}, rocm-dbgapi, rocm-core
|
||||
Depends: \${shlibs:Depends}, rocm-dbgapi, rocm-core, python3-dev
|
||||
EOF
|
||||
|
||||
# Use dpkg-shlibdeps to list shlib dependencies, the result is placed
|
||||
# in $BUILD_DIR/debian/substvars.
|
||||
(
|
||||
@@ -179,6 +209,7 @@ EOF
|
||||
fi
|
||||
dpkg-shlibdeps --ignore-missing-info -e "$BUILD_DIR/package/main/${ROCM_INSTALL_PATH}/bin/rocgdb"
|
||||
)
|
||||
|
||||
# Generate the final DEBIAN/control, and substitute the shlibs:Depends.
|
||||
# This is a bit unorthodox as we are only using bits and pieces of the
|
||||
# dpkg tools.
|
||||
@@ -191,8 +222,10 @@ EOF
|
||||
-e "s/\\$\{shlibs:Depends\}/$SHLIB_DEPS/" \
|
||||
< debian/control > "$BUILD_DIR/package/main/DEBIAN/control"
|
||||
)
|
||||
|
||||
mkdir -p "$OUT_DIR/deb/$PROJ_NAME"
|
||||
fakeroot dpkg-deb -Zgzip --build "$BUILD_DIR/package/main" "$OUT_DIR/deb/$PROJ_NAME"
|
||||
|
||||
# Package the tests so they can be run on a test slave
|
||||
mkdir -p "$BUILD_DIR/package/tests/DEBIAN"
|
||||
mkdir -p "$BUILD_DIR/package/tests/${ROCM_INSTALL_PATH}/test/gdb"
|
||||
@@ -213,21 +246,28 @@ Priority: optional
|
||||
# rocm-core as policy says everything to depend on rocm-core
|
||||
Depends: ${PROJ_NAME} (=${VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}), dejagnu, rocm-core, make
|
||||
EOF
|
||||
|
||||
copy_testsuite_files
|
||||
fakeroot dpkg-deb -Zgzip --build "$BUILD_DIR/package/tests" "$OUT_DIR/deb/$PROJ_NAME"
|
||||
}
|
||||
|
||||
package_rpm(){
|
||||
# TODO, use this to package the tests as well. In the mean time hard code the package
|
||||
set -- rocm-gdb
|
||||
local packageDir="$BUILD_DIR/package_rpm/$1"
|
||||
local specFile="$packageDir/$1.spec"
|
||||
local packageRpm="$packageDir/rpm"
|
||||
|
||||
local packageDir="$BUILD_DIR/package_rpm/$1" # e.g. out/ubuntu-16.04/16.04/build/rocm-gdb/package_rpm/main
|
||||
local specFile="$packageDir/$1.spec" # The generated spec file
|
||||
local packageRpm="$packageDir/rpm" # The RPM infrastructure
|
||||
# Extract version from build. If more than one line matches then
|
||||
# expect failures. Solution is to find which version is the wanted one.
|
||||
local VERSION
|
||||
get_version 0.0.0
|
||||
|
||||
# add upgrade related version sub-field
|
||||
VERSION=${VERSION}.${ROCM_LIBPATCH_VERSION}
|
||||
|
||||
# get the __os_install_post macro, edit it to remove the python bytecode generation
|
||||
# rpm --showrc shows the default macros with priority level (-14) in this case
|
||||
# so remove everything before this macro, everything after it, remove the offending line,
|
||||
# and make it available as the ospost variable to insert into spec file
|
||||
local ospost="$(echo '%define __os_install_post \'
|
||||
rpm --showrc | sed '1,/^-14: __os_install_post/d;
|
||||
/^-14:/,$d;/^%{nil}/!s/$/ \\/;
|
||||
@@ -238,6 +278,8 @@ package_rpm(){
|
||||
|
||||
mkdir -p "$packageDir"
|
||||
|
||||
# Create the spec file.
|
||||
# Allow comments in the generation of the specfile, may be overkill.
|
||||
grep -v '^## ' <<- EOF > $specFile
|
||||
## Set up where this stuff goes
|
||||
%define _topdir $packageRpm
|
||||
@@ -256,8 +298,7 @@ Version: ${VERSION//-/_}
|
||||
Release: ${CPACK_RPM_PACKAGE_RELEASE}%{?dist}
|
||||
License: GPL
|
||||
Prefix: ${ROCM_INSTALL_PATH}
|
||||
Requires: rocm-core
|
||||
Provides: $LIB_AMD_PYTHON()(64bit)
|
||||
Requires: rocm-core, rocm-dbgapi
|
||||
|
||||
%description
|
||||
This is ROCgdb, the ROCm source-level debugger for Linux, based on
|
||||
@@ -278,27 +319,6 @@ https://github.com/RadeonOpenCompute/ROCm
|
||||
## into the local RPM_BUILD_ROOT and left the defaults take over. Need
|
||||
## to quote the dollar signs as we want rpm to expand them when it is
|
||||
## run, rather than the shell when we build the spec file.
|
||||
%pre
|
||||
# Post-install script commands
|
||||
echo "Running post-install script..."
|
||||
mkdir -p ${ROCM_INSTALL_PATH}/lib
|
||||
PYTHON_LIB_INSTALLED=\$(ldconfig -p | awk '/libpython3/ { print \$NF; exit}')
|
||||
ln -s \$PYTHON_LIB_INSTALLED ${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON
|
||||
|
||||
%postun
|
||||
# Post-uninstallation script commands
|
||||
echo "Running post-uninstallation script..."
|
||||
PYTHON_LINK_BY_OPENCL=\$(ldconfig -p | awk '/libpython3/ { print \$NF; exit}' | awk -F'/' '{print \$NF}')
|
||||
rm -f ${ROCM_INSTALL_PATH}/lib/\$PYTHON_LINK_BY_OPENCL
|
||||
rm -f ${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON
|
||||
if [ -L "${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON" ] || \
|
||||
[ -L "${ROCM_INSTALL_PATH}/lib/\$PYTHON_LINK_BY_OPENCL" ] ; then
|
||||
echo " some rocm-gdb requisite libs could not be removed"
|
||||
else
|
||||
echo " all requisite libs removed successfully "
|
||||
fi
|
||||
echo "post-uninstallation done."
|
||||
|
||||
%install
|
||||
rm -rf \$RPM_BUILD_ROOT
|
||||
mkdir -p \$RPM_BUILD_ROOT
|
||||
@@ -307,24 +327,27 @@ cp -ar $BUILD_DIR/package/main/opt \$RPM_BUILD_ROOT/opt
|
||||
## The file section is generated by walking the tree.
|
||||
%files
|
||||
EOF
|
||||
|
||||
# Now generate the files
|
||||
find $BUILD_DIR/package/main/opt -type d | sed "s:$BUILD_DIR/package/main:%dir :" >> $specFile
|
||||
find $BUILD_DIR/package/main/opt ! -type d | sed "s:$BUILD_DIR/package/main::" >> $specFile
|
||||
|
||||
rpmbuild --define "_topdir $packageRpm" -ba $specFile
|
||||
|
||||
# Now copy it to final location
|
||||
mkdir -p "$PACKAGE_RPM" # e.g. out/ubuntu-16.04/16.04/rpm/rocm-gdb
|
||||
mv $packageRpm/RPMS/x86_64/*.rpm "$PACKAGE_RPM"
|
||||
}
|
||||
|
||||
package_rpm_tests(){
|
||||
# TODO, use this to package the tests as well. In the mean time hard code the package
|
||||
set -- rocm-gdb-tests
|
||||
local packageDir="$BUILD_DIR/package_rpm/$1"
|
||||
local specFile="$packageDir/$1.spec"
|
||||
local packageRpm="$packageDir/rpm"
|
||||
|
||||
local packageDir="$BUILD_DIR/package_rpm/$1" # e.g. out/ubuntu-16.04/16.04/build/rocm-gdb/package_rpm/main
|
||||
local specFile="$packageDir/$1.spec" # The generated spec file
|
||||
local packageRpm="$packageDir/rpm" # The RPM infrastructure
|
||||
# Extract version from build. If more than one line matches then
|
||||
# expect failures. Solution is to find which version is the wanted one.
|
||||
local VERSION
|
||||
get_version 0.0.0
|
||||
# add upgrade related version sub-field
|
||||
VERSION=${VERSION}.${ROCM_LIBPATCH_VERSION}
|
||||
local RELEASE=${CPACK_RPM_PACKAGE_RELEASE}%{?dist}
|
||||
|
||||
@@ -333,6 +356,8 @@ package_rpm_tests(){
|
||||
|
||||
mkdir -p "$packageRpm"
|
||||
|
||||
# Create the spec file.
|
||||
# Allow comments in the generation of the specfile, may be overkill.
|
||||
local ospost="$(echo '%define __os_install_post \'
|
||||
rpm --showrc | sed '1,/^-14: __os_install_post/d;
|
||||
/^-14:/,$d;/^%{nil}/!s/$/ \\/;
|
||||
@@ -385,10 +410,15 @@ EOF
|
||||
|
||||
copy_testsuite_files
|
||||
|
||||
# rpm wont resolve the dependency if the unversioned python (#!/usr/bin/python) is used.
|
||||
# /usr/bin/python - this file is not owned by any package.
|
||||
# So find and append the version to the /usr/bin/python as /usr/bin/python3
|
||||
# By updating this, the python3 requirement will be provided by the python3 package.
|
||||
find $BUILD_DIR/package/tests/opt -type f -exec sed -i '1s:^#! */usr/bin/python\>:&3:' {} +
|
||||
|
||||
rpmbuild --define "_topdir $packageRpm" -ba $specFile
|
||||
mkdir -p "$PACKAGE_RPM"
|
||||
# Now copy it to final location
|
||||
mkdir -p "$PACKAGE_RPM" # e.g. out/ubuntu-16.04/16.04/rpm/rocm-gdb
|
||||
mv $packageRpm/RPMS/x86_64/*.rpm "$PACKAGE_RPM"
|
||||
}
|
||||
|
||||
@@ -396,20 +426,29 @@ build() {
|
||||
if [ ! -e "$ROCM_GDB_ROOT/configure" ]
|
||||
then
|
||||
toStdoutStderr "No $ROCM_GDB_ROOT/configure file, skippping rocm-gdb"
|
||||
exit 0
|
||||
exit 0 # This is not an error
|
||||
fi
|
||||
local pythonver=python3
|
||||
if [[ "$DISTRO_ID" == "ubuntu-18.04" ]]; then
|
||||
pythonver=python3.8
|
||||
fi
|
||||
|
||||
# Workaround for rocm-gdb failure due to texlive on RHEL-9 & CentOS-9 SWDEV-339596
|
||||
if [[ "$DISTRO_ID" == "centos-9" ]] || [[ "$DISTRO_ID" == "rhel-9.0" ]]; then
|
||||
fmtutil-user --missing
|
||||
fi
|
||||
echo "Building $PROJ_NAME"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
cd "$BUILD_DIR" || die "Failed to cd to '$BUILD_DIR'"
|
||||
|
||||
# Build instructions taken from the README.ROCM with the addition
|
||||
# of --with-pkgversion
|
||||
#
|
||||
# The "new" way of specifying the path to the amd-dbgapi library is by
|
||||
# setting PKG_CONFIG_PATH. The --with-amd-dbgapi flag is used to ensure
|
||||
# that if amd-dbgapi is not found, configure fails.
|
||||
#
|
||||
# --with-rocm-dbgapi is kept for now, to ease the transition. It can be
|
||||
# removed once it is determined that we don't need to build source trees
|
||||
# using the "old" way.
|
||||
$ROCM_GDB_ROOT/configure --program-prefix=roc --prefix="${ROCM_INSTALL_PATH}" \
|
||||
--htmldir="\${prefix}/share/html" --pdfdir="\${prefix}/share/doc/rocgdb" \
|
||||
--infodir="\${prefix}/share/info/rocgdb" \
|
||||
@@ -441,24 +480,31 @@ build() {
|
||||
LDFLAGS="$LDFLAGS"
|
||||
LD_RUN_PATH='${ORIGIN}/../lib' make $MAKE_OPTS
|
||||
|
||||
REPLACE_LIB_NAME=$(ldd -d $BUILD_DIR/gdb/gdb |awk '/libpython/{print $1}')
|
||||
echo "Replacing $REPLACE_LIB_NAME with $LIB_AMD_PYTHON"
|
||||
patchelf --replace-needed $REPLACE_LIB_NAME $LIB_AMD_PYTHON $BUILD_DIR/gdb/gdb
|
||||
if [[ "$DISTRO_ID" == "ubuntu"* ]]; then
|
||||
#changing the python lib requirement in the built gdb for ubuntu builds
|
||||
REPLACE_LIB_NAME=$(ldd -d $BUILD_DIR/gdb/gdb |awk '/libpython/{print $1}')
|
||||
echo "Replacing $REPLACE_LIB_NAME with $LIB_AMD_PYTHON"
|
||||
patchelf --replace-needed $REPLACE_LIB_NAME $LIB_AMD_PYTHON $BUILD_DIR/gdb/gdb
|
||||
fi
|
||||
|
||||
mkdir -p $BUILD_DIR/package/main${ROCM_INSTALL_PATH}/{share/rocgdb,bin}
|
||||
|
||||
# Install gdb
|
||||
make $MAKE_OPTS -C gdb DESTDIR=$BUILD_DIR/package/main install install-pdf install-html
|
||||
|
||||
# Install binutils for coremerge and coremerge manpage.
|
||||
make $MAKE_OPTS -C binutils DESTDIR=$BUILD_DIR/package/main install
|
||||
|
||||
# Add in the AMD licences file
|
||||
linkFiles $ROCM_GDB_ROOT/gdb/NOTICES.txt $BUILD_DIR/package/main${ROCM_INSTALL_PATH}/share/doc/rocgdb
|
||||
keep_wanted_files
|
||||
|
||||
# If a variable CPACKGEN indicates only one type of packaging is required
|
||||
# then don't bother making the other. This variable is set up in compute_utils.sh
|
||||
# Default to building both package types if variable is not set
|
||||
# Use "[ var = value ] || ..." rather than "[ var != value ] &&" so expression
|
||||
# evaluates to true, and set -e does not cause script to exit.
|
||||
[ "${CPACKGEN}" = "DEB" ] || package_rpm && package_rpm_tests
|
||||
[ "${CPACKGEN}" = "RPM" ] || package_deb
|
||||
}
|
||||
|
||||
|
||||
# See if the code exists
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
@@ -475,11 +521,14 @@ verifyEnvSetup
|
||||
|
||||
main(){
|
||||
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,static,address_sanitizer,outdir:,package: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,static,wheel,address_sanitizer,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
ASAN_BUILD="no"
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -490,9 +539,11 @@ do
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
ASAN_BUILD="yes" ; shift ;;
|
||||
ASAN_BUILD="yes" ; shift ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-w | --wheel)
|
||||
echo " Wheel"; WHEEL_PACKAGE=true ; shift;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package) #FIXME
|
||||
@@ -505,6 +556,7 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
# If building with Clang, we need to build in C++17 mode, to avoid some build problems
|
||||
if [[ $CXX == *"clang++" ]]
|
||||
then
|
||||
CXX="$CXX -std=gnu++17"
|
||||
@@ -518,17 +570,28 @@ if [ $RET_CONFLICT -ge 30 ]; then
|
||||
fi
|
||||
|
||||
case $TARGET in
|
||||
("clean") clean ;;
|
||||
("build") build ;;
|
||||
("outdir") print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
("clean")
|
||||
clean
|
||||
;;
|
||||
("build")
|
||||
build
|
||||
build_wheel "$BUILD_DIR" "$PROJ_NAME"
|
||||
;;
|
||||
("outdir")
|
||||
print_output_directory
|
||||
;;
|
||||
(*)
|
||||
die "Invalid target $TARGET"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
}
|
||||
|
||||
# If this script is not being sourced, then run it.
|
||||
if [ "$0" = "$BASH_SOURCE" ]
|
||||
then
|
||||
main "$@"
|
||||
else
|
||||
set +e
|
||||
set +e # Undo the damage from compute_utils.sh
|
||||
fi
|
||||
|
||||
@@ -11,6 +11,8 @@ printUsage() {
|
||||
echo " -r, --release Build non-debug version rocm_smi (default is debug)"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -w, --wheel Creates python wheel package of rocm-smi.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of type referred to by pkg_type"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -32, Build 32b version (default is 64b)"
|
||||
@@ -22,7 +24,10 @@ printUsage() {
|
||||
|
||||
return 0
|
||||
}
|
||||
# RSMI ==> deb/rpm package target
|
||||
# ROCM_SMI ==> rocm_smi library target and header
|
||||
|
||||
# ROCM_SMI
|
||||
PROJ_NAME="rsmi"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
TARGET="build"
|
||||
@@ -30,15 +35,18 @@ TARGET="build"
|
||||
PACKAGE_LIB=$(getLibPath)
|
||||
PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
|
||||
# RSMI
|
||||
RSMI_BUILD_DIR=$(getBuildPath rsmi)
|
||||
RSMI_PACKAGE_DEB_DIR="$(getPackageRoot)/deb/$PROJ_NAME"
|
||||
RSMI_PACKAGE_RPM_DIR="$(getPackageRoot)/rpm/$PROJ_NAME"
|
||||
RSMI_BUILD_TYPE="debug"
|
||||
BUILD_TYPE="Debug"
|
||||
|
||||
# BUILD ARGUMENTS
|
||||
MAKETARGET="deb"
|
||||
MAKEARG="$DASH_JAY O=$RSMI_BUILD_DIR"
|
||||
RSMI_MAKE_OPTS="$DASH_JAY O=$RSMI_BUILD_DIR -C $RSMI_BUILD_DIR"
|
||||
# The following should be 64 (default) 32 for 32b
|
||||
ROCM_SMI_BLD_BITS=64
|
||||
RSMI_PKG_NAME_ROOT="rocm-smi-lib"
|
||||
RSMI_PKG_NAME="${RSMI_PKG_NAME_ROOT}${ROCM_SMI_BLD_BITS}"
|
||||
@@ -46,11 +54,13 @@ SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
PKGTYPE="deb"
|
||||
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,static,address_sanitizer,outdir:,package: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,static,wheel,address_sanitizer,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -65,13 +75,15 @@ do
|
||||
ADDRESS_SANITIZER=true ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
MAKETARGET="$2" ; shift 2;;
|
||||
(-32)
|
||||
ROCM_SMI_BLD_BITS="32"; shift ;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -109,6 +121,7 @@ build_rsmi() {
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
$(rocm_common_cmake_params) \
|
||||
$(rocm_cmake_params) \
|
||||
${GEN_NINJA} \
|
||||
-DENABLE_LDCONFIG=OFF \
|
||||
-DROCM_SMI_PACKAGE="${RSMI_PKG_NAME}" \
|
||||
-DCPACK_PACKAGE_VERSION_MAJOR="1" \
|
||||
@@ -116,14 +129,14 @@ build_rsmi() {
|
||||
-DCPACK_PACKAGE_VERSION_PATCH="0" \
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
-DBUILD_TESTS=ON \
|
||||
"$ROCM_SMI_LIB_ROOT"
|
||||
-S "$ROCM_SMI_LIB_ROOT"
|
||||
popd
|
||||
fi
|
||||
|
||||
echo "Making rocm_smi package:"
|
||||
cmake --build "$RSMI_BUILD_DIR" -- $RSMI_MAKE_OPTS
|
||||
cmake --build "$RSMI_BUILD_DIR" -- $RSMI_MAKE_OPTS install
|
||||
cmake --build "$RSMI_BUILD_DIR" -- $RSMI_MAKE_OPTS package
|
||||
cmake --build "$RSMI_BUILD_DIR" -- $DASH_JAY
|
||||
cmake --build "$RSMI_BUILD_DIR" -- $DASH_JAY install
|
||||
cmake --build "$RSMI_BUILD_DIR" -- $DASH_JAY package
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$RSMI_PACKAGE_DEB_DIR" $RSMI_BUILD_DIR/*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$RSMI_PACKAGE_RPM_DIR" $RSMI_BUILD_DIR/*.rpm
|
||||
@@ -145,10 +158,11 @@ verifyEnvSetup
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_rsmi ;;
|
||||
(build) build_rsmi ;;
|
||||
(build) build_rsmi; build_wheel "$RSMI_BUILD_DIR" "$PROJ_NAME" ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@ printUsage() {
|
||||
echo " -c, --clean Removes all rocminfo build artifacts"
|
||||
echo " -r, --release Build non-debug version rocminfo (default is debug)"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -w, --wheel Creates python wheel package of rocminfo.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
@@ -39,7 +41,8 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
|
||||
VALID_STR=`getopt -o hcraso:g: --long help,clean,release,static,address_sanitizer,outdir:,gpu_list: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:g: --long help,clean,release,static,wheel,address_sanitizer,outdir:,gpu_list: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
@@ -56,11 +59,13 @@ do
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-g | --gpu_list)
|
||||
GPU_LIST="$2" ; shift 2;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -124,7 +129,7 @@ print_output_directory() {
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_rocminfo ;;
|
||||
(build) build_rocminfo ;;
|
||||
(build) build_rocminfo; build_wheel "$ROCMINFO_BUILD_DIR" "$PROJ_NAME" ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src ROCmValidationSuite
|
||||
|
||||
# Internal RVS libraries need the extra RPATH
|
||||
ROCM_RVS_LIB_RPATH="\$ORIGIN/.."
|
||||
|
||||
build_rocmvalidationsuite() {
|
||||
@@ -14,6 +15,7 @@ build_rocmvalidationsuite() {
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
CXX=$(set_build_variables __CXX__)
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -22,12 +24,12 @@ build_rocmvalidationsuite() {
|
||||
cd "${COMPONENT_SRC}"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
# rocm_common_cmake_params provides the default rpath for rocm executables and libraries
|
||||
# Override cmake shared linker flags, since rvs libraries requires RUNPATH - $ORIGIN:$ORIGIN/..
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DFETCH_ROCMPATH_FROM_ROCMCORE=ON \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_LIB_RPATH:$ROCM_RVS_LIB_RPATH" \
|
||||
-DRVS_BUILD_TESTS=FALSE \
|
||||
-B "$BUILD_DIR" \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
@@ -50,7 +52,7 @@ clean_rocmvalidationsuite() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocmvalidationsuite ;;
|
||||
build) build_rocmvalidationsuite; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocmvalidationsuite ;;
|
||||
*) die "Invalid target ${TARGET}" ;;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src rocPRIM
|
||||
|
||||
@@ -10,12 +10,18 @@ build_rocprim() {
|
||||
echo "Start build"
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
# Temporary Fix as suggested in #SWDEV-314510
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
#Set ASAN flags
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# ASAN packaging is not required for rocPRIM, since its header only package
|
||||
# Setting the asan_cmake_params to false will disable ASAN packaging
|
||||
ASAN_CMAKE_PARAMS="false"
|
||||
fi
|
||||
|
||||
# Enable/Disable Static Flag to be used for
|
||||
# Package Dependecies during static/non-static builds
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
@@ -23,18 +29,14 @@ build_rocprim() {
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
#Removed GPU ARCHS from here as it will be part of compute_utils.sh ROCMOPS-7302 & ROCMOPS-8091
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
CXX="${ROCM_PATH}/bin/hipcc" \
|
||||
CXX=$(set_build_variables __HIP_CC__) \
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DBUILD_BENCHMARK=OFF \
|
||||
-DBUILD_TEST=ON \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
@@ -46,7 +48,7 @@ build_rocprim() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -60,7 +62,7 @@ clean_rocprim() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocprim ;;
|
||||
build) build_rocprim; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocprim ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -26,6 +26,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME="rocprofiler-compute"
|
||||
PROJ_NAME="$API_NAME"
|
||||
LIB_NAME="lib${API_NAME}"
|
||||
@@ -43,11 +44,13 @@ CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=$(getopt -o hcraso:p:w --long help,clean,release,static,address_sanitizer,outdir:,package:,wheel -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -66,7 +69,7 @@ do
|
||||
ack_and_skip_static ;;
|
||||
-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -108,13 +111,14 @@ build() {
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
${GEN_NINJA} \
|
||||
-DCHECK_PYTHON_DEPS=NO \
|
||||
-DPYTHON_DEPS=${BUILD_DIR}/python-libs \
|
||||
"$ROCPROFILER_COMPUTE_ROOT"
|
||||
-S "$ROCPROFILER_COMPUTE_ROOT"
|
||||
fi
|
||||
make $MAKE_OPTS
|
||||
make $MAKE_OPTS install
|
||||
make $MAKE_OPTS package
|
||||
ninja $MAKE_OPTS
|
||||
ninja $MAKE_OPTS install
|
||||
ninja $MAKE_OPTS package
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_DEB" "$BUILD_DIR/${API_NAME}"*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_RPM" "$BUILD_DIR/${API_NAME}"*.rpm
|
||||
@@ -136,7 +140,7 @@ verifyEnvSetup
|
||||
|
||||
case "$TARGET" in
|
||||
(clean) clean ;;
|
||||
(build) build ;;
|
||||
(build) build; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -12,6 +12,7 @@ printUsage() {
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -w, --wheel Creates python wheel package of rocprofiler-register. It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
@@ -24,6 +25,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME="rocprofiler-register"
|
||||
PROJ_NAME="$API_NAME"
|
||||
LIB_NAME="lib${API_NAME}"
|
||||
@@ -44,11 +46,13 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,static,address_sanitizer,outdir:,package: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,static,address_sanitizer,wheeloutdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -61,11 +65,13 @@ do
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
MAKETARGET="$2" ; shift 2;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -99,17 +105,18 @@ build() {
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
${GEN_NINJA} \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DENABLE_LDCONFIG=OFF \
|
||||
-DROCPROFILER_REGISTER_BUILD_CI=1 \
|
||||
-DROCPROFILER_REGISTER_BUILD_TESTS=1 \
|
||||
-DROCPROFILER_REGISTER_BUILD_SAMPLES=1 \
|
||||
"$ROCPROFILER_REGISTER_ROOT"
|
||||
-S "$ROCPROFILER_REGISTER_ROOT"
|
||||
popd
|
||||
fi
|
||||
make $MAKE_OPTS
|
||||
make $MAKE_OPTS install
|
||||
make $MAKE_OPTS package
|
||||
ninja $MAKE_OPTS
|
||||
ninja $MAKE_OPTS install
|
||||
ninja $MAKE_OPTS package
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_DEB" "$BUILD_DIR/${API_NAME}"*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_RPM" "$BUILD_DIR/${API_NAME}"*.rpm
|
||||
@@ -131,7 +138,7 @@ verifyEnvSetup
|
||||
|
||||
case "$TARGET" in
|
||||
(clean) clean ;;
|
||||
(build) build ;;
|
||||
(build) build; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -26,6 +26,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME="rocprofiler-sdk"
|
||||
PROJ_NAME="$API_NAME"
|
||||
LIB_NAME="lib${API_NAME}"
|
||||
@@ -35,8 +36,8 @@ PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_LIB="$(getLibPath)"
|
||||
PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
BUILD_DIR="$(getBuildPath $API_NAME)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/$API_NAME"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/$API_NAME"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/$PROJ_NAME"
|
||||
PACKAGE_RPM="$PACKAGE_ROOT/rpm/$PROJ_NAME"
|
||||
PACKAGE_PREFIX="$ROCM_INSTALL_PATH"
|
||||
BUILD_TYPE="Debug"
|
||||
MAKE_OPTS="$DASH_JAY"
|
||||
@@ -44,14 +45,16 @@ SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
GPU_LIST="gfx900;gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1100;gfx1101;gfx1102"
|
||||
# Handling GPU Targets for HSACO and HIP Executables
|
||||
GPU_LIST="gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1030;gfx1031;gfx1100;gfx1101;gfx1102"
|
||||
ASAN=0
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=$(getopt -o hcrawso:p: --long help,clean,release,static,address_sanitizer,wheel,outdir:,package: -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true; do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
printUsage
|
||||
@@ -194,7 +197,7 @@ verifyEnvSetup
|
||||
|
||||
case "$TARGET" in
|
||||
clean) clean ;;
|
||||
build) build_rocprofiler-sdk ;;
|
||||
build) build_rocprofiler-sdk; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
outdir) print_output_directory ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -26,6 +26,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME="rocprofiler-systems"
|
||||
PROJ_NAME="$API_NAME"
|
||||
LIB_NAME="lib${API_NAME}"
|
||||
@@ -33,11 +34,11 @@ TARGET="build"
|
||||
MAKETARGET="deb"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_LIB="$(getLibPath)"
|
||||
|
||||
# PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
BUILD_DIR="$(getBuildPath $API_NAME)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/$API_NAME"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/$API_NAME"
|
||||
|
||||
# PACKAGE_PREFIX="$ROCM_INSTALL_PATH"
|
||||
BUILD_TYPE="Debug"
|
||||
MAKE_OPTS="-j 8"
|
||||
SHARED_LIBS="ON"
|
||||
@@ -46,6 +47,7 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
ASAN=0
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=$(getopt -o hcraso:p:w --long help,clean,release,address_sanitizer,static,outdir:,package:,wheel -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
@@ -121,6 +123,10 @@ clean() {
|
||||
|
||||
build_rocprofiler_systems() {
|
||||
echo "Building $PROJ_NAME"
|
||||
if [ "$DISTRO_ID" = "mariner-2.0" ] || [ "$DISTRO_ID" = "azurelinux-3.0" ]; then
|
||||
echo "Skip make and uploading packages for \"$PROJ_NAME\" on \"${DISTRO_ID}\" distro"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $ASAN == 1 ]; then
|
||||
echo "Skip make and uploading packages for rocprofiler-systems on ASAN build"
|
||||
@@ -141,9 +147,9 @@ build_rocprofiler_systems() {
|
||||
|
||||
echo "Updating submodules"
|
||||
git submodule init
|
||||
|
||||
# copy the new URL to your local config
|
||||
git submodule sync --recursive
|
||||
|
||||
# force update the submodule from the new URL
|
||||
git submodule update --init --recursive --force
|
||||
|
||||
echo "Updated submodule status"
|
||||
@@ -187,6 +193,7 @@ build_rocprofiler_systems() {
|
||||
|
||||
else
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DROCPROFSYS_BUILD_{LIBUNWIND,DYNINST}=ON \
|
||||
@@ -228,7 +235,7 @@ verifyEnvSetup
|
||||
|
||||
case "$TARGET" in
|
||||
clean) clean ;;
|
||||
build) build_rocprofiler_systems ;;
|
||||
build) build_rocprofiler_systems; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
outdir) print_output_directory ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -12,6 +12,8 @@ printUsage() {
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -w, --wheel Creates python wheel package of roc-profiler.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
@@ -24,6 +26,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME="rocprofiler"
|
||||
PROJ_NAME="$API_NAME"
|
||||
LIB_NAME="lib${API_NAME}"
|
||||
@@ -33,8 +36,8 @@ PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_LIB="$(getLibPath)"
|
||||
PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
BUILD_DIR="$(getBuildPath $API_NAME)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/$API_NAME"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/$API_NAME"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/$PROJ_NAME"
|
||||
PACKAGE_RPM="$PACKAGE_ROOT/rpm/$PROJ_NAME"
|
||||
PACKAGE_PREFIX="$ROCM_INSTALL_PATH"
|
||||
BUILD_TYPE="Debug"
|
||||
MAKE_OPTS="$DASH_JAY -C $BUILD_DIR"
|
||||
@@ -42,12 +45,15 @@ SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
GPU_LIST="gfx900,gfx906,gfx908,gfx90a,gfx940,gfx941,gfx942,gfx1030,gfx1031,gfx1100,gfx1101,gfx1102,gfx1200,gfx1201"
|
||||
# Handling GPU Targets for HSACO and HIP Executables
|
||||
GPU_LIST="gfx900,gfx906,gfx908,gfx90a,gfx942,gfx1030,gfx1031,gfx1100,gfx1101,gfx1102,gfx1200,gfx1201"
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=$(getopt -o hcraswo:p: --long help,clean,release,static,wheel,address_sanitizer,outdir:,package: -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true; do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
printUsage
|
||||
@@ -69,6 +75,9 @@ while true; do
|
||||
;;
|
||||
-s | --static)
|
||||
ack_and_skip_static
|
||||
;;
|
||||
-w | --wheel)
|
||||
WHEEL_PACKAGE=true
|
||||
shift
|
||||
;;
|
||||
-o | --outdir)
|
||||
@@ -85,7 +94,7 @@ while true; do
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
;; # end delimiter
|
||||
*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] " >&2
|
||||
exit 20
|
||||
@@ -115,9 +124,6 @@ clean() {
|
||||
|
||||
build_rocprofiler() {
|
||||
echo "Building $PROJ_NAME"
|
||||
|
||||
sed -i 's/set(CPACK_GENERATOR "DEB" "RPM" "TGZ")/set(CPACK_GENERATOR "DEB" "TGZ")/' "${ROCPROFILER_ROOT}/CMakeLists.txt"
|
||||
|
||||
PACKAGE_CMAKE="$(getCmakePath)"
|
||||
if [ ! -d "$BUILD_DIR" ]; then
|
||||
mkdir -p "$BUILD_DIR"
|
||||
@@ -173,7 +179,7 @@ verifyEnvSetup
|
||||
|
||||
case "$TARGET" in
|
||||
clean) clean ;;
|
||||
build) build_rocprofiler ;;
|
||||
build) build_rocprofiler; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
outdir) print_output_directory ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -11,6 +11,8 @@ printUsage() {
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -w, --wheel Creates python wheel package of rocr-debug-agent.
|
||||
It needs to be used along with -r option"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
@@ -23,6 +25,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME=rocm-debug-agent
|
||||
PROJ_NAME=$API_NAME
|
||||
LIB_NAME=lib${API_NAME}.so
|
||||
@@ -33,12 +36,12 @@ PACKAGE_BIN="$(getBinPath)"
|
||||
PACKAGE_LIB=$(getLibPath)
|
||||
PACKAGE_INCLUDE=$(getIncludePath)
|
||||
BUILD_DIR=$(getBuildPath $API_NAME)
|
||||
PACKAGE_DEB=$(getPackageRoot)/deb/$API_NAME
|
||||
PACKAGE_RPM=$(getPackageRoot)/rpm/$API_NAME
|
||||
PACKAGE_DEB=$PACKAGE_ROOT/deb/$PROJ_NAME
|
||||
PACKAGE_RPM=$PACKAGE_ROOT/rpm/$PROJ_NAME
|
||||
PACKAGE_PREFIX=$ROCM_INSTALL_PATH
|
||||
BUILD_TYPE=Debug
|
||||
MAKE_OPTS="$DASH_JAY -C"
|
||||
|
||||
## Test variables
|
||||
TEST_PACKAGE_DIR="$(getBinPath)/rocm-debug-agent-test"
|
||||
PACKAGE_UTILS=$(getUtilsPath)
|
||||
|
||||
@@ -54,11 +57,13 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,static,address_sanitizer,outdir:,package: -- "$@"`
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,static,wheel,address_sanitizer,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
@@ -71,11 +76,13 @@ do
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
MAKETARGET="$2" ; shift 2;;
|
||||
--) shift; break;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -102,14 +109,17 @@ clean() {
|
||||
|
||||
build() {
|
||||
echo "Building $PROJ_NAME"
|
||||
|
||||
# The cmake path is different for asan and non-asan builds.
|
||||
# Fetch after getting build type. Default will be non-asan build
|
||||
PACKAGE_CMAKE="$(getCmakePath)"
|
||||
# If rocm is installed to an unconventional location, --rocm-path needs to be set.
|
||||
export HIPCC_COMPILE_FLAGS_APPEND="--rocm-path=$ROCM_PATH"
|
||||
if [ ! -d "$BUILD_DIR" ]; then
|
||||
mkdir -p "$BUILD_DIR"
|
||||
pushd "$BUILD_DIR"
|
||||
|
||||
cmake $(rocm_cmake_params) \
|
||||
${GEN_NINJA} \
|
||||
-DCMAKE_PREFIX_PATH="$PACKAGE_CMAKE/amd-dbgapi" \
|
||||
-DCMAKE_MODULE_PATH="$PACKAGE_CMAKE/hip" \
|
||||
$(rocm_common_cmake_params) \
|
||||
@@ -118,15 +128,22 @@ build() {
|
||||
|
||||
popd
|
||||
fi
|
||||
cmake --build "$BUILD_DIR" -- $MAKE_OPTS $BUILD_DIR
|
||||
cmake --build "$BUILD_DIR" -- $MAKE_OPTS $BUILD_DIR install
|
||||
cmake --build "$BUILD_DIR" -- $MAKE_OPTS $BUILD_DIR package
|
||||
cmake --build "$BUILD_DIR" -- $DASH_JAY
|
||||
cmake --build "$BUILD_DIR" --target install -- $DASH_JAY
|
||||
cmake --build "$BUILD_DIR" --target package -- $DASH_JAY
|
||||
|
||||
mkdir -p $PACKAGE_LIB
|
||||
cp -R $BUILD_DIR/${LIB_NAME}* $PACKAGE_LIB
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DEB}" "$BUILD_DIR/${API_NAME}"*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_RPM}" "$BUILD_DIR/${API_NAME}"*.rpm
|
||||
|
||||
mkdir -p "$PACKAGE_UTILS"
|
||||
progressCopy "$SCRIPT_ROOT/run_rocr_debug_agent_test.sh" "$PACKAGE_UTILS"
|
||||
|
||||
## Copy run test py script
|
||||
echo "copying run-test.py to $PACKAGE_BIN"
|
||||
progressCopy "$ROCR_DEBUG_AGENT_ROOT/test/run-test.py" "$PACKAGE_BIN"
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
@@ -145,7 +162,7 @@ verifyEnvSetup
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean ;;
|
||||
(build) build ;;
|
||||
(build) build; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $target" ;;
|
||||
esac
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src rocRAND
|
||||
|
||||
@@ -13,31 +13,37 @@ build_rocrand() {
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
#Removed GPU ARCHS from here as it will be part of compute_utils.sh ROCMOPS-7302 & ROCMOPS-8091
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# updating GPU_ARCHS for ASAN build to supported gpu arch only SWDEV-479178
|
||||
#GPU_ARCHS="gfx90a:xnack+;gfx942:xnack+"#This will be part of compute_utils.sh ROCMOPS-7302 & ROCMOPS-8091
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC && mkdir "$BUILD_DIR"
|
||||
|
||||
git config --global --add safe.directory "$COMPONENT_SRC"
|
||||
# Rename the remote set by the repo tool to origin as
|
||||
# git submodule update looks for the remote origin.
|
||||
remote_name=$(git remote show | head -n 1)
|
||||
echo "remote name: $remote_name"
|
||||
[ "$remote_name" == "origin" ] || git remote rename "$remote_name" origin
|
||||
git remote -v
|
||||
git submodule update --init --force
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
# if GPU_ENABLE_GPU_ARCHARCH is set in env by Job parameter ENABLE_GPU_ARCH, then set GFX_ARCH to that value. This will override any of the case values above
|
||||
if [ -n "$ENABLE_GPU_ARCH" ]; then
|
||||
#setting gfx arch as part of rocm_common_cmake_params
|
||||
set_gpu_arch "${ENABLE_GPU_ARCH}"
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
CXX=$(set_build_variables CXX)\
|
||||
CXX=$(set_build_variables __CXX__)\
|
||||
cmake \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DBUILD_TEST=ON \
|
||||
-DBUILD_BENCHMARK=ON \
|
||||
-DBUILD_CRUSH_TEST=ON \
|
||||
@@ -53,7 +59,7 @@ build_rocrand() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -67,7 +73,7 @@ clean_rocrand() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocrand ;;
|
||||
build) build_rocrand; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocrand ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -42,7 +42,7 @@ PKGTYPE="deb"
|
||||
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcrao:seg: --long help,clean,release,outdir:,static,address_sanitizer,emulator,gpu_list: -- "$@"`
|
||||
VALID_STR=`getopt -o hcrawo:seg: --long help,clean,release,outdir:,static,wheel,address_sanitizer,emulator,gpu_list: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
@@ -61,6 +61,8 @@ do
|
||||
exit ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-w | --wheel)
|
||||
echo "wheel build option accepted and ignored" ; shift ;;
|
||||
(-e | --emulator )
|
||||
EMULATOR_BUILD=1 ; ((CLEAN_OR_OUT|=3)) ; shift ;;
|
||||
(-g | --gpu_list )
|
||||
@@ -92,6 +94,7 @@ build_rocrsamples() {
|
||||
cmake -DTARGET_DEVICES=$GPU_LIST \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
${GEN_NINJA} \
|
||||
-DROCRTST_BLD_TYPE=$ROCRTST_SAMPLES_BUILD_TYPE \
|
||||
-DROCM_DIR=$PACKAGE_ROOT \
|
||||
-DLLVM_DIR="$ROCM_INSTALL_PATH/llvm/bin" \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src rocSOLVER
|
||||
|
||||
@@ -15,39 +15,38 @@ build_rocsolver() {
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
EXTRA_TESTS="ON"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
rebuild_lapack
|
||||
EXTRA_TESTS="OFF"
|
||||
# updating GPU_ARCHS for ASAN build to supported gpu arch only SWDEV-479178
|
||||
#GPU_ARCHS="gfx90a:xnack+;gfx942:xnack+"#This will be part of compute_utils.sh ROCMOPS-7302 & ROCMOPS-8091
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
rebuild_lapack
|
||||
fi
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
# if ENABLE_GPU_ARCH is set in env by Job parameter ENABLE_GPU_ARCH, then set GFX_ARCH to that value. This will override any of the case values above
|
||||
if [ -n "$ENABLE_GPU_ARCH" ]; then
|
||||
#setting gfx arch as part of rocm_common_cmake_params
|
||||
set_gpu_arch "${ENABLE_GPU_ARCH}"
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
CXX="${ROCM_PATH}/bin/hipcc" \
|
||||
CXX=$(set_build_variables __HIP_CC__) \
|
||||
cmake \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-Drocblas_DIR="${ROCM_PATH}/rocblas/lib/cmake/rocblas" \
|
||||
-DAMDGPU_TARGETS="${GPU_TARGETS}" \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DBUILD_TESTING=ON \
|
||||
-DBUILD_CLIENTS_EXTRA_TESTS=ON \
|
||||
-DBUILD_CLIENTS_EXTRA_TESTS="${EXTRA_TESTS}" \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
@@ -69,7 +68,7 @@ clean_rocsolver() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocsolver ;;
|
||||
build) build_rocsolver; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocsolver ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
PATH=${ROCM_PATH}/bin:$PATH
|
||||
set_component_src rocSPARSE
|
||||
|
||||
build_rocsparse() {
|
||||
echo "Start build"
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# updating GPU_ARCHS for ASAN build to supported gpu arch only SWDEV-479178
|
||||
#GPU_ARCHS="gfx90a:xnack+;gfx942:xnack+"#This will be part of compute_utils.sh ROCMOPS-7302 & ROCMOPS-8091
|
||||
fi
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
@@ -25,19 +24,17 @@ build_rocsparse() {
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
# if ENABLE_GPU_ARCH is set in env by Job parameter ENABLE_GPU_ARCH, then set GFX_ARCH to that value. This will override any of the case values above
|
||||
if [ -n "$ENABLE_GPU_ARCH" ]; then
|
||||
#setting gfx arch as part of rocm_common_cmake_params
|
||||
set_gpu_arch "${ENABLE_GPU_ARCH}"
|
||||
fi
|
||||
|
||||
ROCSPARSE_TEST_MIRROR=$MIRROR \
|
||||
export CXX=$(set_build_variables CXX)\
|
||||
export CC=$(set_build_variables CC)\
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
ROCSPARSE_TEST_MIRROR=$MIRROR \
|
||||
CXX=$(set_build_variables __CXX__)\
|
||||
CC=$(set_build_variables __CC__)\
|
||||
cmake \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
@@ -54,7 +51,7 @@ build_rocsparse() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -68,7 +65,7 @@ clean_rocsparse() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocsparse ;;
|
||||
build) build_rocsparse; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocsparse ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
build_release=true
|
||||
set_component_src rocThrust
|
||||
@@ -19,15 +19,17 @@ build_rocthrust() {
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# ASAN packaging is not required for rocThrust, since its header only package
|
||||
# Setting the asan_cmake_params to false will disable ASAN packaging
|
||||
ASAN_CMAKE_PARAMS="false"
|
||||
fi
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
CXX=$(set_build_variables CXX)\
|
||||
CXX=$(set_build_variables __CXX__)\
|
||||
cmake \
|
||||
${GEN_NINJA} \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DCMAKE_MODULE_PATH="${ROCM_PATH}/lib/cmake/hip;${ROCM_PATH}/hip/cmake" \
|
||||
@@ -40,8 +42,7 @@ build_rocthrust() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
@@ -56,7 +57,7 @@ stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_rocthrust ;;
|
||||
(build) build_rocthrust ;;
|
||||
(build) build_rocthrust; build_wheel ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -12,19 +12,22 @@ printUsage() {
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -w, --wheel Creates python wheel package of roc-tracer.
|
||||
It needs to be used along with -r option"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
## Build environment variables
|
||||
API_NAME="roctracer"
|
||||
PROJ_NAME="$API_NAME"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
BUILD_DIR="$(getBuildPath $API_NAME)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/$API_NAME"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/$API_NAME"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/$PROJ_NAME"
|
||||
PACKAGE_RPM="$PACKAGE_ROOT/rpm/$PROJ_NAME"
|
||||
PACKAGE_PREFIX="$ROCM_INSTALL_PATH"
|
||||
|
||||
export HIP_PATH="${ROCM_INSTALL_PATH}"
|
||||
@@ -39,12 +42,15 @@ CLEAN_OR_OUT=0
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
GPU_LIST="gfx900;gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
# Handling GPU Targets for HSACO and HIP Executables
|
||||
GPU_LIST="gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1030;gfx1031;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
|
||||
VALID_STR=$(getopt -o hcraso: --long help,clean,release,static,address_sanitizer,outdir: -- "$@")
|
||||
#parse the arguments
|
||||
VALID_STR=$(getopt -o hcraswo: --long help,clean,release,static,wheel,address_sanitizer,outdir: -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true; do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
printUsage
|
||||
@@ -66,6 +72,9 @@ while true; do
|
||||
;;
|
||||
-s | --static)
|
||||
ack_and_skip_static
|
||||
;;
|
||||
-w | --wheel)
|
||||
WHEEL_PACKAGE=true
|
||||
shift
|
||||
;;
|
||||
-o | --outdir)
|
||||
@@ -78,7 +87,7 @@ while true; do
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
;; # end delimiter
|
||||
*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] " >&2
|
||||
exit 20
|
||||
@@ -103,15 +112,12 @@ clean() {
|
||||
rm -rf "$PACKAGE_ROOT/${PROJ_NAME}"
|
||||
}
|
||||
|
||||
copy_libs_to_workspace() {
|
||||
if [ "$ASAN_CMAKE_PARAMS" != "true" ]; then
|
||||
cp -R "${ROCM_INSTALL_PATH}/lib/roctracer/" "${OUT_DIR}/lib/roctracer/"
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
echo "Building $PROJ_NAME"
|
||||
# The cmake path is different for asan and non-asan builds.
|
||||
# Fetch after getting build type. Default will be non-asan build
|
||||
PACKAGE_CMAKE="$(getCmakePath)"
|
||||
# Find HIP in the build tree
|
||||
export ROCM_PATH="${ROCM_INSTALL_PATH}"
|
||||
export HIPCC_COMPILE_FLAGS_APPEND="--rocm-path=$ROCM_PATH"
|
||||
|
||||
@@ -121,11 +127,11 @@ build() {
|
||||
print_lib_type $SHARED_LIBS
|
||||
|
||||
export HIPCC_COMPILE_FLAGS_APPEND="--rocm-path=$ROCM_PATH --offload-arch=gfx900 --offload-arch=gfx906 --offload-arch=gfx908 \
|
||||
--offload-arch=gfx90a --offload-arch=gfx940 --offload-arch=gfx941 \
|
||||
--offload-arch=gfx942 --offload-arch=gfx1030 --offload-arch=gfx1031 \
|
||||
--offload-arch=gfx90a --offload-arch=gfx942 --offload-arch=gfx1030 --offload-arch=gfx1031 \
|
||||
--offload-arch=gfx1100 --offload-arch=gfx1101 --offload-arch=gfx1102 \
|
||||
--offload-arch=gfx1200 --offload-arch=gfx1201"
|
||||
cmake $(rocm_cmake_params) \
|
||||
${GEN_NINJA} \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="$PACKAGE_PREFIX/$PROJ_NAME" \
|
||||
-DCMAKE_MODULE_PATH="$PACKAGE_CMAKE/hip" \
|
||||
-DCMAKE_HIP_ARCHITECTURES=OFF \
|
||||
@@ -174,7 +180,7 @@ verifyEnvSetup
|
||||
|
||||
case $TARGET in
|
||||
clean) clean ;;
|
||||
build) build && copy_libs_to_workspace ;;
|
||||
build) build ; build_wheel "$BUILD_DIR" "$PROJ_NAME" ;;
|
||||
outdir) print_output_directory ;;
|
||||
*) die "$BASH_SOURCE Invalid target $TARGET - exiting" ;;
|
||||
esac
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src rocWMMA
|
||||
|
||||
@@ -12,6 +12,7 @@ build_rocwmma() {
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
# To check if rocwmma source is present
|
||||
if [ ! -e $COMPONENT_SRC/CMakeLists.txt ]; then
|
||||
echo "Skipping rocWMMA as source is not available"
|
||||
mkdir -p $COMPONENT_SRC
|
||||
@@ -21,12 +22,14 @@ build_rocwmma() {
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# ASAN packaging is not required for rocWMMA, since its header only package
|
||||
# Setting the asan_cmake_params to false will disable ASAN packaging
|
||||
ASAN_CMAKE_PARAMS="false"
|
||||
fi
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
CXX=$(set_build_variables CXX)\
|
||||
CXX=$(set_build_variables __CXX__)\
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
@@ -41,7 +44,7 @@ build_rocwmma() {
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
@@ -54,7 +57,7 @@ clean_rocwmma() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rocwmma ;;
|
||||
build) build_rocwmma; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocwmma ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src rpp
|
||||
DEPS_DIR="$RPP_DEPS_LOCATION"
|
||||
|
||||
LLVM_LIBDIR="${ROCM_PATH}/llvm/lib"
|
||||
ROCM_LLVM_LIB_RPATH="\$ORIGIN/llvm/lib"
|
||||
|
||||
# RPP specific exe linker parameters
|
||||
rpp_specific_cmake_params() {
|
||||
local rpp_cmake_params
|
||||
if [ "${ASAN_CMAKE_PARAMS}" == "true" ] ; then
|
||||
@@ -27,21 +27,26 @@ build_rpp() {
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
# To check if RPP source is present
|
||||
if [ ! -e $COMPONENT_SRC/CMakeLists.txt ]; then
|
||||
echo "Skipping RPP build as source is not available"
|
||||
mkdir -p $COMPONENT_SRC
|
||||
exit 0
|
||||
fi
|
||||
|
||||
CXX=$(set_build_variables __AMD_CLANG_++__)
|
||||
# Enable ASAN
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
fi
|
||||
|
||||
echo "C compiler: $CC"
|
||||
echo "CXX compiler: $CXX"
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
# rocm_common_cmake_params provides the default rpath for rocm executables and libraries
|
||||
# Override cmake shared linker flags to add RPATH for boost libraries
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
@@ -57,8 +62,7 @@ build_rpp() {
|
||||
cpack -G ${PKGTYPE^^}
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR
|
||||
cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
@@ -71,7 +75,7 @@ clean_rpp() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_rpp ;;
|
||||
build) build_rpp; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rpp ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_utils.sh"
|
||||
|
||||
set_component_src TransferBench
|
||||
# ROCMOPS-8587 : this variable will be removing nic enablement from the compilation of
|
||||
# the tool that will create complications for the general rocm release
|
||||
export DISABLE_NIC_EXEC=1
|
||||
|
||||
build_transferbench() {
|
||||
echo "Start build"
|
||||
@@ -13,18 +16,15 @@ build_transferbench() {
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
sed -i 's/^\(\s*set\s*(CMAKE_RUNTIME_OUTPUT_DIRECTORY.*\)$/#\1/' "${COMPONENT_SRC}/CMakeLists.txt"
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
CXX="$ROCM_PATH"/bin/hipcc \
|
||||
CXX=$(set_build_variables __HIP_CC__) \
|
||||
cmake "${rocm_math_common_cmake_params[@]}" "$COMPONENT_SRC"
|
||||
make package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR
|
||||
cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
copy_if "${PKGTYPE}" "${CPACKGEN:-"DEB;RPM"}" "${PACKAGE_DIR}" "${BUILD_DIR}"/*."${PKGTYPE}"
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ clean_transferbench() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_transferbench ;;
|
||||
build) build_transferbench; build_wheel ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_transferbench ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -1,323 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# compute_helper.sh is created to add common functions similar to compute_utils.sh in stg1
|
||||
# stg2 build scripts can make use of common function
|
||||
# TODO: Component build scripts can be optimized by adding common function in this file(ex for ASAN, Debugging etc)
|
||||
# All build scripts should use the common function.
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
# Set the LLVM directory path with respect to ROCM_PATH
|
||||
# LLVM is installed in $ROCM_PATH/lib/llvm
|
||||
ROCM_LLVMDIR="lib/llvm"
|
||||
# Set ADDRESS_SANITIZER to OFF by default
|
||||
export ADDRESS_SANITIZER="OFF"
|
||||
|
||||
DISABLE_DEBUG_PACKAGE="false"
|
||||
export CFLAGS="$CFLAGS $SET_DWARF_VERSION_4 "
|
||||
export CXXFLAGS="$CXXFLAGS $SET_DWARF_VERSION_4 "
|
||||
|
||||
# Print message to stderr
|
||||
# param message string to print on exit
|
||||
# Example: printErr "file not found"
|
||||
printErr() {
|
||||
echo "$@" 1>&2
|
||||
}
|
||||
|
||||
# Print message to stderr and terminate current program
|
||||
# param message string to print on exit
|
||||
# Example: die "Your program" has terminated
|
||||
die() {
|
||||
printErr "FATAL: $@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Die if first argument is empty
|
||||
# param string to validate
|
||||
# param error message
|
||||
# Example: die "$VARIABLE" "Your program" has terminated
|
||||
dieIfEmpty() {
|
||||
if [ "$1" == "" ]; then
|
||||
shift
|
||||
die "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
ack_and_skip_static() {
|
||||
echo "static build is not enabled for this component..skipping"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Copy a file or directory to target location and show single line progress
|
||||
progressCopy() {
|
||||
if [ -d "$1" ]; then
|
||||
rsync -a "$1"/* "$2"
|
||||
else
|
||||
rsync -a "$1" "$2"
|
||||
fi
|
||||
}
|
||||
|
||||
# Get OS identification string
|
||||
# xargs will remove the trailing whitespaces
|
||||
getOsVersion() {
|
||||
lsb_release -d | cut -d: -f2 | xargs
|
||||
}
|
||||
|
||||
# Get kernel identification string
|
||||
getKernelVersion() {
|
||||
uname -r
|
||||
}
|
||||
|
||||
# Trim excessive whitespace from a string
|
||||
strTrim() {
|
||||
echo "$@" | xargs
|
||||
}
|
||||
|
||||
# Return whether the booted OS is Fedora or not
|
||||
isFedora() {
|
||||
grep -iq fedora /etc/os-release
|
||||
}
|
||||
|
||||
# Return whether the booted system is EFI or not
|
||||
isEFI() {
|
||||
[ -d "/sys/firmware/efi" ]
|
||||
}
|
||||
|
||||
print_lib_type() {
|
||||
if [ "$1" == "OFF" ];
|
||||
then
|
||||
echo " Building Archive "
|
||||
else
|
||||
echo " Building Shared Object "
|
||||
fi
|
||||
}
|
||||
|
||||
# Get CMAKE build flags for CMAKE build trigger
|
||||
set_build_variables() {
|
||||
local cmake_cxx_flag_params
|
||||
local cmake_cc_flag_params
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ] ; then
|
||||
cmake_cxx_flag_params="$ROCM_PATH/llvm/bin/clang++"
|
||||
cmake_cc_flag_params="$ROCM_PATH/llvm/bin/clang"
|
||||
cmake_comp_params=(
|
||||
"-DCMAKE_C_COMPILER=$ROCM_PATH/llvm/bin/clang"
|
||||
"-DCMAKE_CXX_COMPILER=$ROCM_PATH/llvm/bin/clang++"
|
||||
)
|
||||
else
|
||||
cmake_cxx_flag_params="$ROCM_PATH/bin/hipcc"
|
||||
cmake_cc_flag_params="$ROCM_PATH/bin/hipcc"
|
||||
cmake_comp_params=(
|
||||
"-DCMAKE_C_COMPILER=$ROCM_PATH/bin/hipcc"
|
||||
"-DCMAKE_CXX_COMPILER=$ROCM_PATH/bin/hipcc"
|
||||
)
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
("CXX")
|
||||
printf "%s" "${cmake_cxx_flag_params}"
|
||||
;;
|
||||
("CC")
|
||||
printf "%s" "${cmake_cc_flag_params}"
|
||||
;;
|
||||
("CMAKE_C_CXX")
|
||||
printf '%s ' "${cmake_comp_params[@]}"
|
||||
;;
|
||||
(*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
# Get the directory containing the cmake config files
|
||||
getCmakePath() {
|
||||
local rocmInstallPath=${ROCM_PATH}
|
||||
local cmakePath="lib/cmake"
|
||||
dieIfEmpty "$rocmInstallPath"
|
||||
echo "$rocmInstallPath/$cmakePath"
|
||||
}
|
||||
|
||||
getInstallLibDir() {
|
||||
local libDir="lib"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ] ; then
|
||||
libDir="lib/asan"
|
||||
fi
|
||||
echo "$libDir"
|
||||
}
|
||||
|
||||
set_asan_env_vars() {
|
||||
# Flag to set cmake build params for ASAN builds
|
||||
ASAN_CMAKE_PARAMS="true"
|
||||
export ADDRESS_SANITIZER="ON"
|
||||
LLVM_BIN_DIR="${ROCM_PATH}/llvm/bin"
|
||||
export CC="$LLVM_BIN_DIR/clang"
|
||||
export CXX="$LLVM_BIN_DIR/clang++"
|
||||
export FC="$LLVM_BIN_DIR/flang"
|
||||
export PATH="$LLVM_BIN_DIR/:$PATH"
|
||||
# get exact path to ASAN lib containing clang version
|
||||
ASAN_LIB_PATH=$(clang --print-file-name=libclang_rt.asan-x86_64.so)
|
||||
export LD_LIBRARY_PATH="${ASAN_LIB_PATH%/*}:${ROCM_PATH}/llvm/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||
export ASAN_OPTIONS="detect_leaks=0"
|
||||
}
|
||||
|
||||
set_address_sanitizer_on() {
|
||||
export CFLAGS="-fsanitize=address -shared-libasan $SET_DWARF_VERSION_4 -g -gz"
|
||||
export CXXFLAGS="-fsanitize=address -shared-libasan $SET_DWARF_VERSION_4 -g -gz"
|
||||
export LDFLAGS="-Wl,--enable-new-dtags -fuse-ld=lld -fsanitize=address -shared-libasan -g -gz -Wl,--build-id=sha1 -L${ROCM_PATH}/llvm/lib -L${ROCM_PATH}/lib/asan"
|
||||
}
|
||||
|
||||
rebuild_lapack() {
|
||||
wget -nv -O lapack-3.9.1.tar.gz \
|
||||
http://compute-artifactory.amd.com/artifactory/rocm-generic-thirdparty-deps/ubuntu/lapack-v3.9.1.tar.gz
|
||||
sh -c "echo 'd0085d2caf997ff39299c05d4bacb6f3d27001d25a4cc613d48c1f352b73e7e0 *lapack-3.9.1.tar.gz' | sha256sum -c"
|
||||
tar xzf lapack-3.9.1.tar.gz --one-top-level=lapack-src --strip-components 1
|
||||
rm lapack-3.9.1.tar.gz
|
||||
|
||||
cmake -Slapack-src -Blapack-bld \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCBLAS=ON \
|
||||
-DLAPACKE=OFF
|
||||
cmake --build lapack-bld -- -j${PROC}
|
||||
cmake --build lapack-bld -- install
|
||||
rm -r lapack-src lapack-bld
|
||||
}
|
||||
|
||||
# debug function #dumping values in case of error to solve the same
|
||||
print_vars() {
|
||||
echo " Status of Vars in $1 build "
|
||||
echo " TARGET= $2 "
|
||||
echo " BUILD_TYPE = $3 "
|
||||
echo " SHARED_LIBS = $4 "
|
||||
echo " CLEAN_OR_OUT = $5 "
|
||||
echo " PKGTYPE= $6 "
|
||||
echo " MAKETARGET = $7 "
|
||||
}
|
||||
|
||||
rocm_math_common_cmake_params=()
|
||||
init_rocm_common_cmake_params(){
|
||||
local retCmakeParams=${1:-rocm_math_common_cmake_params}
|
||||
local SET_BUILD_TYPE=${BUILD_TYPE:-'RelWithDebInfo'}
|
||||
local ASAN_LIBDIR="lib/asan"
|
||||
local CMAKE_PATH=$(getCmakePath)
|
||||
# Common cmake parameters can be set
|
||||
# component build scripts can use this function
|
||||
local cmake_params
|
||||
if [ "${ASAN_CMAKE_PARAMS}" == "true" ] ; then
|
||||
cmake_params=(
|
||||
"-DCMAKE_PREFIX_PATH=$CMAKE_PATH;${ROCM_PATH}/$ASAN_LIBDIR;$ROCM_PATH/llvm;$ROCM_PATH"
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_ASAN_LIB_RPATH"
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_ASAN_EXE_RPATH"
|
||||
"-DENABLE_ASAN_PACKAGING=true"
|
||||
)
|
||||
else
|
||||
cmake_params=(
|
||||
"-DCMAKE_PREFIX_PATH=${ROCM_PATH}/llvm;${ROCM_PATH}"
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_LIB_RPATH"
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_EXE_RPATH"
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_params+=(
|
||||
"-DCMAKE_VERBOSE_MAKEFILE=1"
|
||||
"-DCMAKE_BUILD_TYPE=${SET_BUILD_TYPE}"
|
||||
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE"
|
||||
"-DCMAKE_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DCMAKE_PACKAGING_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF"
|
||||
"-DROCM_SYMLINK_LIBS=OFF"
|
||||
"-DCPACK_PACKAGING_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DROCM_DISABLE_LDCONFIG=ON"
|
||||
"-DCPACK_SET_DESTDIR=OFF"
|
||||
"-DCPACK_RPM_PACKAGE_RELOCATABLE=ON"
|
||||
"-DROCM_PATH=${ROCM_PATH}"
|
||||
)
|
||||
|
||||
#TODO :remove if clause once debug related issues are fixed
|
||||
if [ "${DISABLE_DEBUG_PACKAGE}" == "true" ] ; then
|
||||
SET_BUILD_TYPE=${BUILD_TYPE:-'Release'}
|
||||
cmake_params+=(
|
||||
"-DCPACK_DEBIAN_DEBUGINFO_PACKAGE=FALSE"
|
||||
"-DCPACK_RPM_DEBUGINFO_PACKAGE=FALSE"
|
||||
"-DCPACK_RPM_INSTALL_WITH_EXEC=FALSE"
|
||||
"-DCMAKE_BUILD_TYPE=${SET_BUILD_TYPE}"
|
||||
)
|
||||
elif [ "$SET_BUILD_TYPE" == "RelWithDebInfo" ] || [ "$SET_BUILD_TYPE" == "Debug" ]; then
|
||||
# RelWithDebinfo optimization level -O2 is having performance impact
|
||||
# So overriding the same to -O3
|
||||
cmake_params+=(
|
||||
"-DCPACK_DEBIAN_DEBUGINFO_PACKAGE=TRUE"
|
||||
"-DCPACK_RPM_DEBUGINFO_PACKAGE=TRUE"
|
||||
"-DCPACK_RPM_INSTALL_WITH_EXEC=TRUE"
|
||||
"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O3 -g -DNDEBUG"
|
||||
)
|
||||
fi
|
||||
eval "${retCmakeParams}=( \"\${cmake_params[@]}\" ) "
|
||||
}
|
||||
|
||||
disable_debug_package_generation(){
|
||||
case "$DISTRO_ID" in
|
||||
(sles*|rhel*)
|
||||
export CFLAGS=${CFLAGS//"$SET_DWARF_VERSION_4"}
|
||||
export CXXFLAGS=${CXXFLAGS//"$SET_DWARF_VERSION_4"}
|
||||
;;
|
||||
(*)
|
||||
;;
|
||||
esac
|
||||
DISABLE_DEBUG_PACKAGE="true"
|
||||
}
|
||||
|
||||
# Setup a number of variables to specify where to find the source
|
||||
# where to do the build and where to put the packages
|
||||
# Note the PACKAGE_DIR downcases the package name
|
||||
# This could be extended to do different things based on $1
|
||||
set_component_src(){
|
||||
COMPONENT_SRC="$LIBS_WORK_DIR/$1"
|
||||
|
||||
BUILD_DIR="$OUT_DIR/build/$1"
|
||||
DEB_PATH="$OUT_DIR/${PKGTYPE}/${1,,}"
|
||||
RPM_PATH="$OUT_DIR/${PKGTYPE}/${1,,}"
|
||||
PACKAGE_DIR="$OUT_DIR/${PKGTYPE}/${1,,}"
|
||||
}
|
||||
|
||||
# Standard definition of function to print the package location. If
|
||||
# for some reason a custom version is needed then it can overwrite
|
||||
# this definition
|
||||
# TODO: Don't use a global PKGTYPE, pass the value in as a parameter
|
||||
print_output_directory() {
|
||||
case ${1:-$PKGTYPE} in
|
||||
("deb")
|
||||
echo ${DEB_PATH};;
|
||||
("rpm")
|
||||
echo ${RPM_PATH};;
|
||||
(*)
|
||||
echo "Invalid package type \"${PKGTYPE}\" provided for -o" >&2; exit 1;;
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
# Standard argument processing
|
||||
# Here to avoid repetition
|
||||
TARGET="build" # default target
|
||||
stage2_command_args(){
|
||||
while [ "$1" != "" ];
|
||||
do
|
||||
case $1 in
|
||||
-o | --outdir )
|
||||
shift 1; PKGTYPE=$1 ; TARGET="outdir" ;;
|
||||
-c | --clean )
|
||||
TARGET="clean" ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
shift 1
|
||||
done
|
||||
}
|
||||
|
||||
show_build_cache_stats(){
|
||||
if [ "$CCACHE_ENABLED" = "true" ] ; then
|
||||
if ! ccache -s ; then
|
||||
echo "Unable to display ccache stats"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
: <<'END_COMMENT'
|
||||
This script retains only those functions from the original compute_utils.sh
|
||||
that the ROCm build scripts utilize.
|
||||
END_COMMENT
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
TOPOLOGY_SYSFS_DIR=/sys/devices/virtual/kfd/kfd/topology/nodes
|
||||
|
||||
# Set python version
|
||||
# TODO: Get the python version from build arguments
|
||||
PY_COMMAND=python3.6
|
||||
# Set a sensible default value for DASH_JAY in case none is provided
|
||||
DASH_JAY=${DASH_JAY:-"-j $(nproc)"}
|
||||
|
||||
@@ -22,6 +21,24 @@ if [[ "$ROCM_USE_CCACHE" != "0" ]] ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# TODO: To be removed, once debug package issues are fixed
|
||||
DISABLE_DEBUG_PACKAGE="false"
|
||||
set_gdwarf_4() {
|
||||
# In SLES and RHEL, debuginfo package is not getting generated
|
||||
# Splitting debuginfo is getting failed(dwarf-5 unhandled) when compiler is set to clang.
|
||||
# By default -gdwarf-5 is used for the compression of debug symbols
|
||||
# So setting -gdwarf-4 as a quick fix
|
||||
# TODO: -gdwarf-5 unhandling when compiler set to clang need to be fixed
|
||||
case "$DISTRO_ID" in
|
||||
(sles*|rhel*)
|
||||
SET_DWARF_VERSION_4="-gdwarf-4"
|
||||
;;
|
||||
(*)
|
||||
SET_DWARF_VERSION_4=""
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print message to stderr
|
||||
# param message string to print on exit
|
||||
# Example: printErr "file not found"
|
||||
@@ -164,7 +181,6 @@ getRpmPath() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
verifyEnvSetup() {
|
||||
if [ -z "$OUT_DIR" ]; then
|
||||
die "Please source build/envsetup.sh first."
|
||||
@@ -211,32 +227,49 @@ check_conflicting_options() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Set the LLVM directory path with respect to ROCM_PATH
|
||||
# LLVM is installed in $ROCM_PATH/lib/llvm
|
||||
ROCM_LLVMDIR="lib/llvm"
|
||||
|
||||
export ADDRESS_SANITIZER="OFF"
|
||||
set_asan_env_vars() {
|
||||
export ADDRESS_SANITIZER="ON"
|
||||
# Flag to set cmake build params for ASAN builds
|
||||
ASAN_CMAKE_PARAMS="true"
|
||||
# Pass the LLVM bin path as the first parameter
|
||||
LLVM_BIN_DIR=${1:-"${ROCM_INSTALL_PATH}/llvm/bin"}
|
||||
local LLVM_BIN_DIR=${1:-"${ROCM_INSTALL_PATH}/llvm/bin"}
|
||||
export CC="$LLVM_BIN_DIR/clang"
|
||||
export CXX="$LLVM_BIN_DIR/clang++"
|
||||
export FC="$LLVM_BIN_DIR/flang"
|
||||
export PATH="$PATH:$LLVM_BIN_DIR/"
|
||||
# get exact path to ASAN lib containing clang version
|
||||
ASAN_LIB_PATH=$(clang --print-file-name=libclang_rt.asan-x86_64.so)
|
||||
export LD_LIBRARY_PATH="${ASAN_LIB_PATH%/*}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||
export LD_LIBRARY_PATH="${ASAN_LIB_PATH%/*}:${ROCM_PATH}/${ROCM_LLVMDIR}/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||
export ASAN_OPTIONS="detect_leaks=0"
|
||||
}
|
||||
|
||||
set_address_sanitizer_on() {
|
||||
# In SLES and RHEL debuginfo package is not getting generated
|
||||
# when compiler is set to clang. Using default -gdwarf-5 is getting unhandled in these distros
|
||||
# So setting -gdwarf-4 as a quick fix
|
||||
# TODO: -gdwarf-5 unhandling when compiler set to clang need to be fixed
|
||||
SET_DWARF_VERSION_4=""
|
||||
if [[ $DISTRO_ID == sles* ]] || [[ $DISTRO_ID == rhel* ]]; then
|
||||
SET_DWARF_VERSION_4="-gdwarf-4"
|
||||
fi
|
||||
export CFLAGS="-fsanitize=address -shared-libasan -g $SET_DWARF_VERSION_4"
|
||||
export CXXFLAGS="-fsanitize=address -shared-libasan -g $SET_DWARF_VERSION_4"
|
||||
export LDFLAGS="-Wl,--enable-new-dtags -fuse-ld=lld -fsanitize=address -shared-libasan -g -Wl,--build-id=sha1 -L$ROCM_INSTALL_PATH/lib/asan"
|
||||
set_gdwarf_4
|
||||
export CFLAGS="-fsanitize=address -shared-libasan -g -gz $SET_DWARF_VERSION_4"
|
||||
export CXXFLAGS="-fsanitize=address -shared-libasan -g -gz $SET_DWARF_VERSION_4"
|
||||
export LDFLAGS="-Wl,--enable-new-dtags -fuse-ld=lld -fsanitize=address -shared-libasan -g -gz -Wl,--build-id=sha1 -L${ROCM_PATH}/${ROCM_LLVMDIR}/lib -L${ROCM_PATH}/lib/asan -L${ROCM_PATH}/${ROCM_LLVMDIR}/lib/asan"
|
||||
}
|
||||
|
||||
rebuild_lapack() {
|
||||
wget -nv -O lapack-3.9.1.tar.gz \
|
||||
http://compute-artifactory.amd.com/artifactory/rocm-generic-thirdparty-deps/ubuntu/lapack-v3.9.1.tar.gz
|
||||
sh -c "echo 'd0085d2caf997ff39299c05d4bacb6f3d27001d25a4cc613d48c1f352b73e7e0 *lapack-3.9.1.tar.gz' | sha256sum -c"
|
||||
tar xzf lapack-3.9.1.tar.gz --one-top-level=lapack-src --strip-components 1
|
||||
rm lapack-3.9.1.tar.gz
|
||||
|
||||
cmake -Slapack-src -Blapack-bld \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCBLAS=ON \
|
||||
-DLAPACKE=OFF
|
||||
cmake --build lapack-bld -- -j${PROC}
|
||||
sudo -E $(which cmake) --build lapack-bld -- install
|
||||
rm -rf lapack-src lapack-bld
|
||||
}
|
||||
|
||||
ack_and_ignore_asan() {
|
||||
@@ -250,13 +283,13 @@ ack_and_skip_static() {
|
||||
|
||||
#debug function #dumping values in case of error to solve the same
|
||||
print_vars() {
|
||||
echo " Status of Vars in $1 build "
|
||||
echo " TARGET= $2 "
|
||||
echo " BUILD_TYPE = $3 "
|
||||
echo " SHARED_LIBS = $4 "
|
||||
echo " CLEAN_OR_OUT = $5 "
|
||||
echo " PKGTYPE= $6 "
|
||||
echo " MAKETARGET = $7 "
|
||||
echo " Status of Vars in $1 build "
|
||||
echo " TARGET= $2 "
|
||||
echo " BUILD_TYPE = $3 "
|
||||
echo " SHARED_LIBS = $4 "
|
||||
echo " CLEAN_OR_OUT = $5 "
|
||||
echo " PKGTYPE= $6 "
|
||||
echo " MAKETARGET = $7 "
|
||||
}
|
||||
|
||||
# Provide this as a function, rather than a variable to delay the evaluation
|
||||
@@ -316,11 +349,11 @@ rocm_cmake_params() {
|
||||
printf '%s ' "${cmake_params[@]}"
|
||||
}
|
||||
|
||||
copy_if(){
|
||||
copy_if() {
|
||||
local type=$1 selector=$2 dir=$3
|
||||
shift 3
|
||||
mkdir -p "$dir"
|
||||
if [[ "$selector" =~ "$type" ]] ; then
|
||||
if [[ "${selector,,}" =~ "${type,,}" ]] ; then
|
||||
cp -a "$@" "$dir"
|
||||
fi
|
||||
# handle ddeb files as well, renaming them on the way
|
||||
@@ -348,6 +381,8 @@ copy_if(){
|
||||
dest=${deb##*/}
|
||||
dest="${dest%%_*}-dbgsym_${dest#*_}"
|
||||
cp -a "${deb}-dbgsym.ddeb" "$dir/${dest##*/}.deb"
|
||||
# copying the -dbgsym package to build director as well , as it is used for uploading to artifactory
|
||||
cp -a "${deb}-dbgsym.ddeb" "$BUILD_DIR/${dest##*/}.deb"
|
||||
fi
|
||||
# This is needed for comgr
|
||||
if [ -e "$dirname/${pkgname}-dbgsym_${pkgextra}.ddeb" ]
|
||||
@@ -367,6 +402,74 @@ remove_make_r_flags(){
|
||||
if [[ "$MAKEFLAGS" =~ ${firstword}R ]] ; then MAKEFLAGS=${MAKEFLAGS/R/} ; fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Functions to create wheel packages
|
||||
install_wheel_prerequisites(){
|
||||
sudo yum install -y cpio
|
||||
$PY_COMMAND -m pip install --upgrade pip
|
||||
$PY_COMMAND -m pip install --upgrade build wheel setuptools rpm
|
||||
}
|
||||
# Before calling create_wheel_packge, make sure to set the global variables
|
||||
# Global variables: BUILD_SCRIPT_ROOT
|
||||
create_wheel_package() {
|
||||
echo "Creating wheel package"
|
||||
local buildDir="$1"
|
||||
local projName="$2"
|
||||
local PKG_INFO="pkginfo"
|
||||
# Get package output directory from project name
|
||||
local packageDir="$(getRpmPath $projName)"
|
||||
local ROCM_WHEEL_DIR="${buildDir}/_wheel"
|
||||
# Remove the _wheel directory if already exist
|
||||
rm -rf $ROCM_WHEEL_DIR
|
||||
mkdir -p $ROCM_WHEEL_DIR
|
||||
# Copy the setup.py generator to build folder
|
||||
cp -f $BUILD_SCRIPT_ROOT/setup.py $ROCM_WHEEL_DIR
|
||||
pushd $ROCM_WHEEL_DIR
|
||||
|
||||
local PKG_NAME_LIST=( "${packageDir}"/*.rpm )
|
||||
for pkg in "${PKG_NAME_LIST[@]}"; do
|
||||
if [[ "$pkg" =~ "-dbgsym" ]] || [[ "$pkg" =~ "-debuginfo" ]]; then
|
||||
echo "Discarding debug info wheel package. Continue with next package "
|
||||
continue
|
||||
fi
|
||||
pkgFiles=$(rpm -ql "$pkg")
|
||||
if [[ "$pkgFiles" =~ "contains no files" ]]; then
|
||||
echo "Package $pkg is empty."
|
||||
continue
|
||||
fi
|
||||
#Clean up any old files
|
||||
rm -rf opt usr build $PKG_INFO
|
||||
cat << EOF > "$PKG_INFO"
|
||||
PKG_NAME=$pkg
|
||||
EOF
|
||||
# Currently only supports python3.6
|
||||
$PY_COMMAND -m build --wheel -n -C--global-option=--build-number -C--global-option=$BUILD_ID
|
||||
done
|
||||
# Copy the wheel created to RPM folder which will be uploaded to artifactory
|
||||
copy_if WHL "WHL" "$packageDir" "$ROCM_WHEEL_DIR"/dist/*.whl
|
||||
popd
|
||||
}
|
||||
|
||||
# Function used by component build scripts for generating wheel package
|
||||
# Wheel package will be created if WHEEL_PACKAGE is set
|
||||
build_wheel() {
|
||||
if [[ "$WHEEL_PACKAGE" != "true" ]] || [[ "$SHARED_LIBS" == "OFF" ]] || [[ "$ENABLE_ADDRESS_SANITIZER" == "true" ]]; then
|
||||
echo "Wheel Package build disabled !!!!"
|
||||
return
|
||||
fi
|
||||
echo "Wheel Package build started !!!!"
|
||||
install_wheel_prerequisites
|
||||
# Input argument
|
||||
# $1 : Build directory
|
||||
# $2 : project name
|
||||
if [ -n "$1" ]; then
|
||||
create_wheel_package "$1" "$2"
|
||||
else
|
||||
create_wheel_package $BUILD_DIR "${PACKAGE_DIR##*/}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Set a variable to the value needed by cmake to use ninja if it is available
|
||||
# If GEN_NINJA is already defined, even as the empty string, then leave the value alone
|
||||
# Intended use in build_xxxx.sh is ${GEN_NINJA:+"$GEN_NINJA"} to cope with potentially weird values
|
||||
@@ -377,3 +480,290 @@ if [ "${GEN_NINJA+defined}" != "defined" ] && command -v ninja >/dev/null ; then
|
||||
GEN_NINJA=-GNinja
|
||||
fi
|
||||
|
||||
# Install amdgpu-install-internal package required for running amdpgu-repo and
|
||||
# set the repo for installing amdgpu static package
|
||||
set_amdgpu_repo() {
|
||||
#if amdgpu-repo command doesn't exist, install it
|
||||
if ! command -v amdgpu-repo &> /dev/null
|
||||
then
|
||||
# From ROCm VERSION get the first two numbers eg 6.2.0 --> 6.2
|
||||
AMDGPU_INSTALL_VER=${ROCM_VERSION%%.${ROCM_VERSION#?.*.}}
|
||||
# Currently static builds are triggered in RHEL-8 OS. only yum install is used for time being
|
||||
# TODO: Should be modified to handle other OS as well
|
||||
BASE_URL="https://artifactory-cdn.amd.com/artifactory/list/amdgpu-rpm/rhel"
|
||||
sudo yum install -y "${BASE_URL}/amdgpu-install-internal-${AMDGPU_INSTALL_VER}_8-1.noarch.rpm"
|
||||
fi
|
||||
KERNEL_INFO_FILE_URL=http://rocm-ci.amd.com/job/$JOB_NAME/$BUILD_ID/artifact/amdgpu_kernel_info.txt
|
||||
RADEON_TIER=$(curl "${KERNEL_INFO_FILE_URL}") || die "Failed to set Linux core build number."
|
||||
AMDGPU_BUILD_OPT="--amdgpu-build=${RADEON_TIER}"
|
||||
for delay in 0 30 60 120
|
||||
do
|
||||
echo "Sleeping ${delay} seconds"
|
||||
sleep ${delay};
|
||||
sudo amdgpu-repo $AMDGPU_BUILD_OPT --rocm-build="${JOB_NAME}/${BUILD_ID}" && return 0
|
||||
echo "Attempt to update repo using amdgpu-repo failed, retrying..."
|
||||
done
|
||||
echo "All attempts for amdgpu-repo installation failed, fallback to local repo update and installation!"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Function will install drm static packages and its dependencies
|
||||
install_drmStatic_lib(){
|
||||
if set_amdgpu_repo ; then
|
||||
sudo yum install -y libdrm-amdgpu-static
|
||||
else
|
||||
echo " amdgpu repo setting failed (rc=$?) "
|
||||
exit 60
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Set offload compress to ON by default
|
||||
DISABLE_OFFLOAD_COMPRESSION="false"
|
||||
setup_offload_compress(){
|
||||
# Enable offload compression based on the flag
|
||||
if [ "${DISABLE_OFFLOAD_COMPRESSION}" == "false" ] ; then
|
||||
export CFLAGS="$CFLAGS --offload-compress "
|
||||
export CXXFLAGS="$CXXFLAGS --offload-compress "
|
||||
else
|
||||
# Disable offload compression based on the flag
|
||||
export CFLAGS=${CFLAGS//" --offload-compress "/ }
|
||||
export CXXFLAGS=${CXXFLAGS//" --offload-compress "/ }
|
||||
fi
|
||||
}
|
||||
|
||||
# Get CMAKE build flags for CMAKE build trigger
|
||||
set_build_variables() {
|
||||
|
||||
# Variables which changes based on build types ex:ASAN/STATIC Builds.
|
||||
# Note:
|
||||
# 1. __CXX__ Argument is for getting the equivalant cmake_cxx_flag_params
|
||||
# which is clang++ for ASAN/STATIC builds and hipcc for rest all builds.
|
||||
# 2. __CC__ Argument is for getting the equivalant cmake_cc_flag_params
|
||||
# which is clang for ASAN/STATIC builds and hipcc for rest all builds.
|
||||
# 3. Similarly the __CMAKE_CXX_COMPILER__ and __CMAKE_CC_COMPILER__ Arguments
|
||||
# gives clang++, clang configuration for ASAN/STATIC and hipcc for rest of all builds.
|
||||
local cxx_flag_params
|
||||
local cc_flag_params
|
||||
local LLVM_BIN_DIR="$ROCM_PATH/lib/llvm/bin"
|
||||
local HIPCC_BIN_DIR="$ROCM_PATH/bin"
|
||||
|
||||
# Set Variable based on build types
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ] || [ "${ENABLE_STATIC_BUILDS}" == "true" ] ; then
|
||||
cxx_flag_params="$LLVM_BIN_DIR/clang++"
|
||||
cc_flag_params="$LLVM_BIN_DIR/clang"
|
||||
else
|
||||
setup_offload_compress
|
||||
cxx_flag_params="$HIPCC_BIN_DIR/hipcc"
|
||||
cc_flag_params="$HIPCC_BIN_DIR/hipcc"
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
("__C_++__")
|
||||
printf "%s" "c++"
|
||||
;;
|
||||
("__G_++__")
|
||||
printf "%s" "g++"
|
||||
;;
|
||||
("__AMD_CLANG_++__")
|
||||
printf "%s" "amdclang++"
|
||||
;;
|
||||
("__HIP_CC__")
|
||||
printf "%s" "$HIPCC_BIN_DIR/hipcc"
|
||||
;;
|
||||
("__CLANG++__")
|
||||
printf "%s" "$LLVM_BIN_DIR/clang++"
|
||||
;;
|
||||
("__CLANG__")
|
||||
printf "%s" "$LLVM_BIN_DIR/clang"
|
||||
;;
|
||||
("__CXX__")
|
||||
printf "%s" "${cxx_flag_params}"
|
||||
;;
|
||||
("__CC__")
|
||||
printf "%s" "${cc_flag_params}"
|
||||
;;
|
||||
("__CMAKE_CC_PARAMS__")
|
||||
printf '%s ' "-DCMAKE_C_COMPILER=${cc_flag_params}"
|
||||
;;
|
||||
("__CMAKE_CXX_PARAMS__")
|
||||
printf '%s ' "-DCMAKE_CXX_COMPILER=${cxx_flag_params}"
|
||||
;;
|
||||
(*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
# Get the install directory name for libraries
|
||||
getInstallLibDir() {
|
||||
local libDir="lib"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ] ; then
|
||||
libDir="lib/asan"
|
||||
fi
|
||||
echo "$libDir"
|
||||
}
|
||||
|
||||
# Hardcoding the default GPU_ARCH, but this will be overwritten by input from job param or by component build script
|
||||
GFX_ARCH="gfx908;gfx90a:xnack-;gfx90a:xnack+;gfx1030;gfx1100;gfx1101;gfx1102;gfx942:xnack-;gfx942:xnack+;gfx1200;gfx1201"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ] ; then
|
||||
# updating Default GPU_ARCHS for ASAN builds
|
||||
GFX_ARCH="gfx90a:xnack+;gfx942:xnack+"
|
||||
fi
|
||||
# if ENABLE_GPU_ARCH Job parameter is set, then set GFX_ARCH to that value
|
||||
if [ -n "$ENABLE_GPU_ARCH" ]; then
|
||||
GFX_ARCH="$ENABLE_GPU_ARCH"
|
||||
fi
|
||||
# Finally overwrite the GPU_ARCH with the value from the component build script, if set_gpu_arch is called
|
||||
# We need to make sure where set_gpu_arch is called in the component build script,
|
||||
# it should have if condition to check if GPU_ARCH is set by ENABLE_GPU_ARCH, so JOB LEVEL PARAM will have highest priority
|
||||
set_gpu_arch(){
|
||||
GFX_ARCH="$1"
|
||||
}
|
||||
|
||||
disable_debug_package_generation(){
|
||||
SET_DWARF_VERSION_4=""
|
||||
DISABLE_DEBUG_PACKAGE="true"
|
||||
}
|
||||
|
||||
# Populate the common cmake params
|
||||
rocm_math_common_cmake_params=()
|
||||
init_rocm_common_cmake_params(){
|
||||
local retCmakeParams=${1:-rocm_math_common_cmake_params}
|
||||
local SET_BUILD_TYPE=${BUILD_TYPE:-'RelWithDebInfo'}
|
||||
local ASAN_LIBDIR="lib/asan"
|
||||
local CMAKE_PATH=$(getCmakePath)
|
||||
# Common cmake parameters can be set
|
||||
# component build scripts can use this function
|
||||
local cmake_params
|
||||
if [ "${ASAN_CMAKE_PARAMS}" == "true" ] ; then
|
||||
cmake_params=(
|
||||
"-DCMAKE_PREFIX_PATH=$CMAKE_PATH;${ROCM_PATH}/$ASAN_LIBDIR;$ROCM_PATH/llvm;$ROCM_PATH"
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_ASAN_LIB_RPATH"
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_ASAN_EXE_RPATH"
|
||||
"-DENABLE_ASAN_PACKAGING=true"
|
||||
)
|
||||
else
|
||||
cmake_params=(
|
||||
"-DCMAKE_PREFIX_PATH=${ROCM_PATH}/llvm;${ROCM_PATH}"
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_LIB_RPATH"
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_EXE_RPATH"
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_params+=(
|
||||
"-DCMAKE_VERBOSE_MAKEFILE=1"
|
||||
"-DCMAKE_BUILD_TYPE=${SET_BUILD_TYPE}"
|
||||
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE"
|
||||
"-DCMAKE_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DCMAKE_PACKAGING_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF"
|
||||
"-DROCM_SYMLINK_LIBS=OFF"
|
||||
"-DCPACK_PACKAGING_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DROCM_DISABLE_LDCONFIG=ON"
|
||||
"-DCPACK_SET_DESTDIR=OFF"
|
||||
"-DCPACK_RPM_PACKAGE_RELOCATABLE=ON"
|
||||
"-DROCM_PATH=${ROCM_PATH}"
|
||||
)
|
||||
#rocWMMa does not support gfx1030, so removing from default
|
||||
if [ "${COMPONENT_SRC}" == "$LIBS_WORK_DIR/rocWMMA" ]; then
|
||||
GFX_ARCH=$(echo $GFX_ARCH | sed 's/\(gfx1030;\)//g')
|
||||
fi
|
||||
#if component is not composable_kernel then only add -DAMDGPU_TARGETS, this is not supported for CK along with -DINSTANCES_ONLY
|
||||
if [ "${COMPONENT_SRC}" != "$LIBS_WORK_DIR/composable_kernel" ]; then
|
||||
cmake_params+=(
|
||||
"-DAMDGPU_TARGETS=${GFX_ARCH}"
|
||||
)
|
||||
fi
|
||||
|
||||
#if component is not hipsparselt | hipblaslt | rocBLAS | composable_kernel, then only add below cmake params. as GPU_TARGETS and CMAKE_HIP_ARCHITECTURES are not supported for hipsparselt, hipblaslt and rocblas
|
||||
# in future after SWDEV-468293, below params is not needed for any component
|
||||
case "${COMPONENT_SRC}" in
|
||||
"${LIBS_WORK_DIR}/hipSPARSELt" | "${LIBS_WORK_DIR}/hipBLASLt" | "${LIBS_WORK_DIR}/rocBLAS" | "${LIBS_WORK_DIR}/composable_kernel")
|
||||
# Do nothing for these components
|
||||
;;
|
||||
*)
|
||||
cmake_params+=(
|
||||
"-DGPU_TARGETS=${GFX_ARCH}"
|
||||
"-DCMAKE_HIP_ARCHITECTURES=${GFX_ARCH}"
|
||||
)
|
||||
;;
|
||||
esac
|
||||
#TODO :remove if clause once debug related issues are fixed
|
||||
if [ "${DISABLE_DEBUG_PACKAGE}" == "true" ] ; then
|
||||
SET_BUILD_TYPE=Release
|
||||
cmake_params+=(
|
||||
"-DCPACK_DEBIAN_DEBUGINFO_PACKAGE=FALSE"
|
||||
"-DCPACK_RPM_DEBUGINFO_PACKAGE=FALSE"
|
||||
"-DCPACK_RPM_INSTALL_WITH_EXEC=FALSE"
|
||||
"-DCMAKE_BUILD_TYPE=${SET_BUILD_TYPE}"
|
||||
)
|
||||
elif [ "$SET_BUILD_TYPE" == "RelWithDebInfo" ] || [ "$SET_BUILD_TYPE" == "Debug" ]; then
|
||||
# RelWithDebinfo optimization level -O2 is having performance impact
|
||||
# So overriding the same to -O3
|
||||
set_gdwarf_4
|
||||
cmake_params+=(
|
||||
"-DCPACK_DEBIAN_DEBUGINFO_PACKAGE=TRUE"
|
||||
"-DCPACK_RPM_DEBUGINFO_PACKAGE=TRUE"
|
||||
"-DCPACK_RPM_INSTALL_WITH_EXEC=TRUE"
|
||||
"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${SET_DWARF_VERSION_4} -O3 -g -DNDEBUG"
|
||||
)
|
||||
fi
|
||||
eval "${retCmakeParams}=( \"\${cmake_params[@]}\" ) "
|
||||
}
|
||||
|
||||
# Setup a number of variables to specify where to find the source
|
||||
# where to do the build and where to put the packages
|
||||
# Note the PACKAGE_DIR downcases the package name
|
||||
# This could be extended to do different things based on $1
|
||||
set_component_src(){
|
||||
COMPONENT_SRC="$LIBS_WORK_DIR/$1"
|
||||
|
||||
BUILD_DIR="$OUT_DIR/build/$1"
|
||||
DEB_PATH="$OUT_DIR/${PKGTYPE}/${1,,}"
|
||||
RPM_PATH="$OUT_DIR/${PKGTYPE}/${1,,}"
|
||||
PACKAGE_DIR="$OUT_DIR/${PKGTYPE}/${1,,}"
|
||||
}
|
||||
|
||||
# Standard definition of function to print the package location. If
|
||||
# for some reason a custom version is needed then it can overwrite
|
||||
# this definition
|
||||
# TODO: Don't use a global PKGTYPE, pass the value in as a parameter
|
||||
print_output_directory() {
|
||||
case ${1:-$PKGTYPE} in
|
||||
("deb")
|
||||
echo ${DEB_PATH};;
|
||||
("rpm")
|
||||
echo ${RPM_PATH};;
|
||||
(*)
|
||||
echo "Invalid package type \"${PKGTYPE}\" provided for -o" >&2; exit 1;;
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
# Standard argument processing
|
||||
# Here to avoid repetition
|
||||
TARGET="build" # default target
|
||||
stage2_command_args(){
|
||||
while [ "$1" != "" ];
|
||||
do
|
||||
case $1 in
|
||||
-o | --outdir )
|
||||
shift 1; PKGTYPE=$1 ; TARGET="outdir" ;;
|
||||
-c | --clean )
|
||||
TARGET="clean" ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
shift 1
|
||||
done
|
||||
}
|
||||
|
||||
show_build_cache_stats(){
|
||||
if [ "$CCACHE_ENABLED" = "true" ] ; then
|
||||
if ! ccache -s; then
|
||||
echo "Unable to display sccache stats"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -22,9 +22,18 @@ if [ "$DASH_JAY" == "" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
export JOB_NAME=release
|
||||
# explanation of JOB_DESIGNATOR states:
|
||||
# exists, empty string -> originated from release job, pass thru a null string
|
||||
# exists, non-empty -> originated from other CI job, use as set, example: "dnnhc."
|
||||
# does not exist -> dev or non-CI build, got to this point without instantiation
|
||||
# so assign a default value: "local."
|
||||
export JOB_DESIGNATOR="${JOB_DESIGNATOR-"local."}"
|
||||
echo "JOB_DESIGNATOR=${JOB_DESIGNATOR}"
|
||||
|
||||
# explanation of SLES_BUILD_ID_PREFIX states:
|
||||
# exists, non-empty -> originated from sles job, use as set, example: "sles151."
|
||||
# exists, empty string -> originated from non-sles job, pass thru a null string
|
||||
# does not exist -> got to this point without instantiation so a default null string: ""
|
||||
export SLES_BUILD_ID_PREFIX
|
||||
echo "SLES_BUILD_ID_PREFIX=${SLES_BUILD_ID_PREFIX}"
|
||||
|
||||
@@ -42,11 +51,24 @@ export DISTRO_NAME=$ID
|
||||
export DISTRO_RELEASE=$VERSION_ID
|
||||
export DISTRO_ID=$ID-$VERSION_ID
|
||||
|
||||
|
||||
# Enable wheel package for Almainux-8 mainline builds
|
||||
# Currently no wheel package required for static and ASAN builds
|
||||
if [[ "${DISTRO_ID}" == almalinux-8* ]] && [[ "${ENABLE_ADDRESS_SANITIZER}" != "true" ]] && [[ "${ENABLE_STATIC_BUILD}" != "true" ]]; then
|
||||
export WHEEL_PACKAGE=true
|
||||
else
|
||||
unset WHEEL_PACKAGE
|
||||
fi
|
||||
|
||||
case "${DISTRO_NAME}" in
|
||||
("ubuntu") export CPACKGEN=DEB PACKAGEEXT=deb PKGTYPE=deb ROCM_PKGTYPE=DEB ;;
|
||||
("centos") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ;;
|
||||
("sles") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ;;
|
||||
("rhel") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ;;
|
||||
("centos") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ROCM_PKGTYPE=RPM ;;
|
||||
("sles") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ROCM_PKGTYPE=RPM ;;
|
||||
("rhel") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ROCM_PKGTYPE=RPM ;;
|
||||
("mariner") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ROCM_PKGTYPE=RPM ;;
|
||||
("azurelinux") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ROCM_PKGTYPE=RPM ;;
|
||||
("almalinux") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ROCM_PKGTYPE=RPM ;;
|
||||
("debian") export CPACKGEN=DEB PACKAGEEXT=deb PKGTYPE=deb ROCM_PKGTYPE=DEB ;;
|
||||
esac
|
||||
|
||||
# set up package file name variables for CPACK_GENERATOR
|
||||
@@ -55,10 +77,15 @@ esac
|
||||
export CPACK_DEBIAN_PACKAGE_RELEASE="${JOB_DESIGNATOR}${SLES_BUILD_ID_PREFIX}${BUILD_ID}~$VERSION_ID"
|
||||
export CPACK_RPM_PACKAGE_RELEASE="${JOB_DESIGNATOR}${SLES_BUILD_ID_PREFIX}${BUILD_ID}"
|
||||
|
||||
export SCRIPT_PATH=$WORK_ROOT/brahma-utils/kfd-tools/scripts
|
||||
export ENV_PATH=$SCRIPT_PATH/hsaThunk.env
|
||||
OUT_DIR="${OUT_DIR:=$WORK_ROOT/out/$DISTRO_ID/$DISTRO_RELEASE}"
|
||||
export OUT_DIR
|
||||
export RT_TMP=$OUT_DIR/tmp/rt
|
||||
|
||||
# Unused
|
||||
# export ROCM_VERSION=$(git --git-dir=$WORK_ROOT/.repo/manifests/.git describe --always)
|
||||
|
||||
#source transform, for things like ocl_lc
|
||||
export SRC_TF_ROOT=$OUT_DIR/srctf
|
||||
|
||||
@@ -77,25 +104,36 @@ get_rocm_libpatch_version() {
|
||||
|
||||
# Read the default ROCm version from rocm_version.txt if the ROCM_VERSION
|
||||
# variable is either not set, empty or only contains spaces.
|
||||
if [ -f "${WORK_ROOT}/build/rocm_version.txt" ] && [ -z $ROCM_VERSION ]; then
|
||||
ROCM_VERSION="$(cat ${WORK_ROOT}/build/rocm_version.txt)"
|
||||
if [ -f "${BUILD_SCRIPT_ROOT}/rocm_version.txt" ] && [ -z $ROCM_VERSION ]; then
|
||||
ROCM_VERSION="$(cat ${BUILD_SCRIPT_ROOT}/rocm_version.txt)"
|
||||
fi
|
||||
|
||||
: ${ROCM_VERSION:="6.3.0"}
|
||||
# ROCM variables
|
||||
# ROCM_VERSION and ROCM_LIBPATCH_VERSION are changed: Eg:"3.3.0" ~= 30300
|
||||
#default ROCM_VERSION: 9.99.99 and ROCM_LIBPATCH_VERSION: 99999 if not set
|
||||
: ${ROCM_VERSION:="9.99.99"}
|
||||
ROCM_LIBPATCH_VERSION=$(get_rocm_libpatch_version $ROCM_VERSION)
|
||||
echo "ROCM_VERSION=${ROCM_VERSION}"
|
||||
echo "ROCM_LIBPATCH_VERSION=${ROCM_LIBPATCH_VERSION}"
|
||||
export ROCM_VERSION ROCM_LIBPATCH_VERSION
|
||||
|
||||
export ROCM_INSTALL_PATH="/opt/rocm-${ROCM_VERSION}-${BUILD_ID}"
|
||||
# check if the job = release
|
||||
if [[ "${JOB_NAME}" == *rel* ]]; then
|
||||
export ROCM_INSTALL_PATH="/opt/rocm-${ROCM_VERSION}"
|
||||
fi
|
||||
# Previously we would put the job number into the ROCM_INSTALL_PATH
|
||||
# This interacted badly with our desire to reuse builds, a it ment every build was unique
|
||||
export ROCM_INSTALL_PATH="/opt/rocm-${ROCM_VERSION}"
|
||||
|
||||
# Setting the ROCM_INSTALL_PATH id to Last Know Good build ID, PSDB incremental built packages will install into /opt/rocm-<parent build ID>
|
||||
if [ -n "${LKG_BUILD_ID}" ]; then
|
||||
export ROCM_INSTALL_PATH="/opt/rocm-${ROCM_VERSION}-${LKG_BUILD_ID}"
|
||||
# No longer applicable, as we no longer have the job number in the ROCM_INSTALL_PATH
|
||||
|
||||
if [ -n "${AFAR_VERSION}" ]; then
|
||||
# multi-version (side-by-side) install for Advanced Feature Access Release (AFAR)
|
||||
# suggested AFAR_VERSION: "afar001"
|
||||
# Hopefully this is correct for AFAR
|
||||
ROCM_INSTALL_PATH="/opt/rocm-${AFAR_VERSION##-}"
|
||||
fi
|
||||
|
||||
if [[ "${ENABLE_STATIC_BUILDS}" == true ]]; then
|
||||
# For static builds add a -static post fix in rocm folder
|
||||
export ROCM_INSTALL_PATH="${ROCM_INSTALL_PATH}-static"
|
||||
fi
|
||||
|
||||
echo "Setting ROCM_INSTALL_PATH=${ROCM_INSTALL_PATH}"
|
||||
@@ -108,18 +146,30 @@ export DEVTOOLSET_LIBPATH="/opt/rh/devtoolset-7/root/usr/lib64;/opt/rh/devtoolse
|
||||
# TODO: We should have autodiscoverable makefiles
|
||||
export DIST_NO_DEBUG=yes
|
||||
export OPENCL_MAINLINE=1
|
||||
# export P4_ROOT=$WORK_ROOT/p4
|
||||
# export RT_ROOT=$P4_ROOT/driver/
|
||||
export FW_ROOT=$WORK_ROOT/brahma-utils/firmware/deb-pkgs
|
||||
# export HSA_ROOT=$WORK_ROOT/hsa
|
||||
export HSA_SOURCE_ROOT=$WORK_ROOT/ROCR-Runtime
|
||||
# export HSA_CLOSED_SOURCE_ROOT=$WORK_ROOT/p4/driver
|
||||
export HSA_OPENSOURCE_ROOT=$HSA_SOURCE_ROOT/src
|
||||
# export ROCR_ROOT=$HSA_ROOT/rocr-runtime
|
||||
export ROCR_ROOT=$WORK_ROOT/ROCR-Runtime
|
||||
export ROCRTST_ROOT=$HSA_SOURCE_ROOT/rocrtst
|
||||
export HSA_CORE_ROOT=$HSA_OPENSOURCE_ROOT
|
||||
export HSA_IMAGE_ROOT=$HSA_OPENSOURCE_ROOT/hsa-ext-image
|
||||
export HSA_FINALIZE_ROOT=$HSA_OPENSOURCE_ROOT/hsa-ext-finalize
|
||||
export HSA_TOOLS_ROOT=$HSA_OPENSOURCE_ROOT/hsa-runtime-tools
|
||||
# export HSA_RT_ROOT=$RT_ROOT/drivers/hsa/runtime
|
||||
# export OCL_RT_ROOT=$RT_ROOT/drivers/opencl
|
||||
# export OCL_RT_STG_ROOT=$P4_ROOT/opencl
|
||||
export OCL_RT_SRC_TF_ROOT=$SRC_TF_ROOT/ocl_lc
|
||||
export KERNEL_ROOT=$WORK_ROOT/kernel
|
||||
export SCRIPT_ROOT=$WORK_ROOT/build
|
||||
export BUILD_SCRIPT_ROOT=$WORK_ROOT/ROCm/tools/rocm-build
|
||||
export TEST_SCRIPT_ROOT=$WORK_ROOT/MLSEQA_TestRepo
|
||||
export THUNK_ROOT=$WORK_ROOT/ROCT-Thunk-Interface
|
||||
|
||||
export AMDGPURASTOOL_ROOT=$WORK_ROOT/amdgpuras-tool
|
||||
export AQLPROFILE_ROOT=$WORK_ROOT/aqlprofile
|
||||
export ROCPROFILER_ROOT=$WORK_ROOT/rocprofiler
|
||||
export ROCTRACER_ROOT=$WORK_ROOT/roctracer
|
||||
@@ -127,14 +177,22 @@ export ROCPROFILER_REGISTER_ROOT=$WORK_ROOT/rocprofiler-register
|
||||
export ROCPROFILER_SDK_ROOT=$WORK_ROOT/rocprofiler-sdk
|
||||
export ROCPROFILER_COMPUTE_ROOT=$WORK_ROOT/rocprofiler-compute
|
||||
export ROCPROFILER_SYSTEMS_ROOT=$WORK_ROOT/rocprofiler-systems
|
||||
export RDC_ROOT=$WORK_ROOT/rdc
|
||||
export RDCTST_ROOT=$RDC_ROOT/tests/rdc_tests
|
||||
export UTILS_ROOT=$WORK_ROOT/rocm-utils
|
||||
export KFDTEST_ROOT=$THUNK_ROOT/tests/kfdtest
|
||||
if [ -d "$HSA_OPENSOURCE_ROOT/tests/kfdtest" ]; then
|
||||
export KFDTEST_ROOT=$HSA_OPENSOURCE_ROOT/tests/kfdtest
|
||||
fi
|
||||
# export HSA_SAMPLES_ROOT=$RT_ROOT/drivers/hsa/runtime/samples
|
||||
# export CHIMEX_ROOT=$WORK_ROOT/benchmarks/chimex
|
||||
# export AMDP2P_ROOT=$WORK_ROOT/drivers/amdp2p
|
||||
# export HIP_ROOT=$WORK_ROOT/HIP
|
||||
# export HIP_VDI_ROCM_SRC_TF_ROOT=$SRC_TF_ROOT/hip_vdi_rocm
|
||||
# export HIP_VDI_PAL_SRC_TF_ROOT=$SRC_TF_ROOT/hip_vdi_pal
|
||||
# export HIP_SAMPLES_ROOT=$WORK_ROOT/HIP-Examples
|
||||
# export HIP_PRIVATE_SAMPLES_ROOT=$WORK_ROOT/hip-examples-private
|
||||
export HIPIFY_ROOT=$WORK_ROOT/HIPIFY
|
||||
# export GPUBURN_ROOT=$WORK_ROOT/tests/gpuburn
|
||||
# export HSAPROFILER_TEST_ROOT=$WORK_ROOT/dev-tools/RCP-Internal/Src/Tests/HSAFoundationProfileAPITest
|
||||
# export HSATESTCOMMON_ROOT=$WORK_ROOT/dev-tools/Common/Src/HSATestCommon
|
||||
# export HSATESTGTEST_ROOT=$WORK_ROOT/dev-tools/Common/Lib/Ext/GoogleTest1.8/googletest
|
||||
# export SMI_ROOT=$WORK_ROOT/rocm-smi
|
||||
export AMD_SMI_LIB_ROOT=$WORK_ROOT/amdsmi
|
||||
export ROCM_SMI_LIB_ROOT=$WORK_ROOT/rocm_smi_lib
|
||||
export RSMITST_ROOT=$ROCM_SMI_LIB_ROOT/tests/rocm_smi_test
|
||||
@@ -144,20 +202,30 @@ export CLANG_ROOT=$LLVM_PROJECT_ROOT/clang
|
||||
export LLD_ROOT=$LLVM_PROJECT_ROOT/lld
|
||||
export HIPCC_ROOT=$LLVM_PROJECT_ROOT/amd/hipcc
|
||||
export DEVICELIBS_ROOT=$LLVM_PROJECT_ROOT/amd/device-libs
|
||||
export DKMS_ROOT=$WORK_ROOT/drivers/linux-dkms
|
||||
export ROCM_ROOT=$WORK_ROOT/meta
|
||||
export ROCM_CORE_ROOT=$WORK_ROOT/rocm-core
|
||||
export ROCM_DEV_ROOT=$WORK_ROOT/meta/rocm-dev
|
||||
export ROCM_CMAKE_ROOT=$WORK_ROOT/rocm-cmake
|
||||
export ROCM_BANDWIDTH_TEST_ROOT=$WORK_ROOT/rocm_bandwidth_test
|
||||
export ROCMINFO_ROOT=$WORK_ROOT/rocminfo
|
||||
export ROCR_DEBUG_AGENT_ROOT=$WORK_ROOT/rocr_debug_agent
|
||||
export COMGR_ROOT=$LLVM_PROJECT_ROOT/amd/comgr
|
||||
export COMGR_LIB_PATH=$OUT_DIR/build/amd_comgr
|
||||
# export HOSTCALL_ROOT=$WORK_ROOT/hostcall
|
||||
export RCCL_ROOT=$WORK_ROOT/rccl
|
||||
export ROCM_DBGAPI_ROOT=$WORK_ROOT/ROCdbgapi
|
||||
export ROCM_GDB_ROOT=$WORK_ROOT/ROCgdb
|
||||
export HIP_ON_ROCclr_ROOT=$WORK_ROOT/HIP
|
||||
# export ROCclr_ROOT=$WORK_ROOT/vdi
|
||||
export HIP_ON_ROCclr_ROOT=$WORK_ROOT/hip
|
||||
export HIPAMD_ROOT=$WORK_ROOT/hipamd
|
||||
export HIP_CATCH_TESTS_ROOT=$WORK_ROOT/hip-tests
|
||||
# export OPENCL_ON_ROCclr_ROOT=$WORK_ROOT/opencl-on-vdi
|
||||
export CLR_ROOT=$WORK_ROOT/clr
|
||||
export OPENCL_CTS_ROOT=$WORK_ROOT/OpenCL-CTS
|
||||
export OPENCL_ICD_LOADER_ROOT=$WORK_ROOT/OpenCL-ICD-Loader
|
||||
export OPENCL_HEADERS_ROOT=$WORK_ROOT/OpenCL-Headers
|
||||
export OPENCL_CLHPP_ROOT=$WORK_ROOT/OpenCL-CLHPP
|
||||
export AOMP_REPOS=$WORK_ROOT/openmp-extras
|
||||
export HIPOTHER_ROOT=$WORK_ROOT/hipother
|
||||
|
||||
@@ -170,9 +238,16 @@ export ROCM_EXE_RPATH='$ORIGIN/../lib'
|
||||
export ROCM_ASAN_LIB_RPATH='$ORIGIN:$ORIGIN/..'
|
||||
export ROCM_ASAN_EXE_RPATH="\$ORIGIN/../lib/asan:\$ORIGIN/../lib"
|
||||
|
||||
# Intermediate output directories for projects without build output relocation
|
||||
export FW_OUT=$WORK_ROOT/brahma-utils/firmware/deb-pkgs
|
||||
|
||||
export PATH=$PATH:$SCRIPT_ROOT
|
||||
if [ -e "$SCRIPT_PATH/hsaThunk.util" ]; then
|
||||
source $SCRIPT_PATH/hsaThunk.util $ENV_PATH $WORK_ROOT
|
||||
fi
|
||||
|
||||
# From setup_env.sh
|
||||
export BUILD_TYPE=RelWithDebInfo
|
||||
export LIBS_WORK_DIR=$WORK_ROOT
|
||||
export BUILD_ARTIFACTS=$OUT_DIR/$PACKAGEEXT
|
||||
|
||||
@@ -185,7 +260,20 @@ export LC_ALL=C.UTF-8
|
||||
export LANG=C.UTF-8
|
||||
|
||||
export PROC=${PROC:-"$(nproc)"}
|
||||
export RELEASE_FLAG=${RELEASE_FLAG:-"-r"}
|
||||
# export RELEASE_FLAG=${RELEASE_FLAG:-"-r"}
|
||||
export SUDO=sudo
|
||||
export PATH=/usr/local/bin:${PATH}:/sbin:/bin
|
||||
export CCACHE_DIR=${HOME}/.ccache
|
||||
|
||||
# set ccache environment variable for math libraries
|
||||
if [[ "${CCACHE_ENABLED}" != "false" ]]; then
|
||||
response=$(redis-cli -u ${CCACHE_REMOTE_STORAGE} ping) || true
|
||||
if [ "${response}" != "PONG" ]; then
|
||||
echo "Redis server unreachable."
|
||||
else
|
||||
echo "Redis server reacheble."
|
||||
fi
|
||||
export LAUNCHER_FLAGS="-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache -DCMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache"
|
||||
export CCACHE_COMPILERCHECK=none
|
||||
export CCACHE_EXTRAFILES=${OUT_DIR}/rocm_compilers_hash_file
|
||||
fi
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user