Using bind texture in emulation mode...

Just so I know I’m not trying to debug the wrong thing, does cudaBindTexture (more specifically, cudaBindTexture2D) work in emulation mode? Because I’m getting an invalid texture reference error, but I’m not sure whether its my fault or the emulation mode just doesn’t support that.

Emulation mode definitely supports textures.

I’m not sure how well it does anymore, some texturing stuff changed and emulation is the absolute lowest priority we have in terms of fixing bugs. It would probably be best if you migrate away from it.

@Mr. Anderson: That’s what I figured. It just seemed weird to me that I’m not getting the error on device mode while i’m getting it on emulation mode. Anyway, thanks for the fast reply.

@tmurray: Well, i’m do using cuda 3.0 beta, so i guess that’s another possibility…

I know, I know. You’ve been saying that for a while :) I’ve just got a bunch of automated unit test suites that grind away every night, and one of them has always been set to compile in emulation mode. hoomd builds and passes all tests, even in CUDA 3.0 beta in emulation mode. If it breaks completely someday, I promise I won’t cry. All the on-device debugging tools you guys are creating are removing most (maybe all) of the usefulness out of emulation mode anyways.


Maybe it is an issue like Tim says, and my code just doesn’t trigger it. I mainly use 1D textures bound by cudaBindTexture, and only a couple 2D textures with filtering and normalized coordinates disabled.

Ok, after doing some more testing I realized that it wasn’t the fault of the bindtexture, but all the cuda emulation functionality was broken in 3.0 and every cuda function was throwing out errors. Rolling back to 2.3 solved the problem. The only functions that actually ran without returning errors were a cudaSetDeviceFlags and cudaSetDevice instructions that I had at the start of the program, maybe those were introducing the problem? (the exact flags where cudaDeviceMapHost| cudaDeviceBlockingSync |cudaDeviceScheduleSpin) Unfortunately I have a deadline soon so I can’t go back and test it myself, but as soon as I can I’ll look into it…