# how to game on freebsd



## ericbsd (Mar 17, 2009)

i install cube yesterday the game  work but lag and after that i install nvidia drivers and configure Xorg for support nvida.
i restart and can't play the game the game dont start i install sauerbraten dont dont start to. how freebsd is lame about gaming. linux is bether for that. excuse but is true.after all it made for maintain server. not for gaming i spend 1 year to understans freebsd an i cant *beep**beep**beep**beep*ing play my game. like freebsd for the reste but like linux for gaming.


----------



## SirDice (Mar 17, 2009)

^ incoherent rant.
You might want to add some punctuation and capitalize the first letter of a sentence..

How did you install cube? What error messages are you getting when starting the game?


----------



## DutchDaemon (Mar 17, 2009)

Agree with SirDice. Please put some effort into writing your posts. I wanted to say "put the same effort into it as you put into understanding and configuring FreeBSD", but I'm unsure about the outcome.


----------



## ericbsd (Mar 17, 2009)

I install cube yesterday the game work but lag. After that I install nvidia drivers. I configure Xorg for support nvida. I restart My and can't play cube, the game does not start. I install sauerbraten it dont start to. how freebsd is lame about gaming. linux is bether for that. Excuse but is true.after all it made for maintain server. Not for gaming! I spend 1 year to understans freebsd and I can't play my game. I like freebsd for the reste. But I like linux for gaming.


----------



## DutchDaemon (Mar 17, 2009)

What is the output of


```
grep GLX /var/log/Xorg.0.log
```

?

You should see the NVIDIA GLX module in there, not Xorg's.


----------



## ericbsd (Mar 17, 2009)

Like I said before I install nvidia driver cube work  but the game lag. After I install the drivers the gme dont start at all. I never try to game on freebsd.


----------



## SirDice (Mar 17, 2009)

"It doesn't work" doesn't tell me anything. It's pretty hard to diagnose the problem if you don't supply any information.


----------



## DutchDaemon (Mar 17, 2009)

NVIDIA and Xorg's nv driver install files in the same place, which can kill NVIDIA's GLX module and impede e.g. XScreensaver's OpenGL modules .. and maybe a game based on OpenGL. But never mind the responses ..


----------



## ericbsd (Mar 17, 2009)

Ok I reinstall freebsd because I try to install something and try to do a live cd and did something bad. I had  to install back. I have to go work now!! But after work I gone give you all you need to help me. Thanks for your time!!!


----------



## tangram (Mar 17, 2009)

It would help if you post you xorg.conf, rc.conf, loader.conf, dmesg and Xorg.0.log.

I play/played Enemy Territory, RTCW and Quake 3 under FreeBSD and aside from some library stuff they all work at almost the same speed as in Linux.

So don't give up


----------



## ericbsd (Mar 18, 2009)

Ok yesterday  install cube by the command:

```
pkg_add -r cube
```
I start cude an its work but 3 frame sec or somting like.
After that I install nvidia driver.
After I reboot
After I did

```
Xorg -configure
Xorg -config xorg.conf.new
cp xorg.conf.new /etc/X11/xorg.conf
```
I reboot again. I start gdm. I see nvidia. I log and I try to start cube but noting append no error no game start noting!!!


----------



## alie (Mar 18, 2009)

Please give us ur Xorg.0.log after you run cube


----------



## ericbsd (Mar 18, 2009)

that my Xorg.0.log after I run cube
http://pastebin.com/m9a9b588


----------



## ericbsd (Mar 18, 2009)

that my /etc/X11/xorg.conf

```
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	RgbPath      "/usr/local/share/X11/rgb"
	ModulePath   "/usr/local/lib/xorg/modules"
	FontPath     "/usr/local/lib/X11/fonts/misc/"
	FontPath     "/usr/local/lib/X11/fonts/TTF/"
	FontPath     "/usr/local/lib/X11/fonts/OTF"
	FontPath     "/usr/local/lib/X11/fonts/Type1/"
	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
	Load  "dbe"
	Load  "dri"
	Load  "extmod"
	Load  "glx"
	Load  "record"
	Load  "xtrap"
	Load  "freetype"
	Load  "type1"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/sysmouse"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
	Identifier  "Card0"
	Driver      "nvidia"
	VendorName  "nVidia Corporation"
	BoardName   "Unknown Board"
	BusID       "PCI:0:18:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection
```


----------



## ericbsd (Mar 18, 2009)

my rc.conf

```
# -- sysinstall generated deltas -- # Tue Mar 17 12:02:50 2009
# Created: Tue Mar 17 12:02:50 2009
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
gateway_enable="YES"
hostname="corpse.org"
ifconfig_nfe0="DHCP"
keymap="us.iso"
linux_enable="YES"
moused_enable="YES"
moused_type="auto"
sshd_enable="YES"
hald_enable="YES"
dbus_enable="YES"
```


----------



## ericbsd (Mar 18, 2009)

and loader.conf

```
nvidia_load="YES"
linux_load="YES"
```


----------



## ericbsd (Mar 18, 2009)

Thanks for your help and support in advance.


----------



## SirDice (Mar 18, 2009)

Open an xterm and enter cube_client on the commandline. What's the output of that?

I compiled cube last night on a not so pristine system. It started without any problems. Here's what mine says:

```
dice@williscorto:~>cube_client 
Using existing ~/.cube directory.
init: sdl
init: net
init: world
game mode is ffa/default
init: video: sdl
init: video: mode
init: video: misc
init: gl
init: basetex
init: sound
sound init failed (SDL_mixer): Couldn't set audio blocking mode
init: cfg
init: localconnect
init: mainloop
read map packages/base/metl3.cgz (245 milliseconds)
Cyclops by metlslime
game mode is ffa/default
```

(ignore the error about sound for a minute, that's my problem  )


----------



## SirDice (Mar 18, 2009)

ericturgeon said:
			
		

> my rc.conf


If your system isn't used as a router that *gateway_enable="YES"* can be removed.

Your hostname isn't correct either, it should be something like
*hostname=myhost.mydomain.tld*

Non of this will help with the game though but while we're helping we might as well set everything else correct too :e


----------



## SirDice (Mar 18, 2009)

ericturgeon said:
			
		

> that my Xorg.0.log after I run cube
> http://pastebin.com/m9a9b588



This doesn't look good:

```
#
(II) LoadModule: "glx"
#
(II) Loading /usr/local/lib/xorg/modules/extensions//libglx.so
#
dlopen: Shared object "libc.so.5" not found, required by "libGLcore.so.1"
#
(EE) Failed to load /usr/local/lib/xorg/modules/extensions//libglx.so
#
(II) UnloadModule: "glx"
#
(EE) Failed to load module "glx" (loader failed, 7)
```


```
#
(EE) NVIDIA(0): Failed to initialize the GLX module; please check in your X
#
(EE) NVIDIA(0):     log file that the GLX module has been loaded in your X
#
(EE) NVIDIA(0):     server, and that the module is the NVIDIA GLX module.  If
#
(EE) NVIDIA(0):     you continue to encounter problems, Please try
#
(EE) NVIDIA(0):     reinstalling the NVIDIA driver.
```

Which is probably why the game doesn't work.

What does *ls -l /usr/local/lib/xorg/modules/extensions/* say?


----------



## ericbsd (Mar 18, 2009)

is say

```
corpse# ls -l /usr/local/lib/xorg/modules/extensions/
total 4344
-rwxr-xr-x  1 root  wheel      838 Sep  8  2008 XXX-libGLcore.la.%%.orig-20090317
-rwxr-xr-x  1 root  wheel  2420426 Sep  8  2008 XXX-libGLcore.so.%%.orig-20090317
-rwxr-xr-x  1 root  wheel      820 Sep  8  2008 XXX-libglx.la.%%.orig-20090317
-rwxr-xr-x  1 root  wheel   430986 Sep  8  2008 XXX-libglx.so.%%.orig-20090317
-rwxr-xr-x  1 root  wheel      820 Sep  8  2008 libdbe.la
-rwxr-xr-x  1 root  wheel    19843 Sep  8  2008 libdbe.so
-rwxr-xr-x  1 root  wheel      863 Sep  8  2008 libdri.la
-rwxr-xr-x  1 root  wheel    41509 Sep  8  2008 libdri.so
-rwxr-xr-x  1 root  wheel      838 Sep  8  2008 libextmod.la
-rwxr-xr-x  1 root  wheel   152792 Sep  8  2008 libextmod.so
lrwxr-xr-x  1 root  wheel       11 Mar 17 22:25 libglx.so -> libglx.so.1
-r--r--r--  1 root  wheel  1226456 Mar 17 22:25 libglx.so.1
-rwxr-xr-x  1 root  wheel      838 Sep  8  2008 librecord.la
-rwxr-xr-x  1 root  wheel    28757 Sep  8  2008 librecord.so
-rwxr-xr-x  1 root  wheel      832 Sep  8  2008 libxtrap.la
-rwxr-xr-x  1 root  wheel    40378 Sep  8  2008 libxtrap.so
corpse#
```


----------



## DutchDaemon (Mar 18, 2009)

See also some posts here:
https://forums.freebsd.org/showthread.php?t=1721&highlight=glx&page=2


----------



## SirDice (Mar 18, 2009)

^^ looks good..

I have a feeling you're missing the compat5x libraries...

If *pkg_info -x compat5x-i386* doesn't find anything, you will need to install it.

*pkg_add -r compat5x-i386* or *cd /usr/ports/misc/compat5x && make install clean*

Also make sure you have *options COMPAT_FREEBSD5* in your kernel config (GENERIC has this by default).


----------



## DutchDaemon (Mar 18, 2009)

In case you want to check for it before you begin: it should be at /usr/local/lib/compat/libc.so.5


----------



## ericbsd (Mar 18, 2009)

/usr/local/lib/compat/libc.so.5
I don't have it.


----------



## SirDice (Mar 18, 2009)

You're missing misc/compat5x. How did you install the nvidia driver? The port should have pulled compat5x in.


----------



## ericbsd (Mar 18, 2009)

I install compat5x and I try to start cube noting happen.


----------



## ericbsd (Mar 18, 2009)

instal my drivers by nvidia.com I alwais go for the last drivers.


----------



## adamk (Mar 18, 2009)

ericturgeon said:
			
		

> I install compat5x and I try to start cube noting happen.



Did you restart X after installing compat5x?

Adam


----------



## adamk (Mar 18, 2009)

If you are going to go outside the ports tree to install your drivers, you can't blame FreeBSD because *you* didn't install all the necessary dependencies.  

Adam


----------



## ericbsd (Mar 18, 2009)

OK tanks all! for your help! I come from windowshit and all it easy do but boring. Freebsd rest My number 1, linux nuber 2,opensolaris # 3 and winshit i dont wont know about.
1 ting do you ting i can install rise of nation with Wine? I try on linux but wine don't start the installation.
thanks for all.


----------



## SirDice (Mar 18, 2009)

ericturgeon said:
			
		

> instal my drivers by nvidia.com I alwais go for the last drivers.



Unless you have a specific reason to use the latest one from nvidia, use the one in the ports tree for the time being. At least until you have a clearer understanding of the needed dependencies. 

*cd /usr/ports/x11/nvidia-driver && make install clean*


----------



## Carpetsmoker (Mar 18, 2009)

SirDice said:
			
		

> Unless you have a specific reason to use the latest one from nvidia, use the one in the ports tree for the time being. At least until you have a clearer understanding of the needed dependencies.
> 
> *cd /usr/ports/x11/nvidia-driver && make install clean*



You don't need to reinstall the nVidia driver, you can (probably) get away by running a _make depends_ for x11/nvidia-driver, the port doesn't do any real patching.

ericturgeon, you say FreeBSD is not a gaming OS, I think you are right about that ... So why try and use FreeBSD as a gaming OS anyway?


----------



## SirDice (Mar 18, 2009)

If I want to try the latest (or the new beta) I just hack the port's Makefile a bit. It's usually only a matter of changing a few version numbers. That way the pkgtools can keep track of the version I've got installed.


----------



## Mel_Flynn (Mar 21, 2009)

Once you got nvidia driver working, for gaming you want to add the following to your xorg.conf:
In Section Screen:
    Option         "RenderAccel" "True"
    Option         "NoRenderExtension" "False"
    Option         "NoFlip" "False"
    Option         "UseEdid" "True"
    Option         "NvAGP" "1"

If your motherboard has AGP, add to /boot/device.hints:
hint.agp.0.disabled="1"

and reboot.
Alternatively, install /usr/ports/x11/nvidia-xconfig and read through the manpage. It can update your xorg.conf with driver settings specific to nvidia, at the right spot.


----------



## lyuts (Mar 22, 2009)

lrwxr-xr-x  1 root  wheel       11 Mar 17 22:25 libglx.so -> libglx.so.1
-r--r--r--  1 root  wheel  1226456 Mar 17 22:25 libglx.so.1

you have these two libs which are unable to be loaded. Note that libglx.so.1 has only read permissions. It should be executable. Try to do this

chmod 555 libglx.so.1

and run your game again.


----------



## ericbsd (Mar 25, 2009)

enough it all runs good. I read all the files and I understand it now.


----------

