1

I put together a simple script for running Neverwinter Nights from a separate virtual terminal:

#!/bin/bash
read -r -d '' myrcfile <<'EOF'
#!/bin/bash
cd /path/to/game
./nwn
EOF

XINITRC=<(echo "${myrcfile}") xinit -- :1 vt8

While this works, gameplay is rather choppy. For reference, it runs fine from the initial / default X instance.

I fiddled around with schedtool to see if I could make it any better, and at first it seemed I'd succeeded, but in reality the improvement wasn't because of schedtool but rather because I had [naively] done this:

sudo schedtool ${parms} -e ./nwn
^^^^

... because some of schedtool's parameters require root (note: ${parms} is various combinations of schedtool parameters). schedtool wasn't responsible for the improvement in speed -- sudo was. To ensure that was the case I replaced the final line of the inner script with gnome-terminal -c 'sudo ./nwn' and sure enough it runs flawlessly.

Does anyone have a good suggestion for how to do this?

Here's some of the things I've tried:

  • Run X under sudo, then put su -c ./nwn myusername in the script
  • Ran the game & X as my user, then ran schedtool from a separate virtual terminal w/sudo to alter the settings for the currently running process but nothing changed
    • This seems to indicate schedtool isn't going to do any good

1 Answers1

0

I just figured it out. I added myself to the video and games group. I'm not sure which one did it, but it worked.

One oddity I ran into while messing with this: before making the group change I ran glxgears instead; as root it was getting about the same FPS as if I'd ran it from the default session, but as my user it was reporting around 500fps.