title: OpenGL artifacts: where do they come from?
body: <p><img src="https://i.stack.imgur.com/EIbj8.png" alt="Crap"></p>
  
  <p><strong>STORY</strong></p>
  
  <p>I've been coding in OpenGL for about a year now (on the same hardware), and I've only recently been getting artifacts like the ones in the image above. They show up after running my program consecutively in a short period of time (couple of mins), and appear anywhere: from WordPad (see picture) to my desktop and taskbar or even other games (league of legends launcher, it's a software renderer i think).</p>
  
  <p>They can take any form similar to what you see in the image: black/white blocks or pieces of texture from my application. The artifacts dissapear after the affected application refreshes it's screen.</p>
  
  <p><strong>INFO</strong></p>
  
  <p><strong>My Application looks just Fine itself, no artifacts</strong></p>
  
  <p>I am using an ATI m5800 card with the latest driver (I have an hp elitebook 8540w), windows 7 64bit and Opengl 3.3 or lower.</p>
  
  <p>Why am I not posting a code sample? Because (as obnoxious as it sounds) it does not directly seem to be a specific part of my code that is causing the artifacts, I can easily run the program for 15 minutes without a problem.  My Graphics card will heat up to 68 degrees celcius and no artifacts will occur. The artifacts start to happen after multiple consecutive runs, though my video card will never heat up past 68 degrees even when the artifacts occur.</p>
  
  <p><strong>Why am I posting this here?</strong> Because I am still not sure whether this is caused by my code or my hardware/drivers, and I think this question is difficult enough from a technical standpoint in a way that I will only get the "buy a new GC" answer in any other place.</p>
  
  <p>I use alot of OpenGL, anything from framebuffers and shaders to 3d textures and buffertextures and texturearrays and what not.</p>
  
  <p>My hardware has not suffered any damage as far as I'm aware, though it is an elitebook so it is prone to overheating. </p>
  
  <p><strong>MY GUESS</strong></p>
  
  <p>(When I mention RAM, I mean video RAM, on my graphics card)</p>
  
  <p>I don't know a whole lot about OpenGL and I know even less about Graphics cards and their drivers, but I'll try to approach this and you can shoot my down at any point. The following is a disorganized train of thought, feel free to only read the bold parts.</p>
  
  <p><strong>All internet sources I can find on graphics artifacts tell me I have bad RAM caused by overheating.</strong></p>
  
  <p>However, if this is the case, then why is this "bad RAM" only accessed after consecutive runs, and never after a fresh start? Shouldn't my OS clean up all graphics memory when my application stops, resetting the state of my GC? If I have bad RAM, it seems that my graphics card cannot keep up with disposing my data and eventually accesses this piece of ram when everything else is "taken". And if the malfunctioning of the RAM is based on temperature, then why can I run my application once for 15 minutes, but not 4 times in the same period if the temperature stays the same? </p>
  
  <p><strong>Also, it it is truly bad ram, then why am I seeing part of my texture? Wouldn't this imply that the RAM worked fine at one part? (The blue blocks in the picture are part of a texture I use)</strong></p>
  
  <p>And more importantly: <strong>Why do I only seem to get artifacts with my application and nowhere else? Not one other application I have installed produces these artifacts anywhere!</strong></p>
  
  <p><strong>This would suggest that it is not my hardware but me, I am doing something wrong!</strong> (Or OpenGL is doing something wrong on my laptop, since most games likely run on DirectX).</p>
  
  <p>And now the last part, which makes the entire thing a miracle: My hardware is funded partly by my university, this means <strong>a friend of mine has identical hardware</strong> (truly identical 100%), <strong>and he does not get any artifacts running my code.</strong></p>
  
  <p>So... is it a driver bug then? <strong>My friend is running the same driver as me</strong>... I am totally lost here. </p>
  
  <p>All I can conclude is that my RAM is broken, and somehow everybody manages to avoid the bad parts except for me and my application. </p>
  
  <p><strong><em>What I am trying to ask is this: How did I get these artifacts? and how are some applications able to avoid them? What is going on in the hardware/software?</em></strong></p>
  
  <p><em>PS: I understand this is quite unstructured and chaotic as a question, this is because I've been at this for a while and I've tried to include any piece of information I have found. I will appreciate ANY piece of information anyone might think is related to this subject, today or a year from now, and I will gladly restructure this post if any suggestions come up. I've searched alot about artifacts but a great deal of search results describe anomalies due to code, restricted to the application in question, which is of little help to me. This means I could have missed important sources, if you think I did, please link them.</em></p>
  
  <p><strong>Contrary to what this might look like, I am only asking for information and discussion, not for a direct solution, the best solution is obviously to buy a new graphics card.</strong></p>
  
  <p>Important source : <a href="http://www.playtool.com/pages/artifacts/artifacts.html" rel="nofollow noreferrer">Diagnosing video card problems</a></p>