(In reply to Matthias Fulz from comment #165)
> (In reply to Ranjith Hegde from comment #164)
> > (In reply to Matthias Fulz from comment #161)
> >
> > Hello,
> > Thank you for your patch and effort. I tried your primusrun patch. First I
> > get an infinite repetitions of this
> > /bin/bash: warning: shell level (1000) too high, resetting to 1
> >
> Ok this is NOT a patch :)
> It's just a simple script to run optirun / primusrun encapsulated to load
> and unload the nvidia module.
>
> > and when I stop (C-c) I get an infinite loop of this
> >
> > rmmod: ERROR: Module nvidia is not currently loaded
> > finished.
> > unloading nvidia modules ...
> > rmmod: ERROR: Module nvidia is not currently loaded
> > finished.
> >
> > nothing launches..
> > Any ideas?
> >
> Yes: I'm quite sure you've got /usr/local/bin in your PATH and this before
> the /usr/bin entry, where optirun / primusrun should be placed in.
>
> Two possible solutions:
>
> 1.) Change the lines primusrun $@ and optirun $@ to use the full path a.e.
> /usr/bin/primusrun $@ instead of primusrun $@
>
> 2.) Rename the scripts to something like /usr/local/bin/primusrun.sh and
> /usr/local/bin/optirun.sh
>
> Second solution will avoid any naming clushes for sure.
>
> Hope that helps
>
> BR,
> Matthias
Thank you for your reply!
Firstly about the naming hickup. I am from computer music background and any piece of code is referred to as a patch. I know its quite different in shell scripting or general programming world. my bad
I tried your second solution of using .sh and running it after I close all programs running on Nvidia. it works. Thanks
If I were to place your script (!) directly inside usr/bin/primusrun then where would you suggest I put it. here's how it looks, unedited
#!/bin/bash
# Readback-display synchronization method
# 0: no sync, 1: D lags behind one frame, 2: fully synced
# export PRIMUS_SYNC=${PRIMUS_SYNC:-0}
# Directory containing primus libGL
PRIMUS_libGL=/usr/\$LIB/primus
# On some distributions, e.g. on Ubuntu, libnvidia-tls.so is not available
# in default search paths. Add its path manually after the primus library
# PRIMUS_libGL=${PRIMUS_libGL}:/usr/lib/nvidia-current:/usr/lib32/nvidia-current
# Mesa drivers need a few symbols to be visible
# export PRIMUS_LOAD_GLOBAL=${PRIMUS_LOAD_GLOBAL:-'libglapi.so.0'}
# Need functions from primus libGL to take precedence
export LD_LIBRARY_PATH=${PRIMUS_libGL}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
# And go!
export __GLVND_DISALLOW_PATCHING=1
exec "$@"
(In reply to Matthias Fulz from comment #165) bin/primusrun. sh and bin/optirun. sh
> (In reply to Ranjith Hegde from comment #164)
> > (In reply to Matthias Fulz from comment #161)
> >
> > Hello,
> > Thank you for your patch and effort. I tried your primusrun patch. First I
> > get an infinite repetitions of this
> > /bin/bash: warning: shell level (1000) too high, resetting to 1
> >
> Ok this is NOT a patch :)
> It's just a simple script to run optirun / primusrun encapsulated to load
> and unload the nvidia module.
>
> > and when I stop (C-c) I get an infinite loop of this
> >
> > rmmod: ERROR: Module nvidia is not currently loaded
> > finished.
> > unloading nvidia modules ...
> > rmmod: ERROR: Module nvidia is not currently loaded
> > finished.
> >
> > nothing launches..
> > Any ideas?
> >
> Yes: I'm quite sure you've got /usr/local/bin in your PATH and this before
> the /usr/bin entry, where optirun / primusrun should be placed in.
>
> Two possible solutions:
>
> 1.) Change the lines primusrun $@ and optirun $@ to use the full path a.e.
> /usr/bin/primusrun $@ instead of primusrun $@
>
> 2.) Rename the scripts to something like /usr/local/
> /usr/local/
>
> Second solution will avoid any naming clushes for sure.
>
> Hope that helps
>
> BR,
> Matthias
Thank you for your reply!
Firstly about the naming hickup. I am from computer music background and any piece of code is referred to as a patch. I know its quite different in shell scripting or general programming world. my bad
I tried your second solution of using .sh and running it after I close all programs running on Nvidia. it works. Thanks
If I were to place your script (!) directly inside usr/bin/primusrun then where would you suggest I put it. here's how it looks, unedited
#!/bin/bash
# Readback-display synchronization method SYNC=${ PRIMUS_ SYNC:-0}
# 0: no sync, 1: D lags behind one frame, 2: fully synced
# export PRIMUS_
# Verbosity level VERBOSE= ${PRIMUS_ VERBOSE: -1}
# 0: only errors, 1: warnings (default), 2: profiling
# export PRIMUS_
# Upload/display method UPLOAD= ${PRIMUS_ UPLOAD: -0}
# 0: autodetect, 1: textures, 2: PBO/glDrawPixels (needs Mesa-10.1+)
# export PRIMUS_
# Approximate sleep ratio in the readback thread, percent SLEEP=$ {PRIMUS_ SLEEP:- 90}
# export PRIMUS_
# Secondary display DISPLAY= ${PRIMUS_ DISPLAY: -:8}
# export PRIMUS_
# "Accelerating" libGL libGLa= ${PRIMUS_ libGLa: -'/usr/ $LIB/nvidia/ libGL.so. 1'}
# $LIB will be interpreted by the dynamic linker
# export PRIMUS_
# "Displaying" libGL libGLd= ${PRIMUS_ libGLd: -'/usr/ $LIB/libGL. so.1'}
# export PRIMUS_
# Directory containing primus libGL libGL=/ usr/\$LIB/ primus
PRIMUS_
# On some distributions, e.g. on Ubuntu, libnvidia-tls.so is not available libGL=$ {PRIMUS_ libGL}: /usr/lib/ nvidia- current: /usr/lib32/ nvidia- current
# in default search paths. Add its path manually after the primus library
# PRIMUS_
# Mesa drivers need a few symbols to be visible LOAD_GLOBAL= ${PRIMUS_ LOAD_GLOBAL: -'libglapi. so.0'}
# export PRIMUS_
# Need functions from primus libGL to take precedence PATH=${ PRIMUS_ libGL}$ {LD_LIBRARY_ PATH:+: $LD_LIBRARY_ PATH}
export LD_LIBRARY_
# And go! DISALLOW_ PATCHING= 1
export __GLVND_
exec "$@"