Wine is a great system to running programs, but there are many alternatives in Linux. The biggest thing people use wine for is games and the most common complain about games running under the WINE compatibility layer is performance. Naturally, most people would default to the propriety drivers to try to optimise performance, which has been the case for a long time until…
Gallium Nine, demonstrating increased performance for Direct3D 9.
To install
Install the mesa OIBAF PPA and Patched gallium wine PPA
sudo add-apt-repository ppa:oibaf/graphics-drivers sudo add-apt-repository ppa:oibaf/gallium-nine sudo add-apt-repository ppa:commendsarnex/winedri3 sudo apt-get update sudo apt-get upgrade && sudo apt-get install wine1.9
Enable
sudo apt-get install mesa-vdpau-drivers
You will need to specify to use open source drivers.
Edit Registry in Wine
Fortunately this can be done on a GUI. Run winecfg Select the Graphics tab In the 3D Acceleration group select “Prefer native Direct3D 9”
The option will not appear if your version of wine is not patched.
Recommendations
I would recommend that those using ATI/Intel drivers consider using the Gallium 3D drivers as the open source drivers are often more stable than the propriety options. As for NVIDIA cards, I recommend weighing the benefits before making the switch. Not having the latest NVIDIA propriety drivers may conflict with some games on Steam.
Update: Rendering Issue Fixes
You may have to add the following parameter which may fix some rendering issues:
thread_submit=true
So the command should look like
env WINEARCH=win32 DRI_PRIME=1 thread_submit=true wine program.exe
or on PlayOnLinux:
DRI_PRIME=1 thread_submit=true PlayOnLinux --run "filename"
(single program, you may create a shortcut for that matter)
or in the POL Console
POL_Config_Write BEFORE_WINE 'DRI_PRIME=1 thread_submit=true'
(affects all POL programs)
To uninstall PPAs
sudo apt-get install ppa-purge sudo ppa-purge ppa:oibaf/graphics-drivers sudo ppa-purge ppa:oibaf/gallium-nine sudo ppa-purge ppa:commendsarnex/winedri3
Edit: Code modified to reflect version 1.9 for WINE. Thanks sarnex.
Tried it and for some reason apps would randomly render correctly or black (easy to test repeatedly executing glxgears). This issue disappeared after switching to Xrender in kde compositing. Still, when trying to use the Gallium Nine enabled wine the performance was really poor compared to regular wine with the propietary drivers. It may be because I have an Optimus laptop.
@ Eduard
The performance depends on what game you are playing on () as well as what card you have. Having an optimus laptop means you need to install the both the Nvidia and Intel open drivers and use a program like bumblebee or nvidia-prime to switch to the Nvidia card. Personally I use nvidia-prime as I prefer better control. I don’t want my Nvidia card to be lying in wait to start without my permission and I do play some games on the integrated card to save battery. There are fixes to solve rendering issues too, see updated post.
@P-Meister
You are entirely right it may be game-specific, I did my tests on Rift and I did use the nouveau driver, checking with glxinfo that the environment variable DRI_PRIME set to 1 did actually enable it. I will try your proposed solution for the rendering glitches and see how it performs switching back composition to opengl.
Question: is it possible to enable the Nvidia card by default without having to set the DRI_PRIME variable each time for each app? Afaik I could only do that with the propietary driver and nvidia-prime.
@Cfuzz
Apologies, i forgot nvidia-prime and bumblebee only worked with the propriety drivers, the open source cards offer DRI_PRIME=1 as the only method of activating the Nvidia card which is extremely inelegant. The open source nouveau drivers are sub-par to the propriety drivers in most cases based on experience. Only limited number of games benefit from the set-up.
I am regular reader, how are you everybody? This paragraph posted at this web site is really
nice.
I have noticed you don’t monetize your website, don’t waste your traffic, you can earn extra cash
every month because you’ve got high quality content. If
you want to know how to make extra $$$, search for: best adsense alternative
Wrastain’s tools
Tell us about your achievements in the previous place.