CG crashes Panda on Windows Vista when using DX9

Hi,

On windows vista, panda3d will crash on shutdown if you have CG support compiled in and you’re using the dx9 pipeline. To reproduce the crash, do the following:

  1. download Panda 1.4.1 or Panda 1.4.2 and install on a vista machine
  2. change your config.prc to use the pandadx9 pipe
  3. execute the following program:
import direct.directbase.DirectStart
import sys

sys.exit()
  1. watch it crash.

I examined this crash a little bit, and here’s what I found out:

  1. it happens only if you have cg support enabled
  2. you don’t need to use CG to make it crash
  3. the crash seems to occur in the shutdown code of cg
  4. opengl and dx8 are ok. it only happens in dx9.
  5. it always crashes at exactly the same location in cgd3d9.dll
  6. if you take the exactly same panda package and install it on windows xp, there’s not problem
  7. it happens both with the “official” panda 1.4.x packages and with my own compiled versions of panda
  8. it also happens if you use the latest CG sdk from nvidia (I tried the sept. 2007 sdk, and it also crashed)
  9. it’s unrelated to the HAVE_THREADS setting (it happens both with and without thread support)
  10. if you compile a version without the cg support, everything’s fine.

Maybe someone of the panda3d gurus at CMU or Disney can look into this? Since our project won’t use shaders anyway, I’ve just compiled the CG support out of panda, but still (being the panda fan I am), I’m hoping for a fix of this problem.

Then again, it might be enitrely an nvidia/cg issue, since they don’t officially claim it to work on vista. hrmpf…

Cheers,

Erik

wow good work! To bad i can’t help you. But can i ask you an unrelated question of why you choose to use dx9 on vista? Is opengl that much slower? Or dx8? What are your thoughts on vista and panda3d compatibility?

Regarding why I chose dx9:

well, I didn’t really choose it so much, I merely tested it.
We’re working on a game and of course we want it to work on as many platforms as possible.
Therefore I want all pipes to be in an healthy state.

Recently I did some benchmarking on some really old HW (Pentium II, 350Mhz, Riva TNT, Windows 2000) and Panda did quite well performance wise, but on that machine I for example encountered the strang situation that OpenGL just wouldn’t run HW-accelerated.

Therefore I had to switch to DX8, which worked.

On some other machine (Pentium4, first generation ATI radeon), OpenGL worked, but was some 25% slower than DX8 or DX9. DX9 was the fastest pipe, but barely faster than DX8.

On my Vista Machine, OpenGL seems to be supported ok, but its a beast of a machine, so I’m not sure how that compares to other installations.
Maya 7.01 has problems with OpenGL though. When it looses focus, the 3d view goes blank.
I haven’t benchmarked gl/dx8/dx9 yet on vista, thats where I hit the crash.

I’ll do some more benchmarking after the weekend.

I guess I’ll also follow up on the rumors that 1.4.x is slower than 1.3.2.

Lets see…

Erik

thanks! i find the 1.4.x faster it just the way we were using it was wrong.
Maybe making a standard panda3d bench marking program for all of us to use might be good?