|
|
| allegro 5 seems really slow when using nvidia drivers on ubuntu |
|
japheth
Member #9,327
December 2007
|
I've been working on a 2d game in allegro for a while and it's been running fine in ubuntu (I believe using the mesa open-source drivers. I recently decided to install the nvidia drivers so I could do some OpenGL programming. I use "sudo apt-get install nvidia-current nvidia-current-updates" to get the nvidia drivers and "sudo /etc/init.d/lightdm restart" to start using them, as per method 2 in http://www.dedoimedo.com/computers/ubuntu-ringtail-nvidia.html When I complete these steps, restart my computer, and run my game, it runs much more slowly. Clicking on buttons (e.g. the quit button) or typing text in a textbox requires 5-10 sec before I see the result of my mouse click or keypress. Running "sudo apt-get purge nvidia*" followed by "sudo dpkg-reconfigure -phigh xserver-xorg" to remove the nvidia drivers fixes the issue. I'm running ubuntu 13.10 and currently using allegro 5.0 and I have the latest version of that. Any help resolving this very perplexing issue would be greatly appreciated. I'd be happy to provide any other info that would be useful for tracking this down. EDIT: I'm compiling allegro 5 as a static library and using ccmake, in case that makes a difference. |
|
Thomas Fjellstrom
Member #476
June 2000
|
When you have the nvidia binary drivers installed, you'll want to check to see if you have Direct Rendering enabled in the output of glxinfo. ex: user@host:~$ glxinfo | grep "direct rendering" direct rendering: Yes If it isn't enabled, your GL setup isn't quite complete, and you may need to install the nvidia xserver drivers (xserver-xorg-video-nvidia) as well. if it helps, this is the list of packages I have set up: user@host:~# aptitude search nvidia | grep ^i i A glx-alternative-nvidia - allows the selection of NVIDIA as GLX prov i A libgl1-nvidia-glx - NVIDIA binary OpenGL libraries i A libnvidia-ml1 - NVIDIA Management Library (NVML) runtime l i A nvidia-alternative - allows the selection of NVIDIA as GLX prov i nvidia-driver - NVIDIA metapackage i A nvidia-installer-cleanup - cleanup after driver installation with the i A nvidia-kernel-common - NVIDIA binary kernel module support files i A nvidia-kernel-dkms - NVIDIA binary kernel module DKMS source i A nvidia-settings - tool for configuring the NVIDIA graphics d i A nvidia-support - NVIDIA binary graphics driver support file i A nvidia-vdpau-driver - NVIDIA vdpau driver i nvidia-xconfig - X configuration tool for non-free NVIDIA d i A xserver-xorg-video-nvidia - NVIDIA binary Xorg driver All packages with "i A" next to them are automatically installed dependencies. So ones without A were manually installed. I just installed "nvidia-driver" and it seemed to work for me. -- |
|
japheth
Member #9,327
December 2007
|
Running glxinfo indicated that direct rendering was enabled. However, the packages I get when doing aptitude search are pretty different. They are as follows: aptitude search nvidia | grep ^i i A nvidia-304-updates - NVIDIA binary Xorg driver, kernel module a i A nvidia-304-updates-dev - NVIDIA binary Xorg driver development file i nvidia-current-updates-dev - Transitional package for nvidia-current-up i A nvidia-settings-304-updates - Tool for configuring the NVIDIA graphics d I discovered the nvidia-current-updates-dev package since my first post and installed that, but that didn't change anything. |
|
Thomas Fjellstrom
Member #476
June 2000
|
I guess ubuntu heavily customizes the binary driver packages. Annoying really. I'm not entirely sure what's wrong, other than the libGL.so library being the wrong library. It has to point at the right driver... Using the nouveau libGL with the nvidia binary driver isn't going to work, and vice-versa. see if theres a package for the nvidia driver that includes libGL.so -- |
|
japheth
Member #9,327
December 2007
|
I forgot to mention in my original post that after installing the nvidia drivers, my opengl code (that doesn't use allegro at all) works very well. So my situation is that without the nvidia drivers, allegro works fine, but opengl doesn't work at all (which makes sense), but with the drivers, opengl works correctly, but my allegro program is very slow. When I have time, I'll try going through my allegro program o isolate the smallest code sample that still has that problem |
|
|