seg fault under Cuda 2.3 My code worked for 6 months under 2.2!

I made some changes to my computer, and now a piece of code that I know is correct immediately returns a segmentation fault. Has anybody encountered this problem? Here are the changes I made:

The first change I made was that I upgraded from Ubuntu 8.04 to 9.04, and consequently updgraded from Cuda 2.2 to 2.3.

I upgraded my graphics display card from an X1650 to a GT 9400. Could my code be trying to run on my display card? My Tesla card is device0, which is the default right? How would I go about manually specifying which card I want my code to run on?

deviceQuery and bandwidthTest run perfectly. My PATH and LD_LIBRARY_PATH is correct (I set these through bash.bashrc)

Thanks in advance!

Calling cudaSetDevice() before any other cuda function will let you pick the device number. What order does deviceQuery list your CUDA devices in?

I’m not at my computer now, but as I recall, deviceQuery says the Tesla is device0. Since my post, I found out about the --device= flag, so I used this, and it didn’t solve the problem.

Just to clarify, I should say that all of the SDK samples I’ve tried work, but all of my codes (there are several) that worked in 2.2 do not work in 2.3.

I’ve fixed the problem - it was a stupid coding mistake :">

The first line of my code opens a file that I write data to, and the folder containing that file no longer exists because of my OS upgrade, hence the segmentation fault.