PROBLEMS (probably minor)

I am not a computer scientist, more of a maths/algorithms man, but I do have some working knowledge of HPC systems, but not great.

My current problem is this:
to use cutil I am currently developing code in a directory NVIDIA_CUDA_SDK2.0/projects/ShockTube. This is because I can’t locate the cutil library in order to refer to it in a simple nvcc compile command in my own makefile, but I am using the common.mk makefile and an amended makefile from one of the other example projects so that I can compile the source code and include cutil.

But when running the exe I am told it is run on the host (device 0) NOT a GPU (devices 1 and 2).

So I added cudaSetDevice(1) as the first statement (after var declarations) but was told the same thing; run on device 0.

So

  1. where is the cutil library?
  2. how do I refer to it in a simple nvcc call (-L -l options)?
  3. why does cudaSetDevice seem not to work?

All this is so that I can use cutil on the C870 in order to find out what the errors are (if any) from running my CFD code on the GPU.

OK, I’ve found libcutil.a , referenced it in a makefile containing only one nvcc statement with -L -l for that library, and -I for cutil.h, so that I am now working in my own directory, but cudaSetDevice is still apparently not working in that even with cudaSetDevice(1); as my very first statement I am always told the exe is executed on the host “Using device 0 : Quadro FX 1700”.

CUT_INIT calls cudaSetDevice for you and this is where the “Using device 0 : Quadro FX 1700” comes from. If you want to handle setting the device yourself, just don’t call CUT_INIT

Yes I began to assume that when I realisd that when I compiled in emulation mode the execution was slower. I had assumed that the Using device message was telling me on which device the kernel was being executed, rather than just telling me that device 0 was being used for something.

I also assumed that if I did use cudaSetDevice then there would be default message telling me which device was being used. Hence my confusion.