Skip to main content

repainting woes with new nvidia drivers 190.38

21 replies [Last post]
mikofclassx
Offline
Joined: 2003-07-02

Hello all at Java2D.

I'm experiencing some repaint problems after installing the new NVidia drivers 190.38 on my XP wintel. The problems have been replicated on many systems with the equal drivers and different NVidia boards.

The problem happens while moving or resizing a JFrame: pieces of the jframe contents appear randomly inside.

Disabling the ddraw pipeline (-Dsun.java2d.noddraw=true) fixes the problem.
The problem can be replicated on jdk1.5.x and 1.6.x.

Of course I have a piece of code for your tests. Just ask for it..

Cheers,

Mik of ClassX

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
philallen
Offline
Joined: 2008-11-26

I have contacted nvidea and they have replied:

Your case is being escalated to our Level 2 Tech Support group. The Level 2 agents will review the case notes. As this process may take some time we ask that you be patient and a Level 2 tech will contact you as soon they can to help resolve your issue.

:-)

Phil

mikofclassx
Offline
Joined: 2003-07-02

That's a positive reply from NVidia. Let's see..
Sadly we have still no comments from the Java2D architects.

demonduck
Offline
Joined: 2008-03-14

I don't think there are any Java2D architects. No one from that group has told me to go away for over two months. Usually, they are the first to reply in a hostile fashion.

mikofclassx
Offline
Joined: 2003-07-02

Did someone try the new 195.39 beta drivers (October 29, 2009) ?

arqarq
Offline
Joined: 2009-09-08

195.55 driver fixes this

mikofclassx
Offline
Joined: 2003-07-02

Very good news. Let's wait for the final release from NVidia.

mikofclassx
Offline
Joined: 2003-07-02

NVidia drivers 195.62 WHQL (final) are out now.

philallen
Offline
Joined: 2008-11-26

I have the same problem, which I solved by uninstalling the new nvidea driver and re-installing driver version 6.14.11.7516, which is what my card came with

swpalmer
Offline
Joined: 2003-06-10

I've seen similar issues with 1.6.0_14 that go away when 1.6.0_10 is used instead. It may be the same issue, but you indicate that you see this with 1.5.x and 1.6.x. Have you tested with specific updates of 1.6?

mikofclassx
Offline
Joined: 2003-07-02

Yes, I tested several versions and I always replicated the same behavior.

mikofclassx
Offline
Joined: 2003-07-02

I reported the bug to SUN the day 27 of august 2009 (internal review ID of 1595041). Sadly I didn't receive any followup.

By this time I was able to replicate the bug on any NVidia based wintel machine I put my hands on.

I'm just curious to know if someone of you tested the above code.

Mik

arqarq
Offline
Joined: 2009-09-08

I reported this bug to Sun (Review ID: 1599956) and also to nVidia. No info from Sun to date; waiting for newer drivers release from nVidia. Bug is also present on current 190.62 drivers. Tested on my C2D E8200, GF9600GT, Win x64 (32 and 64bit JREs affected).
I quess this is related to more current nVidia hardware (8, 9 and 2xx series) because on old GF 6200 TurboCache everything works OK (PC in my work, WinXP SP3, JRE 6u16).
If Adobe CS3 Premiere is not working, report it to Adobe too.

Regards

mikofclassx
Offline
Joined: 2003-07-02

Sun accepted my bug report.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6880285

About Adobe Premiere CS3, I have done further testing and discovered a different problem, originated by a PCI-Express board conflict. It was just a coincidence. Removing the board the CS3 issue disappeared. But not the Java2D problem.

Cheers,

Mik

arqarq
Offline
Joined: 2009-09-08

same here

I wonder which one will bring the solution (I hope) - new JRE update or new nVidia drivers release.

Regards

demonduck
Offline
Joined: 2008-03-14

> same here
>
> I wonder which one will bring the solution (I hope) -
> new JRE update or new nVidia drivers release.
>
> Regards

If it truly is an nVida driver problem -- then report it to nVida. Why would you assume that every software development team would spend the time to come up with a workaround for a problem that can be fixed by the team that created the problem.

arqarq
Offline
Joined: 2009-09-08

can you read? 4 posts above you can see that I reported it to nVidia too; and I'm not the first person to report it to Sun (3 posts above). The idea to report it also to Sun is their cooperation with nVidia (if any?) or some kind of... pressure? Don't be worry, I'm asking other people to report it to nVidia too, here's the prove:
http://forums.nvidia.com/index.php?showtopic=103120&start=0&p=570831&#en...

But for now I don't believe for any proper solution:
- Sun gave this bug low priority, despite java2D is using D3D by default now and it is related to many (almost all?) machines worldwide (GeForce 8, 9, 200? phew... is anybody using theese? :) )
- nVidia drivers beta releases 190.64, 190.89 and latest 191.03 are not solving this issue; so I guess next WHQL release will not too.
...so who cares - SNAFU

True workaround is to set "-Dsun.java2d.d3d=false" in JRE's Control Panel (yeah, why using D3D, what for? :) )

"Why would you assume that every software development team would spend the time to come up with a workaround for...?"
because when Sun decided to develop D3D acceleration in Java, it's their obligation to check (occasionally?) how it's working on current devices on market.
And for what they've spent "the time" to develop it? To disable it in Control Panel?

mikofclassx
Offline
Joined: 2003-07-02

I think it's really hard to say if the bug is in the NVidia implementation or in Java2D.
What I can say is that other applications, even graphics intensive ones, do not give any sign of problem with the new NVidia drivers. This is not an evidence, btw.

More: what I've experienced when D3D is enabled is a nasty behavior of JComboBox into a JDialog. If the combo list opens outside the JDialog bounds, the whole application repaint()s become very slow. And this happens on ATI (no time to test on NVidia at the moment).
Disabling D3D is the only cure for the slowdown. I'm trying hard to build a testcase for this behavior. It took me more than a while to understand that D3D was the problem..

Mik

mikofclassx
Offline
Joined: 2003-07-02

Also tested with the latest 191.07 drivers. Same problem.

mikofclassx
Offline
Joined: 2003-07-02

Ok, here's the test code. I have verified that the problem happens when the frame exceeds 512 pixels width or height. This is a good indication in order to find and squash the bug!

[code]
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;

/**
* @author Mik
*/
public class TransparentBackground extends JComponent implements ComponentListener, WindowFocusListener, Runnable
{
// set to TRUE to disable DDRAW
private static final boolean NODDRAW = false;

// set to true to enable blurring effect
private static final boolean BLUR = false;

private JFrame _frame;
private BufferedImage _background;
private long _lastUpdate = 0;
private boolean _refreshRequested = true;
private Robot _robot;
private Rectangle _screenRect;
private ConvolveOp _blurOp;

public TransparentBackground(JFrame frame)
{
_frame = frame;
try
{
_robot = new Robot();
}
catch (AWTException e)
{
e.printStackTrace();
return;
}
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
_screenRect = new Rectangle(dim.width, dim.height);
float[] my_kernel = { 0.10f, 0.10f, 0.10f, 0.10f, 0.20f, 0.10f, 0.10f, 0.10f, 0.10f };
_blurOp = new ConvolveOp(new Kernel(3, 3, my_kernel));
updateBackground();
_frame.addComponentListener(this);
_frame.addWindowFocusListener(this);
new Thread(this).start();
}

protected void updateBackground()
{
_background = _robot.createScreenCapture(_screenRect);
}

protected void refresh()
{
if (_frame.isVisible() && this.isVisible())
{
repaint();
_refreshRequested = true;
_lastUpdate = System.currentTimeMillis();
}
}

protected void paintComponent(Graphics g)
{
final int w = getWidth();
final int h = getHeight();
_frame.setTitle("Transparent Window (" + w + " x " + h + ")");

Graphics2D g2 = (Graphics2D) g;
Point pos = this.getLocationOnScreen();
BufferedImage buf = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
buf.getGraphics().drawImage(_background, -pos.x, -pos.y, null);

Image img = BLUR ? _blurOp.filter(buf, null) : buf;

g2.drawImage(img, 0, 0, null);
g2.setColor(new Color(255, 255, 255, 192));
g2.fillRect(0, 0, getWidth(), getHeight());
}

public void componentHidden(ComponentEvent e)
{
refresh();
}

public void componentMoved(ComponentEvent e)
{
repaint();
}

public void componentResized(ComponentEvent e)
{
repaint();
}

public void componentShown(ComponentEvent e)
{
repaint();
}

public void windowGainedFocus(WindowEvent e)
{
refresh();
}

public void windowLostFocus(WindowEvent e)
{
refresh();
}

public void run()
{
try
{
while (true)
{
Thread.sleep(100);
long now = System.currentTimeMillis();
if (_refreshRequested && ((now - _lastUpdate) > 1000))
{
if (_frame.isVisible())
{
Point location = _frame.getLocation();
_frame.setLocation(-_frame.getWidth(), -_frame.getHeight());
updateBackground();
_frame.setLocation(location);
refresh();
}
_lastUpdate = now;
_refreshRequested = false;
}
}
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}

public static void main(String[] args)
{
// setup ddraw
System.getProperties().put("sun.java2d.noddraw", NODDRAW ? "true" : "false");

JFrame frame = new JFrame();
TransparentBackground bg = new TransparentBackground(frame);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(bg);
frame.pack();
frame.setSize(640, 640);
frame.setLocation(50, 50);
frame.setVisible(true);
}
}
[/code]

mikofclassx
Offline
Joined: 2003-07-02

In reply to myself, the bug seems to be related to the NVidia drivers. I've tried with some other apps with the same result. Example: Adobe Premiere CS3 becomes completely unusable.

Comments are appreciated.

linuxhippy
Offline
Joined: 2004-01-07

I guess best would be to file a bug-report at bugs.sun.com, java devs usually visit these forums not regulary.