mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
x11/nvidia-hybrid-graphics: Optimus Technology
PR: 192617 Reported by: David Mackay <davidjx8p@gmail.com> Reviewed by: many Tested by: many Approved by: portmgr (maintainer timeout: 15 days) Differential Revision: https://reviews.freebsd.org/D22521
This commit is contained in:
parent
e529189733
commit
2ee6acf85a
21 changed files with 352 additions and 7 deletions
|
@ -13,7 +13,7 @@
|
||||||
# the port aims to support building against arbitrary DISTVERSION, i.e.
|
# the port aims to support building against arbitrary DISTVERSION, i.e.
|
||||||
# ``make DISTVERSION=xxx.yy.zz -DNO_CHECKSUM'' should typically work.
|
# ``make DISTVERSION=xxx.yy.zz -DNO_CHECKSUM'' should typically work.
|
||||||
|
|
||||||
PORTNAME= nvidia-driver
|
PORTNAME?= nvidia-driver
|
||||||
DISTVERSION?= 460.80
|
DISTVERSION?= 460.80
|
||||||
# Always try to set PORTREVISION as it can be overridden by the slave ports
|
# Always try to set PORTREVISION as it can be overridden by the slave ports
|
||||||
PORTREVISION?= 0
|
PORTREVISION?= 0
|
||||||
|
@ -22,8 +22,8 @@ MASTER_SITES= NVIDIA/XFree86/FreeBSD-${ARCH_SUFX}/${DISTVERSION}
|
||||||
DISTNAME= NVIDIA-FreeBSD-${ARCH_SUFX}-${DISTVERSION}
|
DISTNAME= NVIDIA-FreeBSD-${ARCH_SUFX}-${DISTVERSION}
|
||||||
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
|
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
|
||||||
|
|
||||||
MAINTAINER= danfe@FreeBSD.org
|
MAINTAINER?= danfe@FreeBSD.org
|
||||||
COMMENT= NVidia graphics card binary drivers for hardware OpenGL rendering
|
COMMENT?= NVidia graphics card binary drivers for hardware OpenGL rendering
|
||||||
|
|
||||||
LICENSE_FILE= ${WRKSRC}/doc/license.txt
|
LICENSE_FILE= ${WRKSRC}/doc/license.txt
|
||||||
.include "${.CURDIR}/../nvidia-driver/Makefile.common"
|
.include "${.CURDIR}/../nvidia-driver/Makefile.common"
|
||||||
|
@ -43,7 +43,10 @@ WAYLAND_JSON_PATH= ${PREFIX}/share/egl/egl_external_platform.d
|
||||||
MAKE_ENV= DEBUG_FLAGS=${DEBUG_FLAGS} \
|
MAKE_ENV= DEBUG_FLAGS=${DEBUG_FLAGS} \
|
||||||
EGL_GLVND_JSON_PATH=${STAGEDIR}${GLVND_JSON_PATH} \
|
EGL_GLVND_JSON_PATH=${STAGEDIR}${GLVND_JSON_PATH} \
|
||||||
EGL_WAYLAND_JSON_PATH=${STAGEDIR}${WAYLAND_JSON_PATH}
|
EGL_WAYLAND_JSON_PATH=${STAGEDIR}${WAYLAND_JSON_PATH}
|
||||||
SUB_FILES= pkg-message nvidia.conf
|
SUB_FILES= pkg-message
|
||||||
|
.if !defined(LIBGLDIR)
|
||||||
|
SUB_FILES+= nvidia.conf
|
||||||
|
.endif
|
||||||
.if ${NVVERSION} < 410.057
|
.if ${NVVERSION} < 410.057
|
||||||
SUB_FILES+= pkg-deinstall pkg-install
|
SUB_FILES+= pkg-deinstall pkg-install
|
||||||
.endif
|
.endif
|
||||||
|
@ -54,6 +57,7 @@ SUB_PATCHES= extra-patch-src-Makefile \
|
||||||
extra-patch-src-nvidia_pci.c
|
extra-patch-src-nvidia_pci.c
|
||||||
DOCSDIR= ${PREFIX}/share/doc/NVIDIA_GLX-1.0
|
DOCSDIR= ${PREFIX}/share/doc/NVIDIA_GLX-1.0
|
||||||
MODULESDIR= lib/xorg/modules
|
MODULESDIR= lib/xorg/modules
|
||||||
|
EXTENSIONSDIR?= ${MODULESDIR}/extensions/.nvidia
|
||||||
PORTDOCS= *
|
PORTDOCS= *
|
||||||
|
|
||||||
.if ${NVVERSION} >= 331.013
|
.if ${NVVERSION} >= 331.013
|
||||||
|
@ -96,6 +100,20 @@ FREEBSD_AGP_DESC= Use FreeBSD AGP GART driver
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
PLIST_SUB+= MODULESDIR=${MODULESDIR}
|
PLIST_SUB+= MODULESDIR=${MODULESDIR}
|
||||||
|
.if ${NVVERSION} < 410.057
|
||||||
|
PLIST_SUB+= EXTENSIONSDIR=${EXTENSIONSDIR}
|
||||||
|
.else
|
||||||
|
PLIST_SUB+= EXTENSIONSDIR="@comment "
|
||||||
|
.endif
|
||||||
|
.if defined(LIBGLDIR)
|
||||||
|
PLIST_SUB+= LIBGLDIR=${LIBGLDIR} LIBGLMAP="@comment "
|
||||||
|
.else
|
||||||
|
PLIST_SUB+= LIBGLDIR="@comment " LIBGLMAP=""
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.if ${PORTNAME} != nvidia-secondary-driver
|
||||||
|
CONFLICTS_INSTALL+= nvidia-secondary-driver
|
||||||
|
.endif
|
||||||
|
|
||||||
.include <bsd.port.pre.mk>
|
.include <bsd.port.pre.mk>
|
||||||
|
|
||||||
|
@ -284,8 +302,32 @@ post-install: .SILENT
|
||||||
${STAGEDIR}${PREFIX}/lib/libGLESv2-NVIDIA.so.2
|
${STAGEDIR}${PREFIX}/lib/libGLESv2-NVIDIA.so.2
|
||||||
${RM} ${STAGEDIR}${PREFIX}/lib/libGLESv2.so
|
${RM} ${STAGEDIR}${PREFIX}/lib/libGLESv2.so
|
||||||
.endif
|
.endif
|
||||||
|
# Configuration of Nvidia as secondary GPU requires preserving Mesa libraries
|
||||||
|
# as default implementation; a libmap must not override in this case.
|
||||||
|
.if !defined(LIBGLDIR)
|
||||||
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/libmap.d/
|
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/libmap.d/
|
||||||
${INSTALL_DATA} ${WRKDIR}/nvidia.conf \
|
${INSTALL_DATA} ${WRKDIR}/nvidia.conf \
|
||||||
${STAGEDIR}${PREFIX}/etc/libmap.d/
|
${STAGEDIR}${PREFIX}/etc/libmap.d/
|
||||||
|
.else
|
||||||
|
# libgl proxies require a library path containing unrenamed lib*GL*.so
|
||||||
|
${MKDIR} ${STAGEDIR}${PREFIX}/${LIBGLDIR}
|
||||||
|
${RLN} ${STAGEDIR}${PREFIX}/lib/libGL-NVIDIA.so.1 \
|
||||||
|
${STAGEDIR}${PREFIX}/${LIBGLDIR}/libGL.so.1
|
||||||
|
${RLN} ${STAGEDIR}${PREFIX}/lib/libEGL-NVIDIA.so.1 \
|
||||||
|
${STAGEDIR}${PREFIX}/${LIBGLDIR}/libEGL.so.1
|
||||||
|
${RLN} ${STAGEDIR}${PREFIX}/lib/libGLESv2-NVIDIA.so.2 \
|
||||||
|
${STAGEDIR}${PREFIX}/${LIBGLDIR}/libGLESv2.so.2
|
||||||
|
.endif
|
||||||
|
# Configuration of Nvidia as secondary GPU requires preserving xorg-server's
|
||||||
|
# libglx.so and moving Nvidia's glx to where it can be found by a secondary
|
||||||
|
# Xorg instance.
|
||||||
|
# Not needed since 410.057: Nvidia driver finds libglxserver_nvidia.so instead.
|
||||||
|
.if ${NVVERSION} < 410.057
|
||||||
|
.if ${EXTENSIONSDIR} != ${MODULESDIR}/extensions/.nvidia
|
||||||
|
${MKDIR} ${STAGEDIR}${PREFIX}/${EXTENSIONSDIR}
|
||||||
|
${MV} ${STAGEDIR}${PREFIX}/${MODULESDIR}/extensions/.nvidia/* \
|
||||||
|
${STAGEDIR}${PREFIX}/${EXTENSIONSDIR}/
|
||||||
|
.endif
|
||||||
|
.endif
|
||||||
|
|
||||||
.include <bsd.port.post.mk>
|
.include <bsd.port.post.mk>
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
bin/nvidia-bug-report.sh
|
bin/nvidia-bug-report.sh
|
||||||
bin/nvidia-debugdump
|
bin/nvidia-debugdump
|
||||||
bin/nvidia-smi
|
bin/nvidia-smi
|
||||||
etc/libmap.d/nvidia.conf
|
%%LIBGLMAP%%etc/libmap.d/nvidia.conf
|
||||||
|
%%LIBGLDIR%%/libGL.so.1
|
||||||
|
%%LIBGLDIR%%/libEGL.so.1
|
||||||
|
%%LIBGLDIR%%/libGLESv2.so.2
|
||||||
lib/libEGL-NVIDIA.so
|
lib/libEGL-NVIDIA.so
|
||||||
lib/libEGL-NVIDIA.so.1
|
lib/libEGL-NVIDIA.so.1
|
||||||
lib/libEGL_nvidia.so
|
lib/libEGL_nvidia.so
|
||||||
|
@ -86,8 +89,8 @@ share/glvnd/egl_vendor.d/10_nvidia.json
|
||||||
share/vulkan/icd.d/nvidia_icd.json
|
share/vulkan/icd.d/nvidia_icd.json
|
||||||
share/vulkan/implicit_layer.d/nvidia_layers.json
|
share/vulkan/implicit_layer.d/nvidia_layers.json
|
||||||
%%MODULESDIR%%/drivers/nvidia_drv.so
|
%%MODULESDIR%%/drivers/nvidia_drv.so
|
||||||
%%MODULESDIR%%/extensions/.nvidia/libglx.so
|
%%EXTENSIONSDIR%%/libglx.so
|
||||||
%%MODULESDIR%%/extensions/.nvidia/libglx.so.1
|
%%EXTENSIONSDIR%%/libglx.so.1
|
||||||
%%MODULESDIR%%/extensions/libglxserver_nvidia.so
|
%%MODULESDIR%%/extensions/libglxserver_nvidia.so
|
||||||
%%MODULESDIR%%/extensions/libglxserver_nvidia.so.1
|
%%MODULESDIR%%/extensions/libglxserver_nvidia.so.1
|
||||||
/%%KMODDIR%%/nvidia.ko
|
/%%KMODDIR%%/nvidia.ko
|
||||||
|
|
78
x11/nvidia-hybrid-graphics/Makefile
Normal file
78
x11/nvidia-hybrid-graphics/Makefile
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
# Created by: Theron Tarigo <theron.tarigo@gmail.com>
|
||||||
|
|
||||||
|
PORTNAME= nvidia-hybrid-graphics
|
||||||
|
PORTVERSION= 0.5
|
||||||
|
CATEGORIES= x11
|
||||||
|
MASTER_SITES= # none
|
||||||
|
DISTFILES= # none
|
||||||
|
|
||||||
|
MAINTAINER= theron.tarigo@gmail.com
|
||||||
|
COMMENT= NVIDIA secondary GPU configuration - Optimus Technology support
|
||||||
|
|
||||||
|
LICENSE= BSD2CLAUSE
|
||||||
|
|
||||||
|
RUN_DEPENDS= nvidia-xconfig:x11/nvidia-xconfig \
|
||||||
|
${LOCALBASE}/bin/Xorg:x11-servers/xorg-server
|
||||||
|
|
||||||
|
FLAVORS= default 390
|
||||||
|
|
||||||
|
NO_ARCH= yes
|
||||||
|
NO_BUILD= yes
|
||||||
|
WRKSRC= ${WRKDIR}/src
|
||||||
|
|
||||||
|
default_RUN_DEPENDS= \
|
||||||
|
nvidia-secondary-driver>=440.64:x11/nvidia-secondary-driver
|
||||||
|
390_RUN_DEPENDS= \
|
||||||
|
nvidia-secondary-driver-390>=390.87:x11/nvidia-secondary-driver-390
|
||||||
|
|
||||||
|
VIRTUALGL_RUN_DEPENDS= ${LOCALBASE}/VirtualGL/bin/vglrun:x11/virtualgl
|
||||||
|
|
||||||
|
390_PKGNAMESUFFIX= -390
|
||||||
|
|
||||||
|
OPTIONS_DEFINE= VIRTUALGL OPTIRUN
|
||||||
|
OPTIONS_DEFAULT= VIRTUALGL OPTIRUN
|
||||||
|
OPTIONS_SUB= OPTIRUN
|
||||||
|
VIRTUALGL_DESC= Use VirtualGL for OpenGL redirection support
|
||||||
|
OPTIRUN_DESC= Install "optirun" alias for nvrun-vgl
|
||||||
|
OPTIRUN_IMPLIES= VIRTUALGL
|
||||||
|
|
||||||
|
scripts= \
|
||||||
|
bin/Xorg-nvidia-headless \
|
||||||
|
bin/nvidia-headless-xconfig \
|
||||||
|
bin/nvrun \
|
||||||
|
bin/nvrun-vgl \
|
||||||
|
libexec/nvidia-headless-utils/readconf \
|
||||||
|
libexec/nvidia-settings-hybrid
|
||||||
|
configs= \
|
||||||
|
etc/X11/xorg-nvidia-headless-template.conf \
|
||||||
|
etc/nvidia-headless.conf \
|
||||||
|
etc/nvidia-hybrid.conf \
|
||||||
|
|
||||||
|
SUB_FILES= pkg-message ${scripts:%=src/%} ${configs:%=src/%}
|
||||||
|
SUB_LIST+= VGLRUN=${LOCALBASE}/VirtualGL/bin/vglrun
|
||||||
|
|
||||||
|
USE_RC_SUBR= nvidia_xorg
|
||||||
|
|
||||||
|
do-extract:
|
||||||
|
.for f in ${SUB_FILES}
|
||||||
|
${MKDIR} ${WRKDIR}/${f:H}
|
||||||
|
.endfor
|
||||||
|
|
||||||
|
do-install:
|
||||||
|
.for f in ${scripts}
|
||||||
|
@${MKDIR} ${STAGEDIR}${PREFIX}/${f:H}
|
||||||
|
${INSTALL_SCRIPT} ${WRKSRC}/${f} ${STAGEDIR}${PREFIX}/${f}
|
||||||
|
.endfor
|
||||||
|
.for f in ${configs}
|
||||||
|
@${MKDIR} ${STAGEDIR}${PREFIX}/${f:H}
|
||||||
|
${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${PREFIX}/${f}.sample
|
||||||
|
.endfor
|
||||||
|
|
||||||
|
post-install:
|
||||||
|
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg-nvidia-headless.conf.d
|
||||||
|
|
||||||
|
post-install-OPTIRUN-on:
|
||||||
|
@${RLN} ${STAGEDIR}${PREFIX}/bin/nvrun-vgl \
|
||||||
|
${STAGEDIR}${PREFIX}/bin/optirun
|
||||||
|
|
||||||
|
.include <bsd.port.mk>
|
48
x11/nvidia-hybrid-graphics/files/nvidia_xorg.in
Normal file
48
x11/nvidia-hybrid-graphics/files/nvidia_xorg.in
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# $FreeBSD$
|
||||||
|
#
|
||||||
|
# PROVIDE: nvidia_xorg
|
||||||
|
# REQUIRE: LOGIN
|
||||||
|
# KEYWORD: shutdown
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
|
||||||
|
name=nvidia_xorg
|
||||||
|
rcvar=nvidia_xorg_enable
|
||||||
|
desc="Nvidia GPU Dedicated Xorg"
|
||||||
|
|
||||||
|
load_rc_config $name
|
||||||
|
|
||||||
|
: ${nvidia_xorg_enable:=NO}
|
||||||
|
: ${nvidia_modeset:=NO}
|
||||||
|
: ${nvidia_manage_kld:=YES}
|
||||||
|
|
||||||
|
command=/usr/sbin/daemon
|
||||||
|
pidfile=/var/run/${name}.pid
|
||||||
|
procname="%%LOCALBASE%%/bin/Xorg"
|
||||||
|
command_args="-p ${pidfile} -f %%PREFIX%%/bin/Xorg-nvidia-headless"
|
||||||
|
start_precmd="${name}_prestart"
|
||||||
|
stop_postcmd="${name}_poststop"
|
||||||
|
|
||||||
|
if checkyesno nvidia_modeset; then
|
||||||
|
kmod=nvidia-modeset
|
||||||
|
else
|
||||||
|
kmod=nvidia
|
||||||
|
fi
|
||||||
|
|
||||||
|
nvidia_xorg_prestart()
|
||||||
|
{
|
||||||
|
if checkyesno nvidia_manage_kld; then
|
||||||
|
kldload -n ${kmod} || return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
nvidia_xorg_poststop()
|
||||||
|
{
|
||||||
|
if checkyesno nvidia_manage_kld; then
|
||||||
|
kldunload -f ${kmod} || return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
run_rc_command "$1"
|
24
x11/nvidia-hybrid-graphics/files/pkg-message.in
Normal file
24
x11/nvidia-hybrid-graphics/files/pkg-message.in
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
Running Xorg-nvidia-headless at startup is recommended especially on mobile
|
||||||
|
systems since leaving Nvidia GPU powered on with no Xorg may consume
|
||||||
|
significantly more power.
|
||||||
|
|
||||||
|
# sysrc nvidia_xorg_enable=YES
|
||||||
|
# service nvidia_xorg start
|
||||||
|
|
||||||
|
The Xorg instance uses separate configuration files from the defaults for Xorg:
|
||||||
|
|
||||||
|
%%PREFIX%%/etc/X11/xorg-nvidia-headless.conf.d/
|
||||||
|
|
||||||
|
%%PREFIX%%/etc/X11/xorg-nvidia-headless-template.conf
|
||||||
|
Only used if xorg-nvidia-headless.conf does not exist.
|
||||||
|
This file is passed through nvidia-xconfig, which does not preserve
|
||||||
|
all options.
|
||||||
|
|
||||||
|
%%PREFIX%%/etc/X11/xorg-nvidia-headless.conf
|
||||||
|
Created by manually invoking %%PREFIX%%/bin/nvidia-headless-xconfig.
|
||||||
|
Once created, this configuration is not passed through nvidia-xconfig.
|
||||||
|
|
||||||
|
Configuration is not normally needed for typical OpenGL acceleration usage.
|
||||||
|
|
||||||
|
A properly configured xorg-nvidia-headless.conf will allow Xorg-nvidia-headless
|
||||||
|
to be started by non-superuser if Xorg has been installed setuid.
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
conf=%%PREFIX%%/etc/nvidia-headless.conf
|
||||||
|
. %%PREFIX%%/libexec/nvidia-headless-utils/readconf
|
||||||
|
if [ -z "$NVDISPLAY" ]; then printf %s\\n "NVDISPLAY required in environment or in $conf" >&2 ; exit 1; fi
|
||||||
|
xconfig=%%LOCALBASE%%/etc/X11/xorg-nvidia-headless.conf
|
||||||
|
xconfarg=xorg-nvidia-headless.conf
|
||||||
|
if [ ! -e "$xconfig" ]; then
|
||||||
|
if [ "$(id -u)" != 0 ]; then
|
||||||
|
printf %s\\n "nvidia-headless must be configured by superuser" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
xconfig=/var/cache/nvidia-headless/xorg.conf
|
||||||
|
mkdir -p /var/cache/nvidia-headless
|
||||||
|
xconfarg="$xconfig"
|
||||||
|
%%PREFIX%%/bin/nvidia-headless-xconfig -o "$xconfig"
|
||||||
|
fi
|
||||||
|
exec %%LOCALBASE%%/bin/Xorg -sharevts -novtswitch -noreset -config "$xconfarg" -configdir "xorg-nvidia-headless.conf.d" "$NVDISPLAY" "$@"
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec %%LOCALBASE%%/bin/nvidia-xconfig \
|
||||||
|
--enable-all-gpus \
|
||||||
|
--preserve-busid \
|
||||||
|
--allow-empty-initial-configuration \
|
||||||
|
--connected-monitor=DFP \
|
||||||
|
--no-use-edid \
|
||||||
|
-c %%PREFIX%%/etc/X11/xorg-nvidia-headless-template.conf \
|
||||||
|
-o %%LOCALBASE%%/etc/X11/xorg-nvidia-headless.conf "$@"
|
8
x11/nvidia-hybrid-graphics/files/src/bin/nvrun-vgl.in
Normal file
8
x11/nvidia-hybrid-graphics/files/src/bin/nvrun-vgl.in
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
conf=%%PREFIX%%/etc/nvidia-headless.conf
|
||||||
|
. %%PREFIX%%/libexec/nvidia-headless-utils/readconf
|
||||||
|
conf=%%PREFIX%%/etc/nvidia-hybrid.conf
|
||||||
|
. %%PREFIX%%/libexec/nvidia-headless-utils/readconf
|
||||||
|
if [ -z "$NVDISPLAY" ]; then printf %s\\n "NVDISPLAY required in environment or in $conf" >&2 ; exit 1; fi
|
||||||
|
if [ -z "$VGLRUN" ]; then printf %s\\n "VGLRUN required in environment or in $conf" >&2 ; exit 1; fi
|
||||||
|
exec "$VGLRUN" -ld "%%LOCALBASE%%/lib/libGL-NVIDIA" -d "$NVDISPLAY" "$@"
|
7
x11/nvidia-hybrid-graphics/files/src/bin/nvrun.in
Normal file
7
x11/nvidia-hybrid-graphics/files/src/bin/nvrun.in
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
conf=%%PREFIX%%/etc/nvidia-headless.conf
|
||||||
|
. %%PREFIX%%/libexec/nvidia-headless-utils/readconf
|
||||||
|
if [ -z "$NVDISPLAY" ]; then printf %s\\n "NVDISPLAY required in environment or in $conf" >&2 ; exit 1; fi
|
||||||
|
export DISPLAY="$NVDISPLAY"
|
||||||
|
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:%%LOCALBASE%%/lib/libGL-NVIDIA"
|
||||||
|
exec "$@"
|
|
@ -0,0 +1,39 @@
|
||||||
|
|
||||||
|
Section "ServerLayout"
|
||||||
|
Identifier "nvidia"
|
||||||
|
Screen 0 "Screen0"
|
||||||
|
InputDevice "fake" "CorePointer" "CoreKeyboard"
|
||||||
|
Option "AutoAddDevices" "false"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "Files"
|
||||||
|
ModulePath "%%LOCALBASE%%/lib/xorg/modules-NVIDIA"
|
||||||
|
ModulePath "%%LOCALBASE%%/lib/xorg/modules"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "Module"
|
||||||
|
Load "dri3"
|
||||||
|
Load "glx"
|
||||||
|
Disable "efifb"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "InputDevice"
|
||||||
|
Identifier "fake"
|
||||||
|
Driver ""
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "Monitor"
|
||||||
|
Identifier "Monitor0"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "Device"
|
||||||
|
Identifier "Device0"
|
||||||
|
Driver "nvidia"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "Screen"
|
||||||
|
Identifier "Screen0"
|
||||||
|
Device "Device0"
|
||||||
|
Monitor "Monitor0"
|
||||||
|
EndSection
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
NVDISPLAY=:8
|
|
@ -0,0 +1 @@
|
||||||
|
VGLRUN=%%VGLRUN%%
|
|
@ -0,0 +1,5 @@
|
||||||
|
while IFS== read -r _var _val ; do
|
||||||
|
expr "$_var" : '[a-zA-Z][a-zA-Z0-9_]*$' >&- && \
|
||||||
|
eval [ -z \${$_var+UNSET} ] '&&' $_var="\$_val" '||' true || \
|
||||||
|
printf %s\\n "$conf: $_var: bad variable name" >&2
|
||||||
|
done < "$conf" ; unset _var _val
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
conf=%%PREFIX%%/etc/nvidia-headless.conf
|
||||||
|
. %%PREFIX%%/libexec/nvidia-headless-utils/readconf
|
||||||
|
exec nvrun-vgl %%LOCALBASE%%/libexec/nvidia-settings -c "$NVDISPLAY" "$@"
|
8
x11/nvidia-hybrid-graphics/pkg-descr
Normal file
8
x11/nvidia-hybrid-graphics/pkg-descr
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
This port integrates the Nvidia graphics driver and supporting utilities with
|
||||||
|
VirtualGL, enabling use of Nvidia acceleration on a system with hybrid graphics
|
||||||
|
hardware configuration, aka "Optimus".
|
||||||
|
|
||||||
|
Applications to be run with Nvidia acceleration should be started using
|
||||||
|
`nvrun-vgl`.
|
||||||
|
|
||||||
|
WWW: https://github.com/therontarigo/freebsd-gpu-headless
|
11
x11/nvidia-hybrid-graphics/pkg-plist
Normal file
11
x11/nvidia-hybrid-graphics/pkg-plist
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
bin/Xorg-nvidia-headless
|
||||||
|
bin/nvidia-headless-xconfig
|
||||||
|
bin/nvrun
|
||||||
|
libexec/nvidia-headless-utils/readconf
|
||||||
|
%%VIRTUALGL%%bin/nvrun-vgl
|
||||||
|
%%OPTIRUN%%bin/optirun
|
||||||
|
libexec/nvidia-settings-hybrid
|
||||||
|
@sample etc/X11/xorg-nvidia-headless-template.conf.sample
|
||||||
|
@sample etc/nvidia-headless.conf.sample
|
||||||
|
@sample etc/nvidia-hybrid.conf.sample
|
||||||
|
@dir etc/X11/xorg-nvidia-headless.conf.d
|
6
x11/nvidia-secondary-driver-390/Makefile
Normal file
6
x11/nvidia-secondary-driver-390/Makefile
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# Created by: Theron Tarigo <theron.tarigo@gmail.com>
|
||||||
|
|
||||||
|
MASTERDIR= ${.CURDIR}/../nvidia-driver-390
|
||||||
|
NVSDR_MASTERDIR= ${.CURDIR}/../nvidia-secondary-driver
|
||||||
|
|
||||||
|
.include "${NVSDR_MASTERDIR}/Makefile"
|
20
x11/nvidia-secondary-driver/Makefile
Normal file
20
x11/nvidia-secondary-driver/Makefile
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# Created by: Theron Tarigo <theron.tarigo@gmail.com>
|
||||||
|
|
||||||
|
PORTNAME= nvidia-secondary-driver
|
||||||
|
# Explicitly set PORTREVISION as it can be overridden by the master port
|
||||||
|
PORTREVISION= 0
|
||||||
|
|
||||||
|
MASTERDIR?= ${.CURDIR}/../nvidia-driver
|
||||||
|
|
||||||
|
MAINTAINER= theron.tarigo@gmail.com
|
||||||
|
COMMENT= NVidia graphics card binary drivers for hardware OpenGL rendering on secondary device
|
||||||
|
|
||||||
|
CONFLICTS_INSTALL= nvidia-driver
|
||||||
|
|
||||||
|
EXTENSIONSDIR= lib/xorg/modules-NVIDIA/extensions
|
||||||
|
|
||||||
|
LIBGLDIR= lib/libGL-NVIDIA
|
||||||
|
|
||||||
|
SUB_FILES= pkg-message
|
||||||
|
|
||||||
|
.include "${MASTERDIR}/Makefile"
|
4
x11/nvidia-secondary-driver/pkg-message
Normal file
4
x11/nvidia-secondary-driver/pkg-message
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
Utilization of this driver for GLX acceleration requires special configuration
|
||||||
|
of an Xorg server instance.
|
||||||
|
|
||||||
|
x11/nvidia-hybrid-graphics is provided to handle this configuration.
|
|
@ -27,11 +27,14 @@ USE_GITHUB= yes
|
||||||
GH_ACCOUNT= NVIDIA
|
GH_ACCOUNT= NVIDIA
|
||||||
|
|
||||||
PLIST_FILES= bin/nvidia-settings \
|
PLIST_FILES= bin/nvidia-settings \
|
||||||
|
libexec/nvidia-settings \
|
||||||
man/man1/nvidia-settings.1.gz \
|
man/man1/nvidia-settings.1.gz \
|
||||||
lib/libnvidia-gtk2.so.${PORTVERSION} \
|
lib/libnvidia-gtk2.so.${PORTVERSION} \
|
||||||
share/applications/nvidia-settings.desktop \
|
share/applications/nvidia-settings.desktop \
|
||||||
share/pixmaps/nvidia-settings.png
|
share/pixmaps/nvidia-settings.png
|
||||||
|
|
||||||
|
SUB_FILES= nvidia-settings
|
||||||
|
|
||||||
LDFLAGS+= -pthread
|
LDFLAGS+= -pthread
|
||||||
LLD_UNSAFE= yes
|
LLD_UNSAFE= yes
|
||||||
MAKE_ENV= NV_USE_BUNDLED_LIBJANSSON=0 \
|
MAKE_ENV= NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||||
|
@ -56,5 +59,9 @@ post-install: .SILENT
|
||||||
${STAGEDIR}/${DESKTOPDIR}
|
${STAGEDIR}/${DESKTOPDIR}
|
||||||
${INSTALL_DATA} ${WRKSRC}/doc/nvidia-settings.png \
|
${INSTALL_DATA} ${WRKSRC}/doc/nvidia-settings.png \
|
||||||
${STAGEDIR}/${PREFIX}/share/pixmaps
|
${STAGEDIR}/${PREFIX}/share/pixmaps
|
||||||
|
${MV} ${STAGEDIR}${PREFIX}/bin/nvidia-settings \
|
||||||
|
${STAGEDIR}${PREFIX}/libexec/nvidia-settings
|
||||||
|
${INSTALL} ${WRKDIR}/nvidia-settings \
|
||||||
|
${STAGEDIR}${PREFIX}/bin/nvidia-settings
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
.include <bsd.port.mk>
|
||||||
|
|
3
x11/nvidia-settings/files/nvidia-settings.in
Normal file
3
x11/nvidia-settings/files/nvidia-settings.in
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
[ -e "%%LOCALBASE%%/libexec/nvidia-settings-hybrid" ] && exec %%LOCALBASE%%/libexec/nvidia-settings-hybrid "$@"
|
||||||
|
exec %%PREFIX%%/libexec/nvidia-settings "$@"
|
Loading…
Add table
Reference in a new issue