From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EB8DA138334 for ; Mon, 24 Sep 2018 06:34:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9B776E091A; Mon, 24 Sep 2018 06:34:47 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5F989E091A for ; Mon, 24 Sep 2018 06:34:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A26B7335CCA for ; Mon, 24 Sep 2018 06:34:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 246633B2 for ; Mon, 24 Sep 2018 06:34:42 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1537770054.5ee30ef790d2a621dda91db7c7989ecc0196df71.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: games-util/gamemode/, profiles/features/selinux/ X-VCS-Repository: repo/gentoo X-VCS-Files: games-util/gamemode/Manifest games-util/gamemode/gamemode-1.2.ebuild games-util/gamemode/gamemode-9999.ebuild games-util/gamemode/metadata.xml profiles/features/selinux/package.mask X-VCS-Directories: games-util/gamemode/ profiles/features/selinux/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 5ee30ef790d2a621dda91db7c7989ecc0196df71 X-VCS-Branch: master Date: Mon, 24 Sep 2018 06:34:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: efcd7b51-88b7-417b-85b3-ff53fedc9014 X-Archives-Hash: 9dcd485fbf1cbf166d6c219edd654bfc commit: 5ee30ef790d2a621dda91db7c7989ecc0196df71 Author: Kai Krakow kaishome de> AuthorDate: Sun Aug 26 16:17:14 2018 +0000 Commit: Michał Górny gentoo org> CommitDate: Mon Sep 24 06:20:54 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ee30ef7 games-util/gamemode: New ebuild suggestion GameMode from Feral Interactive is a systemd daemon allowing games to adjust the system to performance mode. It is supported by newer Feral titles and also supports other games by preloading a lib. Closes: https://bugs.gentoo.org/652906 Package-Manager: Portage-2.3.40, Repoman-2.3.9 Signed-off-by: Kai Krakow kaishome.de> Co-authored-by: Mike Lothian fireburn.co.uk> Co-authored-by: Erik Badman yahoo.com> Signed-off-by: Michał Górny gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/9700 games-util/gamemode/Manifest | 1 + games-util/gamemode/gamemode-1.2.ebuild | 102 +++++++++++++++++++++++++++++++ games-util/gamemode/gamemode-9999.ebuild | 102 +++++++++++++++++++++++++++++++ games-util/gamemode/metadata.xml | 16 +++++ profiles/features/selinux/package.mask | 1 + 5 files changed, 222 insertions(+) diff --git a/games-util/gamemode/Manifest b/games-util/gamemode/Manifest new file mode 100644 index 00000000000..9efa7de80bd --- /dev/null +++ b/games-util/gamemode/Manifest @@ -0,0 +1 @@ +DIST gamemode-1.2.tar.xz 38536 BLAKE2B af39b8c0585c522afa72238b8332a6a5301d36b3c53e50652a78c41788eae9f5cb319cad06eaf6f345c50f934e188df4c78d70efbad919dd6897d3350d14e568 SHA512 233602e5e93b6cfcc742510dafb00dc826000d0c8618a693e9a579dc3b31c546d22c0545084cfb78c6085226e6b0e26c066078bc1871d36d5fb90828cf63cea9 diff --git a/games-util/gamemode/gamemode-1.2.ebuild b/games-util/gamemode/gamemode-1.2.ebuild new file mode 100644 index 00000000000..6ac471006aa --- /dev/null +++ b/games-util/gamemode/gamemode-1.2.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +MULTILIB_COMPAT=( abi_x86_{32,64} ) + +inherit meson multilib-minimal ninja-utils user + +DESCRIPTION="Optimise Linux system performance on demand" +HOMEPAGE="https://github.com/FeralInteractive/gamemode" + +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://github.com/FeralInteractive/gamemode.git" + GAMEMODE_GIT_PTR="master" + inherit git-r3 +else + GAMEMODE_GIT_PTR="${PV}" + SRC_URI="https://github.com/FeralInteractive/gamemode/releases/download/${GAMEMODE_GIT_PTR}/${P}.tar.xz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="BSD" +SLOT="0" +IUSE="" + +RDEPEND=" + >=sys-apps/systemd-236[${MULTILIB_USEDEP}] +" +DEPEND="${RDEPEND}" + +pkg_pretend() { + elog + elog "GameMode needs a kernel capable of SCHED_ISO to use its soft realtime" + elog "feature. Examples of kernels providing that are sys-kernel/ck-source" + elog "and sys-kernel/pf-sources." + elog + elog "Support for soft realtime is completely optional. It may provide the" + elog "following benefits with systems having at least four CPU cores:" + elog + elog " * more CPU shares allocated exclusively to the game" + elog " * reduced input lag and reduced thread latency" + elog " * more consistent frame times resulting in less microstutters" + elog + elog "You probably won't benefit from soft realtime mode and thus don't need" + elog "SCHED_ISO if:" + elog + elog " * Your CPU has less than four cores because the game may experience" + elog " priority inversion with the graphics driver (thus heuristics" + elog " automatically disable SCHED_ISO usage then)" + elog " * Your game uses busy-loops to interface with the graphics driver" + elog " but you may still force SCHED_ISO per configuation file, YMMV," + elog " it depends on the graphics driver implementation, i.e. usage of" + elog " __GL_THREADED_OPTIMIZATIONS or similar." + elog " * If your game causes more than 70% CPU usage across all cores," + elog " SCHED_ISO automatically turns off and on depending on usage and" + elog " is processed with higher-than-normal priority then (renice)." + elog " This auto-switching may result in a lesser game experience." + elog + elog "For more info look at:" + elog "https://github.com/FeralInteractive/gamemode/blob/${GAMEMODE_GIT_PTR}/README.md" + elog +} + +multilib_src_configure() { + local myconf=() + if ! multilib_is_native_abi; then + myconf+=( + -Dwith-examples=false + -Dwith-daemon=false + ) + fi + meson_src_configure "${myconf[@]}" +} + +multilib_src_compile() { + eninja +} + +multilib_src_install() { + DESTDIR="${D}" eninja install + insinto /etc/security/limits.d + newins - 45-gamemode.conf <<-EOF + @gamemode - nice -10 + EOF +} + +pkg_postinst() { + enewgroup gamemode + + elog + elog "GameMode can renice your games. You need to be in the gamemode group for this to work." + elog "Run the following command as root to add your user:" + elog "# gpasswd -a USER gamemode # with USER = your user name" + elog + + elog "Enable and start the daemon in your systemd user instance, then add" + elog "LD_PRELOAD=\$LD_PRELOAD:/usr/\$LIB/libgamemodeauto.so %command%" + elog "to the start options of any steam game to enable the performance" + elog "governor as you start the game." + elog +} diff --git a/games-util/gamemode/gamemode-9999.ebuild b/games-util/gamemode/gamemode-9999.ebuild new file mode 100644 index 00000000000..6ac471006aa --- /dev/null +++ b/games-util/gamemode/gamemode-9999.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +MULTILIB_COMPAT=( abi_x86_{32,64} ) + +inherit meson multilib-minimal ninja-utils user + +DESCRIPTION="Optimise Linux system performance on demand" +HOMEPAGE="https://github.com/FeralInteractive/gamemode" + +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://github.com/FeralInteractive/gamemode.git" + GAMEMODE_GIT_PTR="master" + inherit git-r3 +else + GAMEMODE_GIT_PTR="${PV}" + SRC_URI="https://github.com/FeralInteractive/gamemode/releases/download/${GAMEMODE_GIT_PTR}/${P}.tar.xz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="BSD" +SLOT="0" +IUSE="" + +RDEPEND=" + >=sys-apps/systemd-236[${MULTILIB_USEDEP}] +" +DEPEND="${RDEPEND}" + +pkg_pretend() { + elog + elog "GameMode needs a kernel capable of SCHED_ISO to use its soft realtime" + elog "feature. Examples of kernels providing that are sys-kernel/ck-source" + elog "and sys-kernel/pf-sources." + elog + elog "Support for soft realtime is completely optional. It may provide the" + elog "following benefits with systems having at least four CPU cores:" + elog + elog " * more CPU shares allocated exclusively to the game" + elog " * reduced input lag and reduced thread latency" + elog " * more consistent frame times resulting in less microstutters" + elog + elog "You probably won't benefit from soft realtime mode and thus don't need" + elog "SCHED_ISO if:" + elog + elog " * Your CPU has less than four cores because the game may experience" + elog " priority inversion with the graphics driver (thus heuristics" + elog " automatically disable SCHED_ISO usage then)" + elog " * Your game uses busy-loops to interface with the graphics driver" + elog " but you may still force SCHED_ISO per configuation file, YMMV," + elog " it depends on the graphics driver implementation, i.e. usage of" + elog " __GL_THREADED_OPTIMIZATIONS or similar." + elog " * If your game causes more than 70% CPU usage across all cores," + elog " SCHED_ISO automatically turns off and on depending on usage and" + elog " is processed with higher-than-normal priority then (renice)." + elog " This auto-switching may result in a lesser game experience." + elog + elog "For more info look at:" + elog "https://github.com/FeralInteractive/gamemode/blob/${GAMEMODE_GIT_PTR}/README.md" + elog +} + +multilib_src_configure() { + local myconf=() + if ! multilib_is_native_abi; then + myconf+=( + -Dwith-examples=false + -Dwith-daemon=false + ) + fi + meson_src_configure "${myconf[@]}" +} + +multilib_src_compile() { + eninja +} + +multilib_src_install() { + DESTDIR="${D}" eninja install + insinto /etc/security/limits.d + newins - 45-gamemode.conf <<-EOF + @gamemode - nice -10 + EOF +} + +pkg_postinst() { + enewgroup gamemode + + elog + elog "GameMode can renice your games. You need to be in the gamemode group for this to work." + elog "Run the following command as root to add your user:" + elog "# gpasswd -a USER gamemode # with USER = your user name" + elog + + elog "Enable and start the daemon in your systemd user instance, then add" + elog "LD_PRELOAD=\$LD_PRELOAD:/usr/\$LIB/libgamemodeauto.so %command%" + elog "to the start options of any steam game to enable the performance" + elog "governor as you start the game." + elog +} diff --git a/games-util/gamemode/metadata.xml b/games-util/gamemode/metadata.xml new file mode 100644 index 00000000000..05078a2e782 --- /dev/null +++ b/games-util/gamemode/metadata.xml @@ -0,0 +1,16 @@ + + + + + hurikhan77+bgo@gmail.com + Kai Krakow + + + proxy-maint@gentoo.org + Proxy Maintainers + + + https://github.com/FeralInteractive/gamemode/issues + FeralInteractive/gamemode + + diff --git a/profiles/features/selinux/package.mask b/profiles/features/selinux/package.mask index 370aa149e56..0cd856701fd 100644 --- a/profiles/features/selinux/package.mask +++ b/profiles/features/selinux/package.mask @@ -45,3 +45,4 @@ sys-apps/dbus-broker >=app-admin/abrt-2.10 app-admin/gnome-abrt >=dev-libs/libreport-2.9 +games-util/gamemode