Skip to content

Commit

Permalink
ROCm 6: bring back (#2019)
Browse files Browse the repository at this point in the history
**Summary**

Bring back ROCm 6.0. I have traced the crash in Blender (that caused our
previous revert of ROCm 6) to a compiler bug and found a workaround to
the issue.

Notably, we're the first distro to introduce built-in compatibility with
non-officially supported architectures. Previously, to run an
unofficially supported GPU (e.g. my `gfx1032`), I must manually export
the environment variable `HSA_OVERRIDE_GFX_VERSION=10.3.0` to emulate my
GPU as `gfx1030`, an officially supported model. With these set of
patches, which are either directly borrowed from or inspired by @cgmb's
similar patches for Debian (thank you!), `HSA_OVERRIDE_GFX_VERSION` is
not needed for the following GPUS:

- `gfx902`, `gfx909`, `gfx90c` -> masked as `gfx900`
- `gfx101*` (all RDNA1 GPUs) -> masked as `gfx1010`
- `gfx103*` (all RDNA2 GPUs) -> masked as `gfx1030`

This should cover the majority of uses cases of ROCm, therefore to some
extent making us the distro with the best out-of-the-box ROCm
experience.

I've also PGO'ed AMD's fork of LLVM that's used to compile HIP code. It
gives somewhere around a 13% performance improvement.

**Test Plan**

- Ran Fooocus (that uses `pytorch`) and generated a few images.
- Rendered all sorts of Blender scenes that uses cycles (including the
ones that have caused the same crash on Blender bug reports)
- Ran `llama.cpp` with Gemma-2b-instruct.

**Changes**

- **Reapply "rocm-device-libs: update to 6.0.0"**
- **Reapply "rocm-cmake: update to 6.0.0"**
- **rocm-cmake: update to 6.0.0**
- **rocm-device-libs: update to 6.0.0**
- **hsakmt: update to 6.0.0**
- **rocm-runtime: update to 6.0.0**
- **rocm-info: update to 6.0.0**
- **rocm-smi: update to 6.0.0**
- **rocm-compilersupport: update to 6.0.0**
- **rocm-clr: bring back after ROCm 6 revert**
- **rocm-llvm: PGO**
- **rocprim: update to 3.0.0**
- **rocsparse: update to 3.0.2**
- **rocfft: update to 1.0.25**
- **rocsolver: update to 3.24.0**
- **rocblas: update to 4.0.0**
- **hipblas: update to 2.0.0**
- **rocrand: update to v2.0.17 (ROCm 6.0.0)**
- **hiprand: update to v2.0.17 (ROCm 6.0.0)**
- **rocmlir: update to 6.0.0**
- **rocm-core: update to 6.0.0**
- **rocm-hipify: update to 6.0.0**
- **rccl: update to 2.15.5 (ROCm 6.0.0)**
- **half: adjust header file location**
- **hsa-amd-aqlprofile: update to 6.0.0**
- **rocprofiler: update to 6.0.0**
- **roctracer: update to 6.0.0**
- **composable-kernel: bring back and build for more dtypes**
- **miopen: update to 3.00.0 (ROCm 6)**
- **hipsparse: update to 3.0.0 (ROCm 6.0)**
- **hipsolver: update to 2.0.0 (ROCm 6)**
- **hipfft: update to 1.0.13 (ROCm 6.0.0)**
- **hipcub: update to 3.0.0 (ROCm 6.0)**
- **frugally-deep: bring back**
- **functional-plus: bring back**
- **pytorch: update to v2.2.0 and ROCm 6.0**
- **python-torchvision: update to 0.17.0**
- **python-torchvision: update to v2.2.0 and ROCm 6.0**
- **python-torchtext: update to v0.17.0**
- **blender: bring back ROCm/HIP support**

**Checklist**

- [x] Package was built and tested against unstable
  • Loading branch information
GZGavinZhao committed Apr 7, 2024
2 parents 2b03ae7 + 773bbfc commit 333891e
Show file tree
Hide file tree
Showing 200 changed files with 252,206 additions and 149,402 deletions.
11 changes: 6 additions & 5 deletions packages/b/blender/abi_used_symbols
Original file line number Diff line number Diff line change
Expand Up @@ -1505,13 +1505,11 @@ libjack.so.0:jack_transport_locate
libjack.so.0:jack_transport_query
libjack.so.0:jack_transport_start
libjack.so.0:jack_transport_stop
libjemalloc.so.2:_ZdaPv
libjemalloc.so.2:_ZdlPvSt11align_val_t
libjemalloc.so.2:_ZnwmRKSt9nothrow_t
libjemalloc.so.2:_ZdlPv
libjemalloc.so.2:calloc
libjemalloc.so.2:free
libjemalloc.so.2:malloc_usable_size
libjemalloc.so.2:memalign
libjemalloc.so.2:realloc
libjpeg.so.8:jpeg_CreateCompress
libjpeg.so.8:jpeg_CreateDecompress
libjpeg.so.8:jpeg_abort_decompress
Expand Down Expand Up @@ -1831,8 +1829,8 @@ libosdGPU.so.3.6.0:_ZN10OpenSubdiv6v3_6_03Osd14GLVertexBufferD1Ev
libosdGPU.so.3.6.0:_ZN10OpenSubdiv6v3_6_03Osd21GLSLPatchShaderSource25GetPatchBasisShaderSourceB5cxx11Ev
libosdGPU.so.3.6.0:_ZNK10OpenSubdiv6v3_6_03Osd14GLVertexBuffer14GetNumVerticesEv
liboslcomp.so.1.12:_ZN9OSL_v1_1211OSLCompiler7compileEN16OpenImageIO_v2_517basic_string_viewIcSt11char_traitsIcEEERKSt6vectorINSt7__cxx1112basic_stringIcS4_SaIcEEESaISA_EES5_
liboslcomp.so.1.12:_ZN9OSL_v1_1211OSLCompilerC1EPN16OpenImageIO_v2_512ErrorHandlerE
liboslcomp.so.1.12:_ZN9OSL_v1_1211OSLCompilerD1Ev
liboslexec.so.1.12:_ZN9OSL_v1_1211OSLCompilerC1EPN16OpenImageIO_v2_512ErrorHandlerE
liboslexec.so.1.12:_ZN9OSL_v1_1213ShadingSystem11get_contextEPNS_13PerThreadInfoEPN16OpenImageIO_v2_513TextureSystem9PerthreadE
liboslexec.so.1.12:_ZN9OSL_v1_1213ShadingSystem14ConnectShadersEN16OpenImageIO_v2_517basic_string_viewIcSt11char_traitsIcEEES5_S5_S5_
liboslexec.so.1.12:_ZN9OSL_v1_1213ShadingSystem14ShaderGroupEndEv
Expand Down Expand Up @@ -2474,9 +2472,12 @@ libstdc++.so.6:_ZTv0_n24_NSoD0Ev
libstdc++.so.6:_ZTv0_n24_NSoD1Ev
libstdc++.so.6:_ZTv0_n24_NSt13basic_fstreamIcSt11char_traitsIcEED0Ev
libstdc++.so.6:_ZTv0_n24_NSt13basic_fstreamIcSt11char_traitsIcEED1Ev
libstdc++.so.6:_ZdaPv
libstdc++.so.6:_ZdlPv
libstdc++.so.6:_ZdlPvSt11align_val_t
libstdc++.so.6:_Znam
libstdc++.so.6:_Znwm
libstdc++.so.6:_ZnwmRKSt9nothrow_t
libstdc++.so.6:__cxa_allocate_exception
libstdc++.so.6:__cxa_bad_cast
libstdc++.so.6:__cxa_bad_typeid
Expand Down
11 changes: 7 additions & 4 deletions packages/b/blender/package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name : blender
version : 4.1.0
release : 83
release : 84
source :
- https://download.blender.org/source/blender-4.1.0.tar.xz : dc002d82e3c340c93855c6684730d01801b669a29b1cc6b75eeb990ba69e723f
- https://download.blender.org/demo/test/BMW27.blend.zip : 08170de260488c14855a13db81c8d5ad844bc6162c3db13e1d9ba8094f55fe2b
Expand Down Expand Up @@ -52,14 +52,17 @@ builddeps :
- opensubdiv-devel
- openvdb-devel
- potrace-devel
- rocm-hip-devel
- rocm-hip
rundeps :
- opencollada
- rocm-runtime
- rocm-clr
clang : yes
environment: |
export ROCM_PATH=/usr
export HIP_PATH=/usr
# ROCm's LLVM fork has a bug that causes memory access
# fault when rendering the classroom example with cycles.
export HIP_CLANG_PATH=/usr/bin
export DEVICE_LIB_PATH=/usr/lib64/amdgcn/bitcode
setup : |
%cmake_ninja \
Expand Down Expand Up @@ -91,7 +94,7 @@ setup : |
-DWITH_SYSTEM_LZO=ON \
-DWITH_USD=ON \
-DWITH_X11_XINPUT=ON \
-DCYCLES_HIP_BINARIES_ARCH="%AMDGPUTARGETS%;gfx90c;gfx902;gfx1011;gfx1012;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1103"
-DCYCLES_HIP_BINARIES_ARCH="gfx803;gfx900;gfx902;gfx904;gfx906;gfx908;gfx90a;gfx90c;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103"
build : |
%ninja_build
install : |
Expand Down
11 changes: 6 additions & 5 deletions packages/b/blender/pspec_x86_64.xml
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx1010.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx1011.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx1012.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx1013.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx1030.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx1031.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx1032.fatbin</Path>
Expand All @@ -744,10 +745,10 @@
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx803.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx900.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx902.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx906:xnack-.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx908:xnack-.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx90a:xnack+.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx90a:xnack-.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx904.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx906.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx908.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx90a.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/lib/kernel_gfx90c.fatbin</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/license/Apache2-license.txt</Path>
<Path fileType="data">/usr/share/blender/4.1/scripts/addons/cycles/license/BSD-3-Clause-license.txt</Path>
Expand Down Expand Up @@ -3749,7 +3750,7 @@
</Files>
</Package>
<History>
<Update release="83">
<Update release="84">
<Date>2024-04-01</Date>
<Version>4.1.0</Version>
<Comment>Packaging update</Comment>
Expand Down
6 changes: 6 additions & 0 deletions packages/c/composable-kernel/abi_libs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
libck_device_contraction_operations.so.1
libck_device_conv_operations.so.1
libck_device_gemm_operations.so.1
libck_device_other_operations.so.1
libck_device_reduction_operations.so.1
libck_utility.so.1

0 comments on commit 333891e

Please sign in to comment.