Let's talk Compilers...

Creating the perfect compiler is one of the more difficult problems in computing. Compiler optimization and scheduling is an NP-complete problem (think chess) so we can't "solve" it. And compounding the issue is that the best compiled code comes from a compiler that is written specifically for a certain processor and knows it inside and out. If we were to use a standard compiler to produce standard x86 code, our program will run much slower than if we tell our compiler we have a P4 with SSE2 and all the goodies that go along with it. I know this all seems pretty obvious, but allow me to illustrate a little.

Since I've always been interested in 3D graphics, back in 1998 I decided to write a 3D engine with a friend of mine for a project in our C++ class. It only did software rendering, but we implemented a software z-buffer and did back face culling with flat shading. Back then, my dad had a top of the line PII 300, and I acquired an AMD K6 200. Using a regular Borland C++ compiler with no real optimizations turned on, our little software 3D engine ran faster on my K6 than it did on my dad's PII. Honestly, I have no idea why that happened. But the point is that the standard output of the compiler ran faster on my slower platform while both systems were producing the same output. Now, if I had had a compiler from Intel optimized for the PII that knew what it was doing (or if I had hand coded the program in assembly for the PII), my code could have run insanely faster on my dad's box.

So, there are some really important points here. Intel and AMD processors were built around the same ISA (Instruction Set Architecture) and had a great deal in common back in 1998. Yet, performance varied in favor of the underpowered machine for my test. When you look at ATI and NVIDIA, their GPUs are completely and totally different. Sure, they both have to be able to run OpenGL and DirectX9, but this just means they are able to map OGL or DX9 function calls (via their drivers) to specific hardware routines (or even multiple hardware operations if necessary). It just so happens that the default Microsoft compiler generates code that runs faster on ATI's hardware than on NVIDIA's.

The solution NVIDIA has is to sit down with developers and help handcode stuff to run better on their hardware. Obviously this is an inelegant solution, and it has caused quite a few problems (*cough* Valve *cough*). The goal NVIDIA has is to eliminate this extended development effort via their compiler technology.

Obviously, if NVIDIA starts "optimizing" their compiler to the point where their hardware is doing things not intended by the developer, we have a problem. I think its very necessary to keep an eye on this, but its helpful to remember that such things are not advantageous to NVIDIA. Over at Beyond3d, there is a comparison of the different compiler (DX9 HLSL and NV Cg) options for NVIDIAs shaders.

We didn't have time to delve into comparisons with the reference rasterizer for this article, but our visual inspections confirm Beyond3d's findings. Since going from the game code to the screen is what this is all about, as long as image quality remains pristine, we think using the Cg compiler makes perfect sense. It is important to know that the Cg compiler doesn't improve performance (except for a marginal gain while using AA), and does a lot over the 45.xx dets for image quality.

Tomb Raider: Angel of Darkness Back to the game...
Comments Locked

117 Comments

View All Comments

  • Anonymous User - Saturday, October 11, 2003 - link

    Great job with the review. I'm so happy to finally see benchmarks in more than just FPS's. I'm always curious to see what kind of benefits can be had by upping my video card in RTS games for example. Take a rest, your brain must be fried from all that benching.

    One question. I have an LCD monitor and I can't get Generals:Zero Hour to run at 1280x1024. How did you manage to get that resolution for your benches since it is not offered in the game menu?
  • Anonymous User - Friday, October 10, 2003 - link

    Anadtech is a total liar. The 52.14 quality of picture sucks and so does my 5900 card sucks. Its garbage like it was before and the 52.14 drivers for sure are not helping it become better. As for the pictures i dont know how he dares even to say there is no difference in quality it for sure is a big problem the quality with all the games and programs i tried out.

  • Anonymous User - Friday, October 10, 2003 - link

    The TRYTH about the det. 52.14 driver:

    A) OpenGL filtering appears to be just fine.

    B) D3D filtering suffers from the following "optimizations"

    Application Mode:
    1) True trilinear is never utilized at all...on any texture stages. It's now all "pseudotrilinear"

    Control Panel Mode
    1) Same pseudotrilear as above
    2) Proper Aniso level selection is only applied to texture stage 0. No matter what the aniso level selected (2x-8x), only 2x is applied to stages 1-7.
  • Anonymous User - Thursday, October 9, 2003 - link

    I'd like to know what happened to all the CPU scaling analysis? I hope there's a part 3 which includes these same cards.
  • Anonymous User - Thursday, October 9, 2003 - link

    Good to see you are reworking the Flight Sim 9 BM. Your achieved FR in part 1 were so much higher than what real simmers are getting. Many people would be happy to get a reliable 25 FPS out of the game. Once there we can worry about IQ. So you need to push the texture sliders etc to put a real load on the system in this game. A continuing argument with this game is the importance of CPU/memory relative to graphics card in achieving acceptable frame rates. Anything in your testing that could shed light on this would be invaluable.

    scott s.
    .
  • Pete - Thursday, October 9, 2003 - link

    As long as I'm bothering you, I'd like to request Halo numbers with AF for your next review/roundup. AF really spruces up IQ, IMO, and it's a shame (almost pointless) to buy $500 cards and not run at the highest IQ possible. I'd also appreciate comparison pics with AF, as well. Thanks!
  • Pete - Thursday, October 9, 2003 - link

    Whoops, that was the URL of the inline pic, which works. This is the (broken) link to the large pic: http://images.anandtech.com/reviews/video/roundups...
  • Pete - Thursday, October 9, 2003 - link

    Derek, the Halo Det45.23 large pic link doesn't work: http://images.anandtech.com/reviews/video/roundups...
  • Anonymous User - Thursday, October 9, 2003 - link

    Might I suggest you remove the Tech part of your
    Sitename ? there's not much tech anymore
    Anyway this is not about Nv vs Ati, it is Nv vs DX9, It still states on NVidia's site, the FX series are DX9 card which they are not!!
    Inform the people as it should & not as your Nv-Paymaster is telling you!!
  • Anonymous User - Thursday, October 9, 2003 - link

    "We still urge our readers not to buy a card until the game they want to play shows up on the street."

    What if we want to play DNF? Should I just wait till it's done?

    Sounds like you're in nVidia's pocket more like it. Most people like games, not just one... so upgrading has immediate effects for most.

Log in

Don't have an account? Sign up now