What to do against game performance drop in 12.04 when using unity (3D)?
Solution 1:
It's not a real solution, but at least it might be a (hopefully) useful workaround (apart from simply using Unity 2D).
Before you start a game, open up Nautilus (the file manager) and go to /usr/share/application
. Open up a terminal, type metacity --replace
, and press enter. Don't panick, the Unity interface will disappear, but this is my intention. Launch the game from the file manager (the launcher for the game should be in the folder I mentioned). After you finish playing your game, type unity --replace
in the terminal window, and press enter. Your desktop is now restored to how it was.
This should work as it's probably Unity running in the background that's causing trouble.
Also, I'd report this as a bug. It's definitely something that needs to be fixed. If you submit a bug report, be sure to leave a link here so other people who are experiencing this problem can mark it as "affecting them", which will get it fixed sooner.
Solution 2:
You could always update to the 304.22 Nvidia Beta drivers and see what happens. I was having huge performance issues with Ubuntu 12.04 LTS and the Nvidia 295.59 version & the 302.07 version seemed to fix some minor things. Most of the issues have been resolved by updating the latest 304.22 driver. Now my GeForce performance is finally equal to Windows XP but there are still minor issues from a few applications but the situation is really improved significantly. You should use the latest Nvidia drivers at all times, even if they are in BETA because it seems that the older stable ones aren't tested by Nvidia's team on newer Kernel and Ubuntu rolling updates causing unexpected problem and issues. Problem is that Nvidia needs to Open Source their drivers so that Ubuntu maintainers and Linux developers can keep everything in sync but that's an ongoing discussion that will not resolve anytime soon :-(
You can obtain them http://www.geforce.com/drivers/beta-legacy
The 304.22 drivers have tons of large scale fixes like:
- GeForce GTX 680M
Quadro K1000M
Quadro K2000M
used for creation of implicit MetaModes.
See the description of the IncludeImplicitMetaModes X configuration
option in the README for details.
- SecondMonitorHorizSync
SecondMonitorVertRefresh
Solution 3:
EDIT: X is now lockable thru xscreensaver
hi! try this, I am having great results using it, mostly for games! As it wont be managed by Unity, you may have great results too!
I have created this script that creates a new X session and runs a command or open a terminal so you can run it there.
openNewX.sh
#!/bin/bash
function FUNCisX1running {
ps -A -o command |grep -v "grep" |grep -q -x "X :1"
}
useJWM=true
useKbd=true
while [[ ${1:0:2} == "--" ]]; do
if [[ "$1" == "--no-wm" ]]; then #opt SKIP WINDOW MANAGER (run pure X alone)
useJWM=false
shift
elif [[ "$1" == "--no-kbd" ]]; then #opt SKIP Keyboard setup
useKbd=false
shift
elif [[ "$1" == "--isRunning" ]]; then #opt check if new X :1 is already running
if FUNCisX1running; then
exit 0
else
exit 1
fi
elif [[ "$1" == "--help" ]]; then #opt show help info
echo "usage: options runCommand"
# this sed only cleans lines that have extended options with "--" prefixed
sedCleanHelpLine='s"\(.*\"\)\(--.*\)\".*#opt" \2"' #helpskip
grep "#opt" $0 |grep -v "#helpskip" |sed "$sedCleanHelpLine"
exit 0
else
#echoc -p "invalid option $1"
echo "PROBLEM: invalid option $1"
$0 --help
exit 1
fi
done
#echo "going to execute: $@"
#runCmd="$1" #this command must be simple, if need complex put on a script file and call it!
runCmd="$@" #this command must be simple, if need complex put on a script file and call it!
#if ! echoc -q -t 2 "use JWM window manager@Dy"; then
# useJWM=false
#fi
# run in a thread, prevents I from ctrl+c here what breaks THIS X instace and locks keyb
if ! FUNCisX1running; then
xterm -e "\
echo \"INFO: hit CTRL+C to exit the other X session and close this window\";\
echo \"INFO: running in a thread (child proccess) to prevent ctrl+c from freezing this X session and the machine!\";\
echo \"INFO: hit ctrl+alt+f7 to get back to this X session (f7, f8 etc, may vary..)\";\
echo ;\
echo \"Going to execute on another X session: $runCmd\";\
sudo X :1"&
fi
#sudo chvt 8 # this line to force go to X :1 terminal
# wait for X to start
while ! FUNCisX1running; do
sleep 1
done
# run in a thread, prevents I from ctrl+c here what breaks THIS X instace and locks keyb
if $useJWM; then
if [[ ! -f "$HOME/.jwmrc" ]]; then
echo '<?xml version="1.0"?><JWM><Key mask="4" key="L">exec:xscreensaver-command --lock</Key></JWM>' \
>$HOME/.jwmrc
#if ! jwm -p; then
# rm $HOME/.jwmrc
# echo ".jwmrc is invalid"
#else
echo "see http://joewing.net/programs/jwm/config.shtml#keys"
echo "with Super+L you can lock the screen now"
#fi
fi
jwm -display :1&
fi
kbdSetup="echo \"SKIP: kbd setup\""
if $useKbd; then
kbdSetup="setxkbmap -layout us"
fi
sleep 2
xscreensaver -display :1&
# setxkbmap is good for games that have console access!; bash is to keep console open!
# nothing
#xterm -display :1&
# dead keys
#xterm -display :1 -e "setxkbmap -layout us -variant intl; bash"&
# good for games!
xterm -display :1 -e "$kbdSetup; bash -c \"$runCmd\"; bash"&
#xterm -display :1 -e "$kbdSetup; bash -c \"$@\"; bash"&
also, add this at: compiz config settings manager -> window rules -> non closeable windows:
(class=XTerm) & (title=sudo X :1) & (name=xterm)
This will prevent you from closing that terminal (use ctrl+c to close the other X session and also the terminal), because if you close "the window" it will freeze your current X session!
It has the advantage that you dont have alt+enter full screen problems, also no Alt+TAB full screen problems; you can run with more stability any 3D game, from Urban Terror (linux native) to games run with Wine! Even some browsers that run 3D games like Firefox with Quake!
Obs.: you may want to install jwm package, not required but will make a difference if you need to do any window management there..
PS.: it can be improved of course, my plan is to add the keyboard setup to an option, but I do it very slowly ;), if someone improve/clean it up, post so I can update mine script :)