# VirtualGL +  Wine



## jjjesss (Jul 9, 2018)

Hi:

I'm able to run VirtualGL in my FreeBSD 11.2 64bit. But I can't with wine. My intention is to be able to run windows applications that requires 3d acceleration, but it seems there's some problem with glx. When execute the windows application with vglrun the wine window opens and shows an error message, and in the console (where I run vglrun) I can read the following:


```
Xlib:  extension "GLX" missing on display ":0".
0009:err:wgl:X11DRV_WineGL_InitOpenglInfo  couldn't initialize OpenGL, expect problems
```

Other apps like VirtualBox seems to have 3D accel enabled when run with vlgrun. 

In linux forums and in the ArchWiki it seems that *lib32-virtualgl* is needed. But I can't figure out how to accomplish this in FreeBSD 64bit. Any idea?

Thanks in advance,

Jes


----------



## shkhln (Jul 9, 2018)

You'll have to compile 32-bit VirtualGL yourself or fetch i386 package manually and extract shared libs from that.



jjjesss said:


> ArchWiki it seems that *lib32-virtualgl* is needed.



This would be a good question for one of the FreeBSD mailing lists. The Ports Collection doesn't contain any lib32- ports. Unlike ArchLinux situation, _there exists no convention or guidelines_ for multilib packages. It's not obvious how 32-bit VirtualGL should be packaged. (Flavor? Slave port? Port option?)

It's not at all difficult, it just never has been done.


----------



## jjjesss (Jul 9, 2018)

I've thought in the 32bit package, in fact I've downloaded, but the libs are named equal as the 64bit. Where shoud I place them?, should I rename them?. 

Contents of the 32bit package are:


----------



## shkhln (Jul 9, 2018)

If you don't know where place something, place it in /opt 

Also note that Linux uses LD_LIBRARY_PATH for both 32-bit and 64-bit libs, while FreeBSD uses LD_32_LIBRARY_PATH for 32-bit libs and LD_LIBRARY_PATH for 64-bit libs. Vglrun script might need some adjustment.


----------



## jjjesss (Jul 9, 2018)

Thanks shkhIn, but I'm not able to success in this. I'll keep trying it. 

Thanks again,

Jes


----------



## shkhln (Jul 9, 2018)

Would you mind clarifying the context of your initial question? What are you trying to accomplish?


----------



## jjjesss (Jul 9, 2018)

To execute a windows application with wine but with 3D acceleration. So I launch a X server with xorg.conf.nv in display 8, and then run the app with wine as follows:


```
/usr/local/VirtualGL/bin/vglrun -d ":8" wine myapplication
```

myapplication needs 3D acceleration to be executed. In another computer, a T420 with nvidia, starting session with nvidia, virtualgl is not needed.

In my current laptop, a T440 with optimus, I can't start my X session with nvidia, only with intel. So I need virtualgl.

But it seems virtualgl can't run 32bit apps with acceleration. My wine is the i386-wine. 64bit wine can't make use of the nvidia card for accel.

So, the previous command, with vglrun to execute wine and myapplication, throws an error in the console like:


```
Xlib:  extension "GLX" missing on display ":0".
0009:err:wgl:X11DRV_WineGL_InitOpenglInfo  couldn't initialize OpenGL, expect problems
```

BR


----------



## shkhln (Jul 9, 2018)

For what it's worth, I have the following script from playing around with VirtualGL yesterday (hey, it's only a coincidence):

```
#!/bin/sh
export LD_32_LIBRARY_PATH=/compat/i386/usr/local/VirtualGL/lib:/usr/local/lib32:/compat/i386/usr/local/lib
export LD_32_PRELOAD=librrfaker.so
export VGL_LOGO=1
exec /compat/i386/usr/local/bin/glxgears
```

(The /compat/i386 directory has been set up according to https://wiki.freebsd.org/i386-Wine.)



jjjesss said:


> 64bit wine can't make use of the nvidia card for accel.



It should be able to. How exactly did it fail?


----------



## jjjesss (Jul 9, 2018)

Thanks, I'll test vglrun with a script like yours.

About 64bit wine... I don't know the reason but only with the i386-wine, and after run /usr/local/share/wine/patch-nvidia.sh I'm able to get 3d accel in the windows application. And the windows application is a 32bit one. With 64bit  there's no (if I remember well) patch-nvidia.sh script. 

Thanks again, BR


----------



## shkhln (Jul 9, 2018)

jjjesss said:


> About 64bit wine... I don't know the reason but only with the i386-wine, and after run /usr/local/share/wine/patch-nvidia.sh I'm able to get 3d accel in the windows application.



Nvidia or Intel 3d acceleration?



jjjesss said:


> With 64bit  there's no (if I remember well) patch-nvidia.sh script.



The only reason patch-nvidia.sh script exists is that Nvidia doesn't provide 32-bit libGL.so.1 and other 32-bit libs as part of their 64-bit driver package. There is no need to download 64-bit libGL, it's already included. The port might not be sufficiently tested in Optimus scenario, though. Specifically, I'm not sure what effect /usr/local/etc/libmap.d/nvidia.conf would produce in a such situation.


----------

