Results 1 to 10 of 146

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

Threaded View

  1. #1
    arnieboy Guest

    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:
    %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:
    #!/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:
    #!/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.
    Last edited by arnieboy; May 15th, 2006 at 08:17 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •