www.gpgpu.org Forum Index www.gpgpu.org
General Purpose Computation on GPUs
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cg runtime and cgc.exe bugs

 
Post new topic   Reply to topic    www.gpgpu.org Forum Index -> Programming Help
View previous topic :: View next topic  
Author Message
woid
.


Joined: 25 Nov 2003
Posts: 32
Location: Prague, Czech Rep.

PostPosted: Mon Jan 19, 2004 12:30 am    Post subject: Cg runtime and cgc.exe bugs Reply with quote

I'm a newcomer to the NV30 world. I have bought my FX class card a week ago. I started to implement Purcell's raytracer in the GPU. I have choosen Cg1.1+OpenGL1.5+pf30 platform. I have written a simple framework for my project (wrappers dealing with fragment programs using Cg runtime, pbuffer class, pbuffer state machine, quads renderer Smile etc.). I started to heavily use cgc.exe and Cg runtime for compiling, binding and running my program kernels. At the moment i'm not very familiar with fp30 assembler (NV_fragment_program), mainly because it has so poor documentation in the form of extension. There was a lot of try-it-again or do-it-another-way situations. But one thing frustrate me a lot:

Bugs in the cgc.exe or Cg runtime (version 1.1).
(It is not a intention of this post to describe the bug in reproducable manner)

Situation 1:
I have a quite simple .cg program with some input float vector v. I'm doing some dot products using v and then I divide some other products with result of dots. For debug purposes I set v to (0,0,0). Outch, it makes division by zero (but i don't realize this for now). Because v is now a constant, cgc optimizes whole code. It ends up generating invalid assembler with code fragments like {#INF}.x. I don't know anything because cgc gives no warnings and no errors and outputs at first look valid assembler code. When I try to do cgGLLoadProgram, it ends up with generic message "program loading error" (or something similar). I don't know anything and end with loading generated assembler by hand using NV_fragment_program extension. After that I realize that is something wrong with assembler generated from cgc. And after some time spend commenting out assembler code I realize {#INF} is doing the hell.
This is NOT a shader developer's heaven.

Situation 2:
I have quite complex fragment program for traversing grid of voxels. I have two nested if-else's (direct rewrite for C-code). Conditions are simple like (val.x<val.y) and (val.z<val.y) and similar. Code is compiled by cgc with no warnings and ran using Cg runtime. But code behaves unexpected. It seems that part of one branch is executed anyway (like cgc forgot right dealing with conditionals in assembler). Other part of that branch is executed as expected. I have to rewrite the code to the equivalent one-level if's this way: (val.xx<val.yz) and similar. In this case code compiles and behaves as expected.
Some ghosts are resident HERE.

Situation 3:
I have a fragment program using values packing. When I output.x = pack_2half(half2(10,0)) and in another fragment program do input.xy = unpack_2half(in.x). I will get input.xy == {0,0}. This behaves same when using (anything, 0) -> (0,0). When I use (x,y) where y!=0, I get (x,y) back !!!. Because of this it seems to be not bug on my side. I revised assembler generated and it looks correct to me. Maybe this is not a bug of cgc, but underlying fp30 driver. On another place the same construct works without problems. When I rearange lines of the original cg program, It starts to work ! But bug arises on another place. I don't believe I can base serious work on something crappy like this.
This is a real HEADACHE.

These are three examples of bugs i had to deal with.
I strongly believe none of them is on my side.
I don't want you to solve them or discuss them here (we must open a bug-list).

I want to ask you some questions:
1. Is there a list of cgc or cg-runtime related bugs and possible workarounds on the internet ?
2. Does exist some support from nvidia for these issues ?
3. Is there some schedule of next cgc and Cg runtime versions and the list of fixed bugs.
4. Does anybody have same problems like me ?
5. What would you suggest me to minimize effort in my project implementation (switch to DX9 ? learn and write direct assembly? use ARB profile? etc.).
_________________
Antonin "woid" Hildebrand
The Inferno Project [http://inferno.hildebrand.cz]
current config: FX5950U, ForceWare 62.20, OpenGL1.5+Cg1.2.1+fp30 profile
Back to top
View user's profile Send private message Visit poster's website
woid
.


Joined: 25 Nov 2003
Posts: 32
Location: Prague, Czech Rep.

PostPosted: Tue Jan 20, 2004 2:17 am    Post subject: Reply with quote

I posted situation 3 exploit onto CgShaders.orf forum. Please follow if you are interested in.
_________________
Antonin "woid" Hildebrand
The Inferno Project [http://inferno.hildebrand.cz]
current config: FX5950U, ForceWare 62.20, OpenGL1.5+Cg1.2.1+fp30 profile
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.gpgpu.org Forum Index -> Programming Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group