NVIDIA Cg Compiler Technology to be Open Source
Jim Norton writes "This announcement from nVidia states that
their Cg compiler technology for 3D applications will be Open Source and available under a free, unrestrictive license. The ETA for this is in August and will be available here." The linked company release says it will be under "a nonrestrictive, free license," but does not give further details. BSD?
Money talks. If you like what they are doing, tell them you like it by buying one of their cards.
I've read the article, but I believe I'm not enough of a graphics geek to understand it O:-) What's a "Cg compiler"? What's it for?
My weblog in spanish
so are they looking to get this into OpenGL 2.0 ?
there was some debate on which was better 3DLabs or this as well as an ATI solution
anyone know more ?
but whatever happens Thank you
after all the chip business needs a reason to sell more chips and graphics is a big one the faster people can use the new features the more games/apps need powerfull chips
regards
john jones
ass the article fails to spell out the details, other than it is a "non-restrictive open source lisence" we can assume this means something like the BSD or X lisences, especially since MS co developed it. The was a daemonnews thread a while back about Bill Gates saying how governments should use BSD-style lisences for the absolue maximum effectevness on stuff they develope. It just allows more embracing and extending to happen.
I've been coding in Cg for some time, there have been a number of problems I've faced so far:
1. The vertex engine calls are not logical. Sometimes you call passing a referenced pointer, other time you have to pass a referenced strucute, some form of standarization to calls would have made it easier for developers to write function calls (more insane than POSIX threads).
2. The lanugae is not truely Turning complete. Which could have been fixed by taking some more time and making the language more complete.
3. The compiled bytecode is giving a security mask that disables it's use on chips that do not carry a compliment decoder (To keep competetors away?).
4. Confusing definitions of pointer/references. They could have made this easier by removing the entire pointer usage.
5. Class calls outside of friend functions can at certain times reach memory outside of parent definitions (Bad language design?! I think this is one of the most debated feature/bug, since you can piggyback this to implement vertex calls within lighmaps).
6. No SMP support in current implmentation and no thoughts to future support (What about threading?!).
7. Inlining support is bad and possibly unusable outside the scope of inling cg within c.
or gc^2 or gc**2 or pow(gc,2)
Je t'aime Stéphanie
I can't help but think back to 3DfX and the glide library and think that this may be Nvidia's goal, it probably would be a great way for Nvidia optomized code to be developed if the compiler automatically did some special things for Nvidia cards even if it did output a product that works on almost all video cards (OpenGL).
Will only a 'portion' of this compiler be free? Some of you may or may not know that their Linux modules require a proprietary 'binary stub'. Thus the difficulty in porting any of their stuff to other UNIXs such as FreeBSD.
Hopefully that won't be the case with this.
Some of the best news is that they've openly said they'll include support for ATI and other large manufacturers of competing graphics products. I'm glad to see that Nvidia isn't being closed-minded or trying to undermine their own intentions for ease of development by using the proprietarity card.
I'm in a field totally different from graphics programming and hardware, but:
In my reading of earlier coverage of Cg, my understanding that most people weren't concerned about Cg or its compiler being open source, but rather that Cg would depend to some extent on hardware specs that are proprietary. This would have the effect of driving other hardware competitors out of business because they can't implement Cg components because of hardware patents. Sort of similar to fears associated with MS open sourcing part of C# while keeping a good deal of it dependent on proprietary stuff. The fear is that Cg would lead to people saying things like "well, your video card is so crappy it doesn't even support a standard graphics programming language" (all the while being unaware that the card can't because of hardware patents). Just because the language and compiler is open-source doesn't mean the hardware it will run on is.
Anyone more knowledgable care to comment? Am I misunderstanding this?
Please read here:
http://www.cgshaders.org/contest/
As you can see from the terms and conditions on that CG site, they favour and link to the ZLib license.
I think that CG will be under the PHP/ZLib license.
i would really love to give some witty comments here -- but am at a loss of words. which could be fixed by thinking up a few words to form a witty comment with.
My life in the land of the rising sun.
Everyone is excited about this but the only thing is that it's really not that important because you still have to have a compiler. Until other graphics card manufacturers make Cg compilers this won't really be a standard and still an nVidia solution.
Besides there are already C compilers that will turn your normal C code in to vector code. For PS2 and 3D-Now/SSE instructions. Check out codeplay for more info. Yes you have to pay for it. They don't have a compiler for the DirectX shading machine yet but this proves that they could. It's not like we have to invent a new language for every machine.
This drammatically increases the chances that CG will become somewhat of a standard. Right now, it looks as if this is a case of NV putting forward the technology merely in order to push their products forward. Any standard without industry acceptance would be dead in the water, and its failure would invalidate the 3-dTbufferAnisographotopically mapped TexSurfaces features they would be including on their next cards. This way they have a way to get past the slow-as-hell OpenGL board and actually retain some control over the standards they work on without either ceding control to BillyG or keeping their competitors out. It works like this: NV knows it does not have the force to push its own Glide-esque language on the industry. There are too many other cards out there *cough*R300*cough* that could potentially grab enough market share to lure developers away from anything proprietory into existing standards that work on everything. Open-sourcing CG is also a way of putting pressure on other companies to adopt it, as ATI seems a little reluctant to adopt something that NV controls tightly. In the war between OpenGL2.0 and DirectX9.0, CG looked like it didn't have a chance to replace these venerable industry standards, but with a lot of developer support before either of these is released(by giving any potential CG programmer the source code for free) will validate it. It's explained pretty well in this article about the impending split in developer's plans.
People in Soviet Russia, however, appear to be afflicted with amusing juxtapositions of the aforementioned situation
Practically, Cg is less useful than RenderMonkey because it is readily integrated into popular graphics packages.
However, there are some pretty good potential there, to make a Cg plugin for everything under the sun.
Controlling the Shader Language standard is almost as important as making a better video card, as you'll have a feature set your competitors have to follow - if Cg becomes the most popular language, then NVidia can say on their marketing material "GeForce 10: 100% Cg compatible, Radeon 50000: only supports 80%".
I thought the whole reason they made a new language (Cg) is because the chipsets weren't Turing complete. If they WERE Turing complete, then it would be a complete waste of time to make a new language -- just make a new back-end for your favourite C compiler and write a bit of run-time.
However, the chips themselves can't do very much -- they can't do a conditional branch, for example. This makes it quite difficult to make a C compiler target them :)
It would be very cool to just be able to do gcc -b nvidia-geforce9 ... or what have you since you'd be able to take advantage of a rich existing toolchain. But, alas, it's not to be.
Now that was funny. :-)
Need a Python, C++, Unix, Linux develop
Nvidia, if you're reading this, please read.
For as long as I remember, the #1 complaint from the open source community has been the lack of open source X drivers, and the lack of documentation for directly accessing the hardware.
This still isn't direct access to the hardware is it? This is an API that goes through a compiler that translates things into machine code. Absolutely no real access to speak of.
Sometimes I wonder if nvidia cards are truly the hardware marvels that they are. Their implementation sort of reminds me of Play Incorporated's snappy video snapshot, where the hardware functions and bios get's loaded by an external program. I don't know if this is the exact case with nvidia hardware, but i'm pretty sure i'm not that far off the mark.
If that really is the case, it means that TNT2 cards are capable of all the neat tricks gforce cards only alot slower. I can see why you wouldn't want it opened up to the public. What's to stop a competetor from using the same hardware/software implementation you are?
I don't think it would seriously put a dent in the bottom line however. People tend to keep loyaltee's towards a company if it doesn't fuck their customers. Look at how many hits a day voodoofiles.com gets!
So be bold and daring like the new dorito's. Let other companies mimic your techniques, and try not to worry about the bottom line so much. If you let a bunch of open source guru's hack on your code, you could fire a few of those internal programmers thereby making up the cost. If you do this, anytime a relative, friend, customer asks us what 3d card solution they should get, we will respond NVIDIA.
yours truly
--toq
The positive by NVIDIA so far is that they licensed technology from someone else to construct their drivers and hardware, and they are not at liberty to release open drivers. Fine, that's something I can accept for now.
What I'd really like to know is, as they move forward to new hardware and new drivers and new technologies, will they do so with the free software philosophy in mind, so that they can be more open about their work, and help the community adopt their hardware on other platforms than Windows, Linux, and MacOS.
Certainly, if they release this compiler under a free license, then that's a good first step, because it could mean that they recoginize the value of free software and how it aids the spread of technologies to new platforms, not to mention how good free interfaces can become standards. Seems clear that NVIDIA would like to be the new SGI, settings the standard by which graphic innovation is defined.
Curmudgeon Gamer: Not happy
They have kick-ass products that officially support my platform of choice. 'Nuff said. :-)
Karma whorin' since 1999
ATI will be providing plug ins to compile Renderman or Maya code to run on its Radeon 9700 rather than on the central processor. Although not directly competing with Cg, this does seem to be a much better approach. Provided of course that you could take your 'binaries' from Renderman/Maya and use them in your video game or whatever.
Bryan
Yes, you can do pixel and vertex shaders on the CPU, but it will make the application so slow as to be unusable.
Don't think that your 6 year old TNT2 card will become some magic speed demon if nVidia gives you driver source. It won't. Your argument is akin to saying, "Intel, give us the internals to the P4. I know I can make my 80286 run all new code if you do!"
of course nvidia would make the compiler free, because they make hardware, not software. Think of the compiler as a "marketing vehicle." They make this really cool cg compiler, so everybody uses it to make some sweet graphics, and consumers need to buy new hardware to get 8 billion (or 40) frames per second.
It's important to make the distinction here. nVidia has opensourced the parser and compiler for CG, but they control the language. Look at it this way, nvidia needs something to show off NV30 with, and CG will be the thing to do it. This is in direct competition with the opengl 2.0 and DX9 HLSLs though, and you can bet that they won't be steering CG in any directions favorable to their competition like ATI or 3DLabs. It's fine if nVidia wants to do their own thing, but realize that this cg isn't nearly as open as the "opensource" headline makes it sound.
Since when do I need any sort of excuse - like encouraging Cg - to buy an Nvidia card? I needed an excuse?
I'm the stranger...posting to
Don't think that your 6 year old TNT2 card will become some magic speed demon if nVidia gives you driver source.
Did I say that? I thought I said...
If that really is the case, it means that TNT2 cards are capable of all the neat tricks gforce cards only alot slower.
Please read comments before replying, thank you.
--toq
C for graphics?
Does this mean I can segfault my video card now?
After all, it's not C if my first version of the code that compiles doesn't segfault immediately.
Cg technology could be a great step forward. By releasing it under a nonrestrictive license, companys like splutterfish can accelerate their plans for a shading language in brazil.
The standardization on a shading language is going to push forward renderers two a new level, creating a massive pool of competition to Pixar's Photorealistic Renderman.
Gnuyen
"If that really is the case, it means that TNT2 cards are capable of all the neat tricks gforce cards only allot slower."
...but that's not really what you're after, is it? Maybe I just didn't understand you. I usually understand raving loonies just fine (professional courtesy and all that :P), but you're thinking just strikes me as a little out of kilter.
Kinda sorta but not really. An updated driver for a TNT2 board could emulate in software all the silicon a TNT2 is missing. That's true regardless of what card you have. There are software-only OpenGL drivers out there.
Fooz Meister
Great another raving looney :P
Well, I used to work with the guys from play inc. One of them basically explained how the snappy video snapshot worked.
Their custom chip was sort of combination of rom/ram and logic. The rom acted as a bootstrap for basic parrelel port communications. The ram would store code downloaded via the parrelel port, and the logic would chew on that.
Basically the snappy never really got any REAL upgrades to the hardware. (note this is where nvidia and play differs, nvidia adds faster hardware) Versions 1 2 and 3 of the snappy were all nothing more than "soft upgrades"
I think nvidia cards work in the same fashion, that's why we see such an performance increase between driver releases because the actual chip logic is loaded at boot.
1. Preboot, vga compatible mode
2. Boot, load custom OS specific hardware register code
3. Load OS specific driver for glue between the OS and the hardware (which is really software)
There is only so much you can do from calls to the OS for speed. If on the otherhand you could "soft upgrade" the hardware on boot, everytime you optimized that boot software a little more, it would stand to reason that the card would run faster.
So basically if you wanted to add that "gwhiz AA x4" feature to your card, you could write it in software, and load it into your card at boot.
Like I said earlier, nvidia open sourcing it would probably lead to a lot of the newer cards features being found on older cards, only a helluva lot slower. This too, is a reasonable assumption because the hardware is slower. It's no less capable of running the same code though.
Hope that clears things up.
NVidia cannot release the source code due to parts which are not belong to them (they belong to SGI and other parties)...
BUT - do you really think that ATI or Matrox cannot reverse engineer the driver? Go ask Matrox engineer and they'll swear that NVidia reversed engineers Matrox's binary only driver for dual head and thats how NVidia got dual head (at least thats what one of Matrox engineers told me)
Hetz (Heunique)
Hah! You know, everyone should go read this post I made in reference to the Slashcode changes.
I mentioned how CmdrTaco and friends will never defeat the trolls because they are some of the most ingenius and inventive Slashdot users. This is a perfect example. Way to go sllort! Thanks for proving me right!
All the changes to Slashcode will do is hurt the users who do not troll. Stupid Taco.
Why bother.
I'll try to sum it up for you in simple terms, since you can't seem to grasp the concept.
TNT2 doesn't have the transistors to do hardware transform and lighting. It can't do pixel and vertex shaders. Those can only be done in dedicated hardware or on the CPU. No amount of driver source code will change that.
Via proper software drivers (OpenGL and/or DirectX) TNT2 cards can *already* run games that use pixel and vertex shaders. It's just that since the card is offloading all of those calcuations to the CPU the programs are intolerably slow.
Please take your random thoughts to logical conclusions before posting insipid open letters to corporations.
There is no way you could write a new driver for a TNT2 card that would allow it to do those advanced features. Give up the pipe dream. A programable pipleline graphics card != a simple video convertor box. It doesn't matter how much you believe that the hardware/software design behind a Snappy can be transfered to a video card, it just isn't going to work.
Why bother.
Microcode updates? Bios Updates? Programmable Grid Arrays? Ever hear of any of these? Probably not.
I won't flame you, you obviously don't know enough about hardware to make any logical conclusions yourself..
NVidia cannot release the source code due to parts which are not belong to them (they belong to SGI and other parties)...
SGI has said, on a number of occaisions, that they are not at all involved in keeping the nVidia driver closed source. They have also stated that they are in favor of open sourcing the driver.
Dinivin
"Now if only they would do the same with their drivers!"
I known someone who once worked for MetroLink. He was part of the team that was writing the NVidia device driver for Metro-X. They were a source licensee, under NDA, yadda yadda, so they had access to the NVidia driver source.
He said that the NVidia driver source is highly coupled with the chip design. Apparently, the NVidia driver people have intimate knowledge of the hardware design, and take advantage of it. This lets the driver exploit as much of the hardware's potential as possible. However, it also means that the driver has specific knowledge of the hardware design.
Given that NVidia's sole business is chip design, you can bet that they will never release source for that driver. It contains too much of their business. (No, it is not a chip schematic, but that isn't the point. It contains enough to make their lawyers unhappy.)
For better or worse, that is the way it is with NVidia. If you do not like it, do not buy their cards.
dragonhawk@iname.microsoft.com
I do not like Microsoft. Remove them from my email address.
Matrox engineers probably would claim that at this point. Basically dual head technology is old news and anyone can make a dual-headed card. This isn't nvidia's bread and butter and never was, so I doubt they took the time to reverse engineer Matrox's stuff.
It's a wonder Matrox is still alive in this day and age. Sure, they have what is considered the best 2d card of all time, and that's nice for OEMs and a handful of windows-using graphic designers, but the margins just aren't there. They lost the 3d race more than 5 years ago. ATI is barely keeping up and their driver quality is too poor to help them win.
Nvidia just owns the 3d market now, have for the last 2 years or more.
Err...barely keeping up? Go look at the reviews for the Radeon 9700.
Would you PLEASE stop talking about stuff you obviously know nothing about? There is no PGA in the TNT. A bios/microcode update cannot make up for the lack of vertex and pixel shader silicon.
In fact: you cannot even emulate the vertex and pixel shader path in software because there is no
way of inserting it into the correct rendering path on the TNT2.
You cannot emulate rendering 16 textures at once by rendering several times either because there is not enough framebuffer alpha accuracy to do it.
You're living in a land of make believe,
with elves and fairies and little frogs with funny green hats!
A witty
Oh come on! If you can get one display working, then adding a second is trivial. You just need a second RamDac reading a separate area of your display memory, and make sure your display driver plays nice with the OS. It certainly is beyond most of our capabilities, but then how many people have the knowledge and equipment to build their own video cards in the first place ? Not very many. But for those in the business, they know what they're doing, and they don't need to look over the other' shoulder to figure out simple problems like these.
-Billco, Fnarg.com
Cg is 100% source code compatible with the syntax of the DX9 HLSL, and the OpenGL 2.0 focus group is looking at Cg vs. 3DLab's proposal for inclusion in OpenGL 2.0.
The upshot is that if Cg is accepted as the shading language for OpenGL 2.0, DX9 and OGL 2.0 would have the EXACT same syntax.
Even if it isn't accepted as the shading language for OGL2, you will be able to write shaders in Cg and have them work on OpenGL 1.4+, and DX8+.
"Good people drink good beer"
I think a much more likely reason is that some portions of the code are copyrighted by entities other than nVidia.