View previous topic :: View next topic |
Author |
Message |
szatox Advocate
Joined: 27 Aug 2013 Posts: 3491
|
Posted: Sun Mar 26, 2023 6:45 pm Post subject: |
|
|
Gratz!
Any idea how many people use it? Do you have e.g. a download counter on your repo? I'm curious. |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
antonellocaroli Guru
Joined: 11 Aug 2016 Posts: 513
|
Posted: Wed May 24, 2023 5:27 am Post subject: |
|
|
Hi,
for the realtime kernel and nvidia drivers, the following ebuild might work:
Code: | # Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MODULES_OPTIONAL_USE="driver"
inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
systemd toolchain-funcs unpacker user-info
NV_KERNEL_MAX="6.3"
NV_URI="https://download.nvidia.com/XFree86/"
DESCRIPTION="NVIDIA Accelerated Graphics Driver"
HOMEPAGE="https://www.nvidia.com/download/index.aspx"
SRC_URI="
amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
$(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz"
# nvidia-installer is unused but here for GPL-2's "distribute sources"
S="${WORKDIR}"
LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl"
SLOT="0/${PV%%.*}"
KEYWORDS="-* ~amd64 ~arm64"
IUSE="+X abi_x86_32 abi_x86_64 +driver kernel-open persistenced +static-libs +tools wayland"
REQUIRED_USE="kernel-open? ( driver )"
COMMON_DEPEND="
acct-group/video
sys-libs/glibc
X? ( x11-libs/libpciaccess )
persistenced? (
acct-user/nvpd
net-libs/libtirpc:=
)
tools? (
>=app-accessibility/at-spi2-core-2.46:2
dev-libs/glib:2
dev-libs/jansson:=
media-libs/harfbuzz:=
x11-libs/cairo
x11-libs/gdk-pixbuf:2
x11-libs/gtk+:3[X]
x11-libs/libX11
x11-libs/libXext
x11-libs/libXxf86vm
x11-libs/pango
)"
RDEPEND="
${COMMON_DEPEND}
X? (
media-libs/libglvnd[X,abi_x86_32(-)?]
x11-libs/libX11[abi_x86_32(-)?]
x11-libs/libXext[abi_x86_32(-)?]
)
wayland? (
gui-libs/egl-gbm
>=gui-libs/egl-wayland-1.1.10
media-libs/libglvnd
)"
DEPEND="
${COMMON_DEPEND}
static-libs? (
x11-libs/libX11
x11-libs/libXext
)
tools? (
media-libs/libglvnd
sys-apps/dbus
x11-base/xorg-proto
x11-libs/libXrandr
x11-libs/libXv
x11-libs/libvdpau
)"
BDEPEND="
sys-devel/m4
virtual/pkgconfig"
QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
PATCHES=(
"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
)
pkg_setup() {
use driver || return
local CONFIG_CHECK="
PROC_FS
~DRM_KMS_HELPER
~SYSVIPC
~!LOCKDEP
~!SLUB_DEBUG_ON
~!X86_KERNEL_IBT
!DEBUG_MUTEXES"
local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection
of drivers (no custom config), and for wayland / nvidia-drm.modeset=1.
Cannot be directly selected in the kernel's menuconfig, and may need
selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or
DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in."
local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set, be warned the modules may not load.
If run into problems, either unset or try to pass ibt=off to the kernel."
use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827
local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open.
Cannot be directly selected in the kernel's menuconfig, and may need
selection of another option that requires it such as CONFIG_KVM."
MODULE_NAMES="
nvidia(video:kernel)
nvidia-drm(video:kernel)
nvidia-modeset(video:kernel)
nvidia-peermem(video:kernel)
nvidia-uvm(video:kernel)"
use kernel-open &&
MODULE_NAMES=${MODULE_NAMES//:kernel/:kernel-module-source:kernel-module-source/kernel-open}
linux-mod_pkg_setup
[[ ${MERGE_TYPE} == binary ]] && return
# do some extra checks manually as it gets messy to handle builtin-only
# and some other conditional checks through CONFIG_CHECK
# TODO?: maybe move other custom checks here for uniformity
local warn=()
if linux_chkconfig_builtin DRM_NOUVEAU; then
# suggest =m given keeps KMS_HELPER enabled and can serve as fallback
warn+=(
" CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA"
" modules (can be safely kept as a module (=m) instead)."
)
fi
if linux_chkconfig_builtin DRM_SIMPLEDRM; then
# wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its
# configs (bug #840439), but without Fedora's kernel patch to
# workaround this issue (which is unlikely to work for us anyway)
# https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228
warn+=(
" CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA"
" (i.e. blanks when X/wayland starts, and tty loses display)."
" For prebuilt kernels, unfortunately no known good workarounds."
)
fi
if ! linux_chkconfig_present FB_EFI &&
! linux_chkconfig_present FB_SIMPLE &&
! linux_chkconfig_present FB_VESA
then
# nvidia-drivers does not handle the tty (beside mode restoration) but,
# given few options are viable, try to warn if all missing
warn+=(
" CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is normally"
" needed to get a display for the tty console. In most cases, it is"
" recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)."
" Non-EFI systems are likely to want FB_VESA=y. Users with multiple GPUs"
" or not using the tty may be able to safely ignore this warning."
)
fi
if kernel_is -ge 5 18 13; then
if linux_chkconfig_present FB_SIMPLE; then
warn+=(
" CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI or"
" FB_VESA as it currently may be broken with >=kernel-5.18.13 + NVIDIA:"
" https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341"
" (feel free to ignore this if it works for you)"
)
fi
if linux_chkconfig_present SYSFB_SIMPLEFB &&
{ linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; }
then
warn+=(
" CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA"
" from providing a working tty console display (ignore if unused)."
)
fi
fi
(( ${#warn[@]} )) &&
ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}"
BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"'
#if use rt; then
# BUILD_PARAMS='IGNORE_PREEMPT_RT_PRESENCE=1 '${BUILD_PARAMS}
#fi
if [ -f "/usr/src/linux/Makefile" ]; then
if grep -q "\-rt" /usr/src/linux/Makefile; then
BUILD_PARAMS='IGNORE_PREEMPT_RT_PRESENCE=1 '${BUILD_PARAMS}
fi
fi
BUILD_TARGETS="modules"
# Try to match toolchain with kernel only for modules
# (experimental, ideally this should be handled in linux-mod.eclass)
nvidia-tc-set() {
local -n var=KERNEL_${1}
if [[ ! -v var ]]; then
read -r var < <(type -P "${@:2}") ||
die "failed to find in PATH at least one of: ${*:2}"
einfo "Forcing '${var}' for modules (set ${!var} to override)"
fi
}
local tool switch
if linux_chkconfig_present CC_IS_GCC; then
if ! tc-is-gcc; then
switch=
nvidia-tc-set CC {${CHOST}-,}gcc
nvidia-tc-set CXX {${CHOST}-,}g++ # needed by kernel-open
fi
elif linux_chkconfig_present CC_IS_CLANG; then
ewarn "Warning: using ${PN} with a clang-built kernel is largely untested"
if ! tc-is-clang; then
switch=llvm-
nvidia-tc-set CC {${CHOST}-,}clang
nvidia-tc-set CXX {${CHOST}-,}clang++
fi
fi
if linux_chkconfig_present LD_IS_BFD; then
# tc-ld-is-bfd needs https://github.com/gentoo/gentoo/pull/28355
[[ $(LC_ALL=C $(tc-getLD) --version 2>/dev/null) == "GNU ld"* ]] ||
nvidia-tc-set LD {${CHOST}-,}{ld.bfd,ld}
elif linux_chkconfig_present LD_IS_LLD; then
tc-ld-is-lld || nvidia-tc-set LD {${CHOST}-,}{ld.lld,lld}
fi
if [[ -v switch ]]; then
# only need llvm-nm for lto, but use complete set to be safe
for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do
case $(LC_ALL=C $(tc-get${tool}) --version 2>/dev/null) in
LLVM*|llvm*) [[ ! ${switch} ]];;
*) [[ ${switch} ]];;
esac && nvidia-tc-set ${tool} {${CHOST}-,}${switch}${tool,,}
done
fi
# pass unconditionally given exports are semi-ignored except CC/LD
for tool in CC CXX LD AR NM OBJCOPY OBJDUMP READELF STRIP; do
BUILD_PARAMS+=" ${tool}=\"\${KERNEL_${tool}:-\$(tc-get${tool})}\""
done
if linux_chkconfig_present LTO_CLANG_THIN; then
# kernel enables cache by default leading to sandbox violations
BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
fi
if kernel_is -gt ${NV_KERNEL_MAX/./ }; then
ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}"
ewarn "or was not tested with it. It is recommended to use one of:"
ewarn " <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}.x"
ewarn " <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}.x"
ewarn "You are free to try or use /etc/portage/patches, but support will"
ewarn "not be given and issues wait until NVIDIA releases a fixed version"
ewarn "(Gentoo will not accept patches for this)."
ewarn
ewarn "Do _not_ file a bug report if run into issues."
ewarn
fi
}
src_prepare() {
# make patches usable across versions
rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
rm nvidia-settings && mv nvidia-settings{-${PV},} || die
rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
default
# prevent detection of incomplete kernel DRM support (bug #603818)
sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \
-i kernel{,-module-source/kernel-open}/conftest.sh || die
# adjust service files
sed 's/__USER__/nvpd/' \
nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
> "${T}"/nvidia-persistenced.service || die
use !amd64 || sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die
# enable nvidia-drm.modeset=1 by default with USE=wayland
cp "${FILESDIR}"/nvidia-470.conf "${T}"/nvidia.conf || die
use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die
# makefile attempts to install wayland library even if not built
use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
nvidia-settings/src/Makefile || die
# temporary option, nvidia will remove in the future
use !kernel-open ||
sed -i '/blacklist/a\
\
# Enable using kernel-open with workstation GPUs (experimental)\
options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die
}
src_compile() {
tc-export AR CC CXX LD OBJCOPY OBJDUMP
local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch
local xnvflags=-fPIC #840389
# lto static libraries tend to cause problems without fat objects
is-flagq '-flto@(|=*)' && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
NV_ARGS=(
PREFIX="${EPREFIX}"/usr
HOST_CC="$(tc-getBUILD_CC)"
HOST_LD="$(tc-getBUILD_LD)"
BUILD_GTK2LIB=
NV_USE_BUNDLED_LIBJANSSON=0
NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
WAYLAND_AVAILABLE=$(usex wayland 1 0)
XNVCTRL_CFLAGS="${xnvflags}"
)
if use driver; then
if linux_chkconfig_present GCC_PLUGINS; then
mkdir "${T}"/plugin-test || die
echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die
:> "${T}"/plugin-test/test.c || die
if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \
HOSTCC="$(tc-getBUILD_CC)" CC="${CC}" M="${T}"/plugin-test 2>&1) \
=~ "error: incompatible gcc/plugin version" ]]
then
eerror "Detected kernel was built with a different gcc/plugin version,"
eerror "Please 'make clean' and rebuild your kernel with the current"
eerror "gcc (or re-emerge for distribution kernels, including kernel-bin)."
die "kernel ${KV_FULL} needs to be rebuilt"
fi
fi
local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS}
if use kernel-open; then
# building the nvidia "blob" fails with lto, and also need
# to strip in case of a different toolchain for the kernel
filter-lto
strip-unsupported-flags
fi
linux-mod_src_compile
CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags}
fi
emake "${NV_ARGS[@]}" -C nvidia-modprobe
use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
if use tools; then
# cflags: avoid noisy logs, only use here and set first to let override
CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
emake "${NV_ARGS[@]}" -C nvidia-settings
elif use static-libs; then
# pretend GTK+3 is available, not actually used (bug #880879)
emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \
-C nvidia-settings/src out/libXNVCtrl.a
fi
}
src_install() {
local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
local -A paths=(
[APPLICATION_PROFILE]=/usr/share/nvidia
[CUDA_ICD]=/etc/OpenCL/vendors
[EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
[FIRMWARE]=/lib/firmware/nvidia/${PV}
[GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm
[GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
[VULKAN_ICD_JSON]=/usr/share/vulkan
[WINE_LIB]=/usr/${libdir}/nvidia/wine
[XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
[GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
[GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules
[XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
)
local skip_files=(
# nvidia_icd/layers(vulkan): skip with -X too as it uses libGLX_nvidia
$(usev !X "
libGLX_nvidia libglxserver_nvidia
nvidia_icd.json nvidia_layers.json")
$(usev !wayland libnvidia-vulkan-producer)
libGLX_indirect # non-glvnd unused fallback
libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source
libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm
libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
)
local skip_modules=(
$(usev !X "nvfbc vdpau xdriver")
$(usev !driver gsp)
installer nvpd # handled separately / built from source
)
local skip_types=(
GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
OPENCL_WRAPPER.\* # virtual/opencl
DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused
)
local DOCS=(
README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
)
local HTML_DOCS=( html/. )
einstalldocs
local DISABLE_AUTOFORMATTING=yes
local DOC_CONTENTS="\
Trusted users should be in the 'video' group to use NVIDIA devices.
You can add yourself by using: gpasswd -a my-user video\
$(usev driver "
Like all out-of-tree kernel modules, it is necessary to rebuild
${PN} after upgrading or rebuilding the Linux kernel
by for example running \`emerge @module-rebuild\`. Alternatively,
if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
this can be automated by setting USE=dist-kernel globally.
Loaded kernel modules also must not mismatch with the installed
${PN} version (excluding -r revision), meaning should
ensure \`eselect kernel list\` points to the kernel that will be
booted before building and preferably reboot after upgrading
${PN} (the ebuild will emit a warning if mismatching).
See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
$(use amd64 && usev !abi_x86_32 "
Note that without USE=abi_x86_32 on ${PN}, 32bit applications
(typically using wine / steam) will not be able to use GPU acceleration.")
For general information on using ${PN}, please see:
https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
readme.gentoo_create_doc
if use driver; then
linux-mod_src_install
insinto /etc/modprobe.d
doins "${T}"/nvidia.conf
# used for gpu verification with binpkgs (not kept, see pkg_preinst)
insinto /usr/share/nvidia
doins supported-gpus/supported-gpus.json
fi
emake "${NV_ARGS[@]}" -C nvidia-modprobe install
fowners :video /usr/bin/nvidia-modprobe #505092
fperms 4710 /usr/bin/nvidia-modprobe
if use persistenced; then
emake "${NV_ARGS[@]}" -C nvidia-persistenced install
newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
systemd_dounit "${T}"/nvidia-persistenced.service
fi
if use tools; then
emake "${NV_ARGS[@]}" -C nvidia-settings install
doicon nvidia-settings/doc/nvidia-settings.png
domenu nvidia-settings/doc/nvidia-settings.desktop
exeinto /etc/X11/xinit/xinitrc.d
newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
fi
if use static-libs; then
dolib.a nvidia-settings/src/out/libXNVCtrl.a
insinto /usr/include/NVCtrl
doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
fi
use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
# mimic nvidia-installer by reading .manifest to install files
# 0:file 1:perms 2:type 3+:subtype/arguments -:module
local m into
while IFS=' ' read -ra m; do
! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
[[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
[[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
case ${m[2]} in
MANPAGE)
gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert
continue
;;
GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../
VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
esac
if [[ -v paths[${m[2]}] ]]; then
into=${paths[${m[2]}]}
elif [[ ${m[2]} =~ _BINARY$ ]]; then
into=/opt/bin
elif [[ ${m[3]} == COMPAT32 ]]; then
use abi_x86_32 || continue
into=/usr/${libdir32}
elif [[ ${m[2]} =~ _LIB$|_SYMLINK$ ]]; then
into=/usr/${libdir}
else
die "No known installation path for ${m[0]}"
fi
[[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
[[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
if [[ ${m[2]} =~ _SYMLINK$ ]]; then
[[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
dosym ${m[4]} ${into}/${m[0]}
continue
fi
[[ ${m[0]} =~ ^libnvidia-ngx.so|^libnvidia-egl-gbm.so ]] &&
dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest
printf -v m[1] %o $((m[1] | 0200)) # 444->644
insopts -m${m[1]}
insinto ${into}
doins ${m[0]}
done < .manifest || die
# MODULE:installer non-skipped extras
: "$(systemd_get_sleepdir)"
exeinto "${_#"${EPREFIX}"}"
doexe systemd/system-sleep/nvidia
dobin systemd/nvidia-sleep.sh
systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service
dobin nvidia-bug-report.sh
# MODULE:powerd extras
if use amd64; then
systemd_dounit systemd/system/nvidia-powerd.service
insinto /usr/share/dbus-1/system.d
doins nvidia-dbus.conf
fi
# symlink non-versioned so nvidia-settings can use it even if misdetected
dosym nvidia-application-profiles-${PV}-key-documentation \
${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
# don't attempt to strip firmware files (silences errors)
dostrip -x ${paths[FIRMWARE]}
}
pkg_preinst() {
has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND=
use driver || return
linux-mod_pkg_preinst
# set video group id based on live system (bug #491414)
local g=$(egetent group video | cut -d: -f3)
[[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
# try to find driver mismatches using temporary supported-gpus.json
for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
"${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
if [[ ${g} ]]; then
g=$((${g##*\"}+1))
if ver_test -ge ${g}; then
NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
break
fi
fi
done
rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
}
pkg_postinst() {
linux-mod_pkg_postinst
readme.gentoo_print_elog
if [[ -r /proc/driver/nvidia/version &&
$(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
ewarn "Currently loaded NVIDIA modules do not match the newly installed"
ewarn "libraries and may prevent launching GPU-accelerated applications."
use driver && ewarn "The easiest way to fix this is usually to reboot."
fi
if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
ewarn "Detected that the current kernel command line is using 'slub_debug=',"
ewarn "this may lead to system instability/freezes with this version of"
ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
fi
if [[ -v NV_LEGACY_MASK ]]; then
ewarn
ewarn "***WARNING***"
ewarn
ewarn "You are installing a version of ${PN} known not to work"
ewarn "with a GPU of the current system. If unwanted, add the mask:"
if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
else
ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
fi
ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions"
ewarn "are available or fully functional, may need to consider nouveau[2])."
ewarn "[1] https://www.nvidia.com/object/IO_32667.html"
ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
fi
if use kernel-open; then
ewarn
ewarn "Open source variant of ${PN} was selected, be warned it is experimental"
ewarn "and only usable with Turing / Ampere and later GPUs, aka GTX 1650+."
ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html"
ewarn
ewarn "Many features are not yet implemented in the drivers and limitations are"
ewarn "to be expected. Please do not report non-build/packaging bugs to Gentoo."
ewarn "Switch back to USE=-kernel-open to restore functionality if needed for now."
fi
if use wayland && use driver && [[ ! -v NV_HAD_WAYLAND ]]; then
elog
elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1"
elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered"
elog "experimental but is required for wayland."
elog
elog "If you experience issues, either disable wayland or edit nvidia.conf."
elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
fi
}
|
Code: | if [ -f "/usr/src/linux/Makefile" ]; then
if grep -q "\-rt" /usr/src/linux/Makefile; then
BUILD_PARAMS='IGNORE_PREEMPT_RT_PRESENCE=1 '${BUILD_PARAMS}
fi
fi |
or
Code: | IUSE="+X abi_x86_32 abi_x86_64 +driver kernel-open persistenced +static-libs +tools wayland rt" |
Code: | if use rt; then
BUILD_PARAMS='IGNORE_PREEMPT_RT_PRESENCE=1 '${BUILD_PARAMS}
fi |
|
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3999
|
Posted: Thu Jun 15, 2023 4:30 pm Post subject: |
|
|
audiodef wrote: | I've been looking for plugins and software to add to the repo and to the install tarball.
Here are two recently added:
Airwindows
Airwindows is a huge collection of VST2 plugins. I've checked out the Galactic 2 space reverb plugin. I love it.
Argotlunar
Argotlunar is a tool for creating surreal transformations of audio streams. Specifically, it is a real-time delay-line granulator. I've played with it briefly and found it quite interesting. |
Is argotlunar-2.06 file in link really required?
Thks 4 ur attention, interest & support _________________ USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Last edited by CaptainBlood on Thu Jun 15, 2023 4:52 pm; edited 1 time in total |
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3999
|
Posted: Thu Jun 15, 2023 4:51 pm Post subject: |
|
|
airwindows requires Code: | DIST LinuxVSTs.zip... | line removal for recalculation through ebuild ... digest here...
Alternatively replacing the line with Code: | DIST LinuxVSTs.zip 10512405 BLAKE2B 24b38f29df7e5da14d027993f08ad078a034ba8b0642885969960c48ea7341c5eb03e1088fd73a6ae427f2237a2ba3699ed416d055edd93122e239ef93317d1c SHA512 ab5412b4d2c5f40f6e1c5488d1886569747e9a2671bcec8e8f44a5e24fdec48e15ea84020074520202001368a76a40481fb35488f8233de0ba53fe434d6d7d76 | just did the trick here.
Thks 4 ur attention, interest & support _________________ USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. " |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 2113
|
Posted: Fri Jun 16, 2023 9:08 pm Post subject: |
|
|
File bugs for the relevant packages to start using /usr/lib? |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
Posted: Sat Jun 17, 2023 6:03 pm Post subject: |
|
|
Just thinking out loud here...
By default, Gentoo installs LV2 plugins into /usr/lib64/lv2. I've only recently noticed that Ardour is not scanning this dir, even if I set LV2_PATH to include it. A quick and dirty test to place something from /usr/lib64/lv2 into /usr/lib/lv2 results in Ardour successfully scanning it, but unable to load the plugin.
Some initial thoughts on things to explore here:
las on #ardour has said LV2_PATH is supposed to override Ardour's internal mechanism, but I've been unable to make this work. There may be other things in the way here.
Changing /usr/lib64/pkgconfig/lv2.pc to point to /usr/lib/lv2 doesn't seem to change anything, with or without re-emerging a test package.
Someone pointed out media-libs/lilv may be overriding Ardour's internal custom version of it, but unmerging lilv didn't change anything.
Putting x42-plugins into the GentooStudio repo and changing the install path DID work, for this package. The default install location as set in the main tree's version does not allow Ardour to scan or use it.
The apparent standard for installing LV2 appears to be defined here: https://lv2plug.in/pages/filesystem-hierarchy-standard.html
According to conversations with others, other Linux platforms adhere to this.
So... not to be a downer but all this presents a problem that I consider a major roadblock to the continued existence of Gentoo Studio. If plugins can be successfully installed but ignored by one of the major Linux-friendly DAWs out there when running on Gentoo (but not on other Linux distros) then perhaps we should think about how to continue with Gentoo Studio.
Anyway... it's just a thought. I would love for there to be a good solution to this. _________________ decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3491
|
Posted: Sat Jun 17, 2023 6:17 pm Post subject: |
|
|
Quote: | A quick and dirty test to place something from /usr/lib64/lv2 into /usr/lib/lv2 results in Ardour successfully scanning it, but unable to load the plugin. |
Would a symlink work?
/usr/lib/lv2 -> /usr/lib64/lv2 |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 2113
|
Posted: Sun Jun 18, 2023 4:58 am Post subject: |
|
|
I'm still not getting why we can't just change all the packages in ::gentoo to use /usr/lib. That should be fine, we've done it for other software like this in the past. https://lv2plug.in/pages/filesystem-hierarchy-standard.html is great justification for that, so I don't see a problem, and I'd be supportive and help get it done?
Do wonder if maybe the environment variable trick you're trying isn't working because of bug 908401 - make sure you have a newer eselect then run 'env-update' and '. /etc/profile'. |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
Posted: Sun Jun 18, 2023 12:43 pm Post subject: |
|
|
Thanks! That means a lot. I agree that for the purposes of a pro-audio Linux system, using /usr/lib would be best. But AFAIK, Gentoo went with a split between /usr/lib and /usr/lib64 to support multilib systems, which makes sense.
Since there is nothing that installs into /usr/lib/lv2 and therefore there is no /usr/lib/lv2 unless I go out of my way to make it happen, it's a lot less work to make /usr/lib/lv2 a symlink.
Maybe I should try a no multilib stage3 as a seed for a test catalyst build. I'm guessing /usr/lib would be a symlink to /usr/lib64 as I'm told it is on other distros, which would moot the necessity of a symlink or changing a lot of ebuilds. Gentoo Studio has been 64-bit only for quite a while now.
Thanks again, sam, I really appreciate the kind words.
sam_ wrote: | I'm still not getting why we can't just change all the packages in ::gentoo to use /usr/lib. That should be fine, we've done it for other software like this in the past. https://lv2plug.in/pages/filesystem-hierarchy-standard.html is great justification for that, so I don't see a problem, and I'd be supportive and help get it done?
Do wonder if maybe the environment variable trick you're trying isn't working because of bug 908401 - make sure you have a newer eselect then run 'env-update' and '. /etc/profile'. |
_________________ decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3491
|
Posted: Sun Jun 18, 2023 1:30 pm Post subject: |
|
|
Quote: | And as usual, the solution is just that simple. It's always something simple, and it's always something I don't think of. | You're welcome. I do think it is an ugly hack, but if it works, it works; it can at lest be used as a stopgap. Happy to help.
Quote: | I'm still not getting why we can't just change all the packages in ::gentoo to use /usr/lib. |
TBH I'd rather do the opposite and not replace contents of the old path. Saving /usr/lib for 32 bit stuff and putting 64 bit libs in /usr/lib64, and eventually abandoning empty /usr/lib directory looks like a cleaner progression; with fewer opportunities for mistakes/version clashes, better backwards compatibility for corner cases, etc.
Perhaps could even make switching profiles between multilib/nomultilib easy, in both directions. I know I'm very late with pointing this one out right now, with 32bit being slowly but surely phased out of existence. |
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 2113
|
Posted: Mon Jun 19, 2023 2:15 am Post subject: |
|
|
szatox wrote: | Quote: | And as usual, the solution is just that simple. It's always something simple, and it's always something I don't think of. | You're welcome. I do think it is an ugly hack, but if it works, it works; it can at lest be used as a stopgap. Happy to help.
Quote: | I'm still not getting why we can't just change all the packages in ::gentoo to use /usr/lib. |
TBH I'd rather do the opposite and not replace contents of the old path. Saving /usr/lib for 32 bit stuff and putting 64 bit libs in /usr/lib64, and eventually abandoning empty /usr/lib directory looks like a cleaner progression; with fewer opportunities for mistakes/version clashes, better backwards compatibility for corner cases, etc.
Perhaps could even make switching profiles between multilib/nomultilib easy, in both directions. I know I'm very late with pointing this one out right now, with 32bit being slowly but surely phased out of existence. |
This is what Gentoo normally does by policy (lib for 32-bit, lib64 for 64-bit), but this doesn't apply to plugins and such if a package's ecosystem is solidly rooted in another
directory (because it leads to situations like this, where you either give up, or you spend all your time patching loads of stuff and users get a terrible experience).
There's always been an exception for this case! The best example of this being Python itself: find /usr/lib/python3.*/site-packages/*/*.so.
Making such a change purely for plugins is therefore no contradiction whatsoever with our policies on multilib and respecting libdir. I wouldn't have suggested it if it were, or if it were, I would've added a very strong caveat. |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
mattst88 Developer
Joined: 28 Oct 2004 Posts: 423
|
Posted: Tue Jun 20, 2023 4:27 pm Post subject: |
|
|
No, you're massively overthinking this.
Just make pull requests. You already have support from Sam. There is no reason to expect some large opposition that necessitates all this preparation. _________________ My Wiki page |
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 2113
|
Posted: Tue Jun 20, 2023 4:48 pm Post subject: |
|
|
We track issues with packages on Bugzilla at bugs.gentoo.org. You just need to file bugs for each relevant package. Ideally you'd make github PRs or attach git am-able patches to speed up the process, but it's not strictly required. |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|