sci-misc/llama-cpp: fix hip/rocm, remove old

Signed-off-by: Sergey Alirzaev <l29ah@riseup.net>
This commit is contained in:
Sergey Alirzaev
2025-07-10 02:16:05 +02:00
parent 763af446dc
commit bd53f5db4f
4 changed files with 129 additions and 117 deletions

View File

@@ -5,7 +5,7 @@ EAPI=8
ROCM_VERSION="6.3"
inherit cmake cuda rocm
inherit cmake cuda rocm linux-info
if [[ "${PV}" != "9999" ]]; then
KEYWORDS="~amd64"
@@ -26,34 +26,15 @@ CPU_FLAGS_X86=( avx avx2 f16c )
IUSE="curl openblas blis hip cuda vulkan"
REQUIRED_USE="?? ( openblas blis )"
AMDGPU_TARGETS_COMPAT=(
gfx900
gfx90c
gfx902
gfx1010
gfx1011
gfx1012
gfx1030
gfx1031
gfx1032
gfx1034
gfx1035
gfx1036
gfx1100
gfx1101
gfx1102
gfx1103
gfx1150
gfx1151
)
# curl is needed for pulling models from huggingface
# numpy is used by convert_hf_to_gguf.py
CDEPEND="
curl? ( net-misc/curl:= )
openblas? ( sci-libs/openblas:= )
blis? ( sci-libs/blis:= )
hip? ( >=dev-util/hip-6.3:= )
hip? ( >=dev-util/hip-6.3:=
>=sci-libs/hipBLAS-6.3:=
)
cuda? ( dev-util/nvidia-cuda-toolkit:= )
"
DEPEND="${CDEPEND}
@@ -64,6 +45,18 @@ RDEPEND="${CDEPEND}
vulkan? ( media-libs/vulkan-loader )
"
pkg_setup() {
if use hip; then
linux-info_pkg_setup
if linux-info_get_any_version && linux_config_exists; then
if ! linux_chkconfig_present HSA_AMD_SVM; then
ewarn "To use ROCm/HIP, you need to have HSA_AMD_SVM option enabled in your kernel."
fi
fi
fi
}
src_prepare() {
use cuda && cuda_src_prepare