Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Trouble with very slow rendering with nvidia under Linux


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 floatingwoods   Members   -  Reputation: 292

Like
0Likes
Like

Posted 05 February 2013 - 04:55 AM

Hello,

 

I have a cross-platform openGl application that works fine with most graphic cards. However, there are rare cases when rendering is very slow under following conditions:

- Linux (Ubuntu)

- Nvidia card (e.g. Nvidia NVS 5200 M)

 

The application runs a single thread (the main thread), and turns vsync off at the beginning (following is the Linux code to turn Vsync off):

 

typedef int (APIENTRY * AAAAGLSWAPINTERVALEXTPROC)(int);
AAAAGLSWAPINTERVALEXTPROC wglSwapIntervalEXT=(AAAAGLSWAPINTERVALEXTPROC)glXGetProcAddress((const GLubyte*)"glXSwapIntervalSGI");
if (wglSwapIntervalEXT)
{
    wglSwapIntervalEXT(0);
}

 

Rendering gets very slow because following functions seems to be blocking for several ms even with an almost empty scene content:

 

 

openglWidget->swapBuffers(); // Qt command

or/and

openglWidget->doneCurrent(); // Qt command

 

It seems that VSync could not be turned off! More strange is that following command:

 

 

export __GL_SYNC_TO_VBLANK=1

 

improves the rendering speed (but still takes around 40-50 ms for each frame).

 

what is going on here? Other platforms or other graphic cards do not have any problem at all. It is critical to be able to render as quickly as possible (disable vsync) for various reasons (e.g. rendering for generation of movie files).

 

Thanks for any insight!!

 

 

 

 



Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7789

Like
2Likes
Like

Posted 05 February 2013 - 05:13 AM

I'm not a linux expert, but under windows you often have the option to set the driver settings to overwrite application settings, including the vsync. Therefor check if your driver settings first.



#3 jmakitalo   Members   -  Reputation: 566

Like
2Likes
Like

Posted 05 February 2013 - 06:52 AM

Which drivers are you using? The default open source drivers have poor 3D performance, so make sure you have the nvidia's closed drivers installed.



#4 V-man   Members   -  Reputation: 805

Like
2Likes
Like

Posted 05 February 2013 - 08:15 AM

You should get information with glGetString and also, make sure you have the drivers from nvidia installed and not MESA3D or some other software junk.


Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

#5 Bregma   Crossbones+   -  Reputation: 5242

Like
1Likes
Like

Posted 05 February 2013 - 08:20 AM

This is a known bug in nVidia's binary blob drivers.

nVidia has been working with Valve to fix a number of performance issues. A newer (experimental) version 310 of the driver is available in the Ubuntu archives for testing with: it may solve this particular problem. On quantal this is the nvidia-experimental-310 package and on raring it's just nvidia-310. Try that and see if it solves your problem: you can always return to the default nvidia-current package if there are other problems.
Stephen M. Webb
Professional Free Software Developer

#6 solipcoder   Members   -  Reputation: 300

Like
1Likes
Like

Posted 05 February 2013 - 09:43 AM

As others have said, my guess is the driver. Check this out https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia



#7 TheChubu   Crossbones+   -  Reputation: 4548

Like
1Likes
Like

Posted 05 February 2013 - 10:32 AM

Driver 313.09 is out already.

 

http://www.phoronix.com/scan.php?page=news_item&px=MTI1MDA


Edited by TheChubu, 05 February 2013 - 10:32 AM.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#8 Bregma   Crossbones+   -  Reputation: 5242

Like
1Likes
Like

Posted 05 February 2013 - 03:34 PM

Driver 313.09 is out already.

I strongly do not recommend installing nVidia drivers directly from nVidia into Ubuntu.

(1) The nVidia drivers directly from Ubuntu are not packaged correctly: they follow the methodology of stomping all over your system without respect to the Ubuntu packaging, and it's difficult or impossible to back them out without reinstalling your system.

(2) Ubuntu tests the drivers before packaging them, and does not distribute drivers with known breakage (instead, they work with nVidia to remedy the situation in another driver release -- Canonical actually has full-time people working with nVidia to help with this).

Of course, it's your system. If you break it, you get to keep both halves.
Stephen M. Webb
Professional Free Software Developer

#9 TheChubu   Crossbones+   -  Reputation: 4548

Like
0Likes
Like

Posted 05 February 2013 - 04:07 PM

Of course, it's your system. If you break it, you get to keep both halves.

That's why I have /home on a separate partition :D

 

I did broke the graphical desktop environment a few times on Debian, just delete the nVidia script that blacklists nouveau and it works again. It wasn't because the drivers though, I had driver packages from Debian that conflicted with the ones I downloaded from nVidia.


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#10 Bregma   Crossbones+   -  Reputation: 5242

Like
0Likes
Like

Posted 05 February 2013 - 09:17 PM

I did broke the graphical desktop environment a few times on Debian, just delete the nVidia script that blacklists nouveau and it works again. It wasn't because the drivers though, I had driver packages from Debian that conflicted with the ones I downloaded from nVidia.

The "package conflict" is because Debian installs various libraries using DEB packaging and the dpkg-alternatives system, symlinking driver-specific OpenGL shared objects so they get picked up at run time. The nVidia installer does not use packaging and simply clobbers the links with real libraries. You can tweak in the kernel modules all you want, you're effectively blixened once the packaging has been clobbered unless you carefully manually remove and re-symlink all the libraries as well. Don't miss one. Also, don't forget to remove the several-versions-out-of-date xorg.conf that nVidia installs.
Stephen M. Webb
Professional Free Software Developer

#11 TheChubu   Crossbones+   -  Reputation: 4548

Like
0Likes
Like

Posted 05 February 2013 - 09:27 PM

The "package conflict" is because Debian installs various libraries using DEB packaging and the dpkg-alternatives system, symlinking driver-specific OpenGL shared objects so they get picked up at run time. The nVidia installer does not use packaging and simply clobbers the links with real libraries

Yep, I know. Had to delete a few soft links here and there (pretty much the standard approach to installing newer GCC versions too) Re installing the Debian packages should remake all the links if you want to go back. Dunno why is a big issue.

 

Anyway, whatever suits your boat. Its fun to me to install new drivers and see what's new. Somebody may want to wait until everything just works, its fine by me.


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#12 Bregma   Crossbones+   -  Reputation: 5242

Like
0Likes
Like

Posted 06 February 2013 - 06:38 AM

The "package conflict" is because Debian installs various libraries using DEB packaging and the dpkg-alternatives system, symlinking driver-specific OpenGL shared objects so they get picked up at run time. The nVidia installer does not use packaging and simply clobbers the links with real libraries

Yep, I know. Had to delete a few soft links here and there (pretty much the standard approach to installing newer GCC versions too) Re installing the Debian packages should remake all the links if you want to go back. Dunno why is a big issue.
 
Anyway, whatever suits your boat. Its fun to me to install new drivers and see what's new. Somebody may want to wait until everything just works, its fine by me.

Installing the Debian package will not restore the symlinks. That was my point. It will simply fail.

 

I don't have a problem if you like to install third-party software and tweak your system, or if you like to customize the kernel and build your own gcc -- I do it all the time.  Where the problem happens is when I have to spend time addressing complaints from someone because "someone on a forum somewhere on the web told me to do it this way and it broke my system, and now it's broken, it's your fault and Ubuntu sucks, tell me how to fix it right now."

 

So, anyone can go ahead and munge their system.  I still strongly recommend against doing so unless you already know how to recover, in which case you probably wouldn't be asking here for advice.


Stephen M. Webb
Professional Free Software Developer

#13 floatingwoods   Members   -  Reputation: 292

Like
0Likes
Like

Posted 06 February 2013 - 03:44 PM

Thanks a lot for all the pertinent replies. I'll try to look at all those possible reasons.

 

Cheers!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS