Log in

No account? Create an account

Previous Entry | Next Entry

CUDA Device Properties

I was curious to know the CUDA compute capability of my graphics card. This is a version number expressed in the form x.y. x indicates the version of the core architecture, and y the minor improvements on that. The table of NVIDIA devices and their compute capability values can be seen listed in Appendix A of the CUDA Programming Guide. I wish NVIDIA had shared this table online for ease of access.

I wanted to know more CUDA information about the device. Since I couldn't find this from the NVIDIA Control Panel, I looked around for an API to query this information. Sure enough, the deviceQuery project that ships along with the NVIDIA CUDA SDK has code to do this. Just compile and the program will print out all the interesting information about your CUDA device(s).

Here are the CUDA device properties of my GeForce 8800 GTX card:
There is 1 device supporting CUDA

Device 0: "GeForce 8800 GTX"
  Major revision number:                         1
  Minor revision number:                         0
  Total amount of global memory:                 804978688 bytes
  Number of multiprocessors:                     16
  Number of cores:                               128
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       16384 bytes
  Total number of registers available per block: 8192
  Warp size:                                     32
  Maximum number of threads per block:           512
  Maximum sizes of each dimension of a block:    512 x 512 x 64
  Maximum sizes of each dimension of a grid:     65535 x 65535 x 1
  Maximum memory pitch:                          262144 bytes
  Texture alignment:                             256 bytes
  Clock rate:                                    1.35 GHz
  Concurrent copy and execution:                 No


There seems to be two ways to get the CUDA information. The more convenient option is to use the Runtime API, and the more detailed option is to use the Driver API. The deviceQuery project uses the former. The query information is returned in a structure named cudaDeviceProp. I couldn't find any CUDA header file which contained the definition of this structure. It seems to be somehow provided by the libraries themselves. But, curious to know the elements of this structure I added the cudaDeviceProp variable to a QuickWatch window in Visual Studio and got what I wanted.

So, the cudaDeviceProp structure is as follows:

struct cudaDeviceProp
    char            name[256];                  // Device name
    unsigned int    totalGlobalMem;             // Total amount of global memory
    unsigned int    sharedMemPerBlock;          // Total amount of shared memory per block
    int             regsPerBlock;               // Total number of registers available per block
    int             warpSize;                   // Warp size
    unsigned int    memPitch;                   // Maximum memory pitch
    int             maxThreadsPerBlock;         // Maximum number of threads per block
    int             maxThreadsDim[3];           // Maximum sizes of each dimension of a block
    int             maxGridSize[3];             // Maximum sizes of each dimension of a grid
    int             clockRate;                  // Clock rate
    unsigned int    totalConstMem;              // Total amount of constant memory
    int             major;                      // Major revision number
    int             minor;                      // Major revision number
    unsigned int    textureAlignment;           // Texture alignment
    int             deviceOverlap;              // Concurrent copy and execution (0 means No, else Yes)
    int             multiProcessorCount;        // Number of multiprocessors (Number of cores = 8 * multiProcessorCount)
    int             kernelExecTimeoutEnabled;   // Kernel execution timeout enabled
    int             __cudaReserved[39];         // Space reserved for future use



cuda, default

Latest Month

April 2009
Powered by LiveJournal.com
Designed by Tiffany Chow