blob: 16d2d243309579d642d52f85e931aa5f74fa4801 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# Maintainer: wuxxin <wuxxin@gmail.com>
# Contributor: Amy Tobey - github.com/tobert
# Contributor: francisco1892 <admin@gnlug.org>
# Contributor: Jingbei Li <i@jingbei.li>
# Contributor: Jose Riha <jose1711 gmail com>
pkgname=python-torchaudio-rocm
_pkgname=audio
pkgver=2.11.0
pkgrel=1
pkgdesc="Data manipulation and transformation for audio signal processing, powered by PyTorch (with ROCm/HIP support)"
arch=('x86_64')
url="https://github.com/pytorch/audio"
license=('BSD')
depends=(
'python'
'python-pytorch-rocm'
'bzip2'
'xz'
'opencore-amr'
'lame'
'libogg'
'libFLAC.so'
'libvorbis'
'opus'
'opusfile'
'zlib'
)
optdepends=('python-kaldi-io')
makedepends=(
'cmake'
'ninja'
'python-setuptools'
'boost'
'rocm-hip-sdk'
'rocm-toolchain'
)
conflicts=('python-torchaudio-git' 'python-torchaudio')
provides=('python-torchaudio' "python-torchaudio=${pkgver}")
source=(
"${url}/archive/refs/tags/v${pkgver}.tar.gz"
)
sha256sums=('599ec24e7e1eef476ef21f0178e33da00e2434f930ba42e9cc20bf4002220486')
prepare() {
cd "${srcdir}/${_pkgname}-${pkgver}"
# patch -N -p 1 -i "${srcdir}"/policy_min_3.5.patch
}
build() {
cd "$srcdir/${_pkgname}-${pkgver}"
# populate build architecture list identical to pkg arch:python-pytorch
# python-pytorch 2.10.0-1: gfx950 lacks support for 128 bit atomics
_PYTORCH_ROCM_ARCH="$(rocm-supported-gfx -e gfx950)"
if test -n "$GPU_TARGETS"; then _PYTORCH_ROCM_ARCH="$GPU_TARGETS"; fi
if test -n "$AMDGPU_TARGETS"; then _PYTORCH_ROCM_ARCH="$AMDGPU_TARGETS"; fi
if test -n "$PYTORCH_ROCM_ARCH"; then _PYTORCH_ROCM_ARCH="$PYTORCH_ROCM_ARCH"; fi
export PYTORCH_ROCM_ARCH="${_PYTORCH_ROCM_ARCH}"
echo "building for PYTORCH_ROCM_ARCH=$PYTORCH_ROCM_ARCH"
# if ROCM_HOME is not set, hardcode ROCM_HOME, ROCM_PATH, HIP_ROOT_DIR to /opt/rocm
export ROCM_HOME="${ROCM_HOME:-/opt/rocm}"
export ROCM_PATH="$ROCM_HOME"
export HIP_ROOT_DIR="$ROCM_HOME"
# -fcf-protection is not supported by HIP/clang
# https://rocm.docs.amd.com/projects/llvm-project/en/latest/reference/rocmcc.html#support-status-of-other-clang-options
CXXFLAGS+=" -fcf-protection=none"
USE_ROCM=1 python setup.py build
}
package() {
cd "$srcdir/${_pkgname}-${pkgver}"
USE_ROCM=1 python setup.py install --root="$pkgdir"/ --optimize=1
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|