Go Back   Ubuntu Forums > Ubuntu Release Assistance > Other Support Categories > Gaming & Leisure

Gaming & Leisure A section for users who strive to play the latest games on linux.

Tags: , , , , , ,

How to play openGL based games with full 3D acceleration on XGL/compiz

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 15th, 2006
arnieboy's Avatar
arnieboy arnieboy is online now
Tall Cafè Ubuntu
 
Join Date: Mar 2005
Location: Pennsylvania, USA
Beans: 3,216
Ubuntu 6.06 User
Send a message via AIM to arnieboy Send a message via Yahoo to arnieboy
How to play openGL based games with full 3D acceleration on XGL/compiz

FULL credit goes to "jesper" from the compiz forums ( http://compiz.net ) for the following work. I have tested it and it works and hence warrants a complete howto here.
The original howto is here

CAVEAT:
1) I have only tested this on GNOME.
2) lithorus has reported that this does not work with the fglrx (ATI) driver. Trying the below with the same will result in an XGL crash.


First of all, do the following:
Code:
sudo visudo
and add the following to the end of the file:
Quote:
%user_name ALL=NOPASSWD: /usr/bin/Xorgallowlocal
where user_name is the group to which your user_name belongs (generally they go by the same name on a default Dapper install)
press ctrl-X and hit "Y" to save and exit.
now do the following:
Code:
sudo gedit /usr/bin/Xorgallowlocal
and paste the following:
Quote:
#!/bin/sh
DISPLAY="$2" XAUTHORITY="$1" xhost local:
save and exit and do the following:
Code:
sudo gedit /usr/bin/nonXgl
and paste the following:
Quote:
#!/bin/sh

DISPLAY=":93"

if [ -z "$1" ]; then
echo "Usage: nonXgl <command>"
exit 1
fi

isdisplay=0; isauth=0; for test in $(ps ax | grep "$DISPLAY" | grep Xorg ); do if [ $isauth -eq 1 ]; then export XAUTHORITY="$test"; isauth=0; fi; if [ "$test" = "-auth" ]; then isauth=1; fi; done;


sudo /usr/bin/Xorgallowlocal "$XAUTHORITY" "$DISPLAY"

exec $@
save and exit.
IN the above one thing needs to be kept in mind. you need to be sure that your display number is indeed "93" (by default it is 93 on almost all systems). To double check however, do the following:
Code:
ps uax | grep Xorg | grep Xgl
and look at the end of the line just before "terminate". There you will see your screen number. If it is anything other than 93, change the value of DISPLAY accordingly in "/usr/bin/nonXgl"

Now do the folllowing:
Code:
sudo chmod 755 /usr/bin/nonXgl sudo chmod 755 /usr/bin/Xorgallowlocal
Now you are all set.
To run any openGL based game, play it as follows:
Code:
nonXgl <game>
for example:
Code:
nonXgl ppracer
and enjoy full 3D acceleration!

If it works for you, you can go a step further and change the path of the game executable in your menu by using alacarte or some other way to be able to launch it from menu.

We can get this thread stickied if it works for others.
__________________
Automatix: Just works!

Last edited by arnieboy : May 15th, 2006 at 04:17 AM.
Reply With Quote
Sponsored Links
  #2  
Old May 15th, 2006
lithorus's Avatar
lithorus lithorus is offline
Dark Roasted Ubuntu
 
Join Date: Jan 2005
Location: Copenhagen, Denmark
Beans: 1,009
The Feisty Fawn Testing User
Re: How to play openGL based games with full 3D acceleration on XGL/compiz

Would just like to add that this does NOT work with fglrx(ATI). Fglrx doesn't support acceleration on 2 X servers at once. If you try the above it'll just crash your XGL session...
Reply With Quote
  #3  
Old May 15th, 2006
arnieboy's Avatar
arnieboy arnieboy is online now
Tall Cafè Ubuntu
 
Join Date: Mar 2005
Location: Pennsylvania, USA
Beans: 3,216
Ubuntu 6.06 User
Send a message via AIM to arnieboy Send a message via Yahoo to arnieboy
Re: How to play openGL based games with full 3D acceleration on XGL/compiz

Quote:
Originally Posted by lithorus
Would just like to add that this does NOT work with fglrx(ATI). Fglrx doesn't support acceleration on 2 X servers at once. If you try the above it'll just crash your XGL session...
thanks for the update will add that.
__________________
Automatix: Just works!
Reply With Quote
  #4  
Old May 25th, 2006
mithras86's Avatar
mithras86 mithras86 is offline
A Carafe of Ubuntu
 
Join Date: Mar 2006
Location: Rijswijk, The Netherlands
Beans: 140
Ubuntu 6.10 Edgy User
Send a message via ICQ to mithras86 Send a message via AIM to mithras86 Send a message via MSN to mithras86 Send a message via Skype™ to mithras86
Re: How to play openGL based games with full 3D acceleration on XGL/compiz

Realy awesome! Never thought how I could solve the ploblem: eye candy with compiz/xgl and still have the possibility to play ET!
Thanks!
Reply With Quote
  #5  
Old May 25th, 2006
grendelkhan's Avatar
grendelkhan grendelkhan is offline
Ubuntu Extra Shot
 
Join Date: Feb 2005
Location: Cincinnati, OH, USA
Beans: 385
Edgy Eft Testing User
Send a message via ICQ to grendelkhan Send a message via AIM to grendelkhan Send a message via MSN to grendelkhan Send a message via Yahoo to grendelkhan
Re: How to play openGL based games with full 3D acceleration on XGL/compiz

I've added the files remotely, I am so going to test this tonight when I get home from work!
__________________
"If the real Jesus Christ were to stand up today
He'd be gunned down cold by the CIA"

- Armageddon Days are Here Again - The The
Reply With Quote
Sponsored Links
  #6  
Old May 25th, 2006
kno's Avatar
kno kno is offline
5 Cups of Ubuntu
 
Join Date: May 2006
Bean Count Hidden
Ubuntu 6.06 User
Re: How to play openGL based games with full 3D acceleration on XGL/compiz

Quote:
Would just like to add that this does NOT work with fglrx(ATI). Fglrx doesn't support acceleration on 2 X servers at once. If you try the above it'll just crash your XGL session...
Maybe fixed in the latest drivers :

Quote:
ATI 8.25.18 drivers
Resolved Issues

The following section provide a brief description of resolved issues with the latest version of the ATI Proprietary Linux driver. These include:

* Running two X servers simultaneously no longer results in the system failing to respond. Further details can be found in topic number 737-220
[...]
Reply With Quote
  #7  
Old May 25th, 2006
leech's Avatar
leech leech is offline
Fresh Brewed Ubuntu
 
Join Date: Dec 2004
Beans: 1,700
Edgy Eft Testing User
Re: How to play openGL based games with full 3D acceleration on XGL/compiz

That truly is a thing of beauty! Also another great reason to use an nVidia card over ATI. Anyone tested the latest ATI drivers to see if it will work on it?

Hopefully now that AIGLX stuff is fully in X.org 7.1, the next revision of all the nVidia and ATI drivers will have the proper extensions, and the next release of Ubuntu will have native XGL.

Speaking of which, I'm sure this has been discussed elsewhere, but with Dapper's delay, does that mean that the next Ubuntu release will be in December?

Leech
__________________
Wah! Wah!

Neverwinter Nights Platinum HowTo
My Blog

Life was more entertaining when I had 64KB of RAM in my computer.
Reply With Quote
  #8  
Old May 25th, 2006
SqRt7744 SqRt7744 is offline
5 Cups of Ubuntu
 
Join Date: Oct 2005
Location: Victoria BC Western Canada
Beans: 74
Dapper Drake Testing/ User
Send a message via ICQ to SqRt7744 Send a message via MSN to SqRt7744 Send a message via Skype™ to SqRt7744
Re: How to play openGL based games with full 3D acceleration on XGL/compiz

Quote:
Originally Posted by arnieboy
First of all, do the following:
Code:
sudo visudo
...
press ctrl-X and hit "Y" to save and exit.
this only works if nano or pico is called by visudo, but by default visudo uses vi, as the name implies. So to ensure that nano is used, your instuctions *must* look like this
Code:
export VISUAL="nano" sudo visudo
otherwise nice, thanks.
__________________
The personification of the devil as the symbol of all evil assumes the living shape of Steve Ballmer
Reply With Quote
  #9  
Old May 25th, 2006
arnieboy's Avatar
arnieboy arnieboy is online now
Tall Cafè Ubuntu
 
Join Date: Mar 2005
Location: Pennsylvania, USA
Beans: 3,216
Ubuntu 6.06 User
Send a message via AIM to arnieboy Send a message via Yahoo to arnieboy
Re: How to play openGL based games with full 3D acceleration on XGL/compiz

Quote:
Originally Posted by SqRt7744
this only works if nano or pico is called by visudo, but by default visudo uses vi, as the name implies. So to ensure that nano is used, your instuctions *must* look like this
Code:
export VISUAL="nano" sudo visudo
otherwise nice, thanks.
on Ubuntu, visudo does indeed call nano (not vi/vim).
__________________
Automatix: Just works!
Reply With Quote
  #10  
Old May 25th, 2006
QuacoreZX QuacoreZX is offline
5 Cups of Ubuntu
 
Join Date: Dec 2005
Beans: 41
Re: How to play openGL based games with full 3D acceleration on XGL/compiz

I just tried integrating this into Cedega, I do say that direct rendering DOES indeed function, but it doesn't exactly work and look how I would like it (I didn't have time to boot up a game, but the menu alone looked sorry to say the least).
Reply With Quote
Sponsored Links
Reply



Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Emulator for Windows based Games jeffreyvergara.NET Gaming & Leisure 48 6 Days Ago 03:57 PM
Linux Development Libraries(OpenGL + others) Zanza Installation & Upgrades 17 September 8th, 2006 05:36 PM
jdodsons list of uber linux games! jdodson Gaming & Leisure 211 August 21st, 2006 01:35 PM
fglrx problems = no 3d acceleration adrawer Gaming & Leisure 3 June 30th, 2006 06:23 PM
Steps to Getting 3D Games Working. jdodson Gaming & Leisure 49 November 11th, 2005 12:44 PM


All times are GMT -4. The time now is 12:41 PM.


vBulletin Version 3.6.4. ©2000 - 2006, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project.