# nvidia on x64 asks for glx



## Beeblebrox (May 10, 2011)

I managed to install emulators/wine on my x64 system - sweet 
I also installed x11/nvidia-driver.  But now when I try running some wine app I get an OpenGL error:

```
[blah-blah]
err:winediag:X11DRV_WineGL_InitOpenglInfo Direct rendering is disabled, 
most likely your OpenGL drivers haven't been installed correctly
err:d3d_caps:WineD3D_CreateFakeGLContext Can't find a suitable iPixelFormat.
err:d3d:InitAdapters Failed to get a gl context for default adapter
Direct3D8 is not available without OpenGL.
[/blah-blah]
```
grphics/libglut is installed, but I still get

```
glxinfo: Command not found
```
I know / suppose *nvidia* runs through 32bit emul, and I have 32bit support and linux in the kernel, so it should already be in sys?  /usr/loca/lib32 folder is also there. How does 9.0-CURRENT handle glx?
lost now


----------



## tbyte (May 10, 2011)

Did you set up Xorg to use nvidia's driver? 

glxinfo is part of mesa-demos-7.4.4 port not glut.


----------



## SirDice (May 11, 2011)

Have a look in /var/log/Xorg.0.log and make sure the glx module that's loaded is from NVidia:

```
(II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
(II) Module glx: vendor="NVIDIA Corporation"
        compiled for 4.0.2, module version = 1.0.0
        Module class: X.Org Server Extension
(II) NVIDIA GLX Module  270.41.03  Sat Apr  9 00:19:21 PDT 2011
(II) Loading extension GLX
```

It may have been overwritten by the standard Xorg one. If that happened try reinstalling the nvidia-driver.


----------



## Beeblebrox (May 11, 2011)

OK, I got a little farther with this:  As I suspected, but forgot to mention, OpenGL has x64 version installed, while nvidia is wanting the 32 bit version. From Xorg.log:

```
(II) LoadModule: "glx"
(II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
(II) Module glx: vendor="NVIDIA Corporation"
	compiled for 4.0.2, module version = 1.0.0
	Module class: X.Org Server Extension
(II) NVIDIA GLX Module  256.53
```
OpenGl loads fine, but when trying to use it I get this.

```
Error: couldn't find RGB GLX visual or fbconfig
```
So how can I fix this version error and point to a 32 bit glx lib?

@ Sir Dice: posting at the exact same time freezes the thread


----------



## SirDice (May 11, 2011)

What makes you think the nvidia driver is 32 bit?


----------



## Beeblebrox (May 11, 2011)

I was thinking that the driver is 64 bit and that nvidia actually wants the 32 bit - this from posts in linux forums when I searched for the specific error listed above.  But now from the Xorg.log I have contradictory information:

```
(II) NVIDIA(0): Virtual screen size determined to be 1024 x 768
(--) NVIDIA(0): DPI set to (83, 84); computed from "UseEdidDpi" X config
(--) NVIDIA(0):     option
(==) NVIDIA(0): Enabling 32-bit ARGB GLX visuals.
```

EDIT: The more I dig, the more I find.  My card is a GeForce 6200 TurboCache model 16-TC which is a 32 bit card.  The installed kernel though:

```
hw.nvidia.version: NVIDIA UNIX x86_64 Kernel Module
```
How can I switch to 32 bit driver?


----------



## SirDice (May 11, 2011)

Beeblebrox said:
			
		

> ```
> (==) NVIDIA(0): Enabling 32-bit ARGB GLX visuals.
> ```


This has nothing to do with 32/64 bit code. It's a 32 bit color depth.



> EDIT: The more I dig, the more I find. My card is a GeForce 6200 TurboCache model 16-TC which is a 32 bit card.


Again, this has nothing to do with 32/64 bit code.



> How can I switch to 32 bit driver?


You can't.


----------



## Beeblebrox (May 11, 2011)

Funny! I'm not insisting on switching or anything; just trying in my limited way to find a solution.  Do you have any suggestions how I can solve this?


----------



## SirDice (May 11, 2011)

I have no idea, I have no use for wine, 32 bit or otherwise.


----------



## tbyte (May 11, 2011)

Did you manage to actually install mesa-demos and test glxinfo (*glxinfo | grep 'direct rendering'*)? And what does it say?


----------



## poh-poh (May 14, 2011)

Beeblebrox said:
			
		

> I know / suppose *nvidia* runs through 32bit emul, and I have 32bit support and linux in the kernel, so it should already be in sys?  /usr/local/lib32 folder is also there. How does 9.0-CURRENT handle glx?


As 32bit supporting libs (libGL.so, libnvidia-glcore.so, etc.) are not shipped with x86_64 nvidia driver you have to install them from x86 one and at the same location/chroot wine was installed.


----------



## Beeblebrox (May 16, 2011)

@ poh-poh: You are right with your diagnostic. I first re-installled the NVidia driver, that got GLX working, got rid of direct rendering problems and this error:

```
Error: couldn't find RGB GLX visual or fbconfig
```
To make sure, I installed some FreeBSD ports using / requiring GLX and they are working fine (with several exceptions giving "out-of-range" error for the screen setting, and now I have to look into correcting that!!)  It was then apparent that the error was in the wine setting configuration, as SirDice had advised.

Re how to correct wine: The unfortunate part of your suggestion is that I did not install wine with chroot, I just went to Wine builds for AMD64 and installed from the pre-built - so no chroot exists, this port placed wine into /usr/local/bin/wine.  I presume the issue is not solvable unless wine is placed in a chroot?

EDIT:  What I think is going on (and please feel free to correct): Although I have the amd64 build for wine installed, I am not sure if it is 100% 64 build, or if it's a fused port with some parts of it running 32 bit.  Even if the port itself is 100% 64 bit, I believe that wine goes through the Linux emulation layer (?) That would by definition force wine to be 32 bits in some places since as of yet, there is no 64 bit linux on FreeBSD.  So maybe I could place the 32bit drivers under the /compat/linux layer?


----------



## nekoexmachina (May 23, 2011)

You need to install nvidia's libGL and other libs into /usr/local/lib32.

My /usr/local/lib32 with only wine installed has:

```
libGL.so
libGL.so.1
libGLU.so
libGLU.so.1
libICE.so.6
libSM.so.6
libX11-xcb.so.1
libX11.so.6
libXau.so.6
libXdamage.so.1
libXdmcp.so.6
libXext.so.6
libXfixes.so.3
libXrender.so.1
libXvMCNVIDIA.a
libXvMCNVIDIA.so.1
libXxf86vm.so.1
libaudiofile.so.0
libdrm.so.2
libesd.so.2
libfreetype.so.9
libglx.so.1
libiconv.so.3
liblcms.so.1
libnvidia-cfg.so.1
libnvidia-glcore.so.1
libnvidia-tls.so.1
libpng.a
libpng.so
libpng.so.6
libpthread-stubs.so.0
libvdpau.so.1
libvdpau_nvidia.so.1
libvdpau_trace.so.1
libwine.so
libwine.so.1
libxcb-glx.so.0
libxcb.so.2
libxml2.so.5
nvidia-bug-report.sh
nvidia-settings
nvidia-xconfig
nvidia_drv.so
wine
```


----------

