10 November 2012

Achievement Unlocked: GPU Insanity


You are looking at two gorgeous eVGA GTX 460 2Wins, which are eVGA's attempt at the dual GPU thing. I nearly had a shortage of 8-pin connectors (there's only two on this power supply), but was solved by using a dual 6-pin to 8-pin adapter (and then I almost ran out of 6-pin connectors -- go figure). My test cuda code verifies that I indeed have four GPUs:

shewu@hamburger ~/Dropbox/Projects/cuda
 % ./getgpu 
This computer has 4 GPUs
CUDA device #0
Name: GeForce GTX 460
Total memory: 1024MiB
Clock rate: 1401MHz
CUDA device #1
Name: GeForce GTX 460
Total memory: 1024MiB
Clock rate: 1401MHz
CUDA device #2
Name: GeForce GTX 460
Total memory: 1024MiB
Clock rate: 1401MHz
CUDA device #3
Name: GeForce GTX 460
Total memory: 1024MiB
Clock rate: 1401MHz

If you're interested in the code, here it is:

#include <iostream>
#include <cuda.h>

using namespace std;

void printDeviceProp(cudaDeviceProp& devProp_)
{
        cout << "Name: " << devProp_.name << "\n";
        cout << "Total memory: " << (devProp_.totalGlobalMem/(1024*1024)+1) << "MiB\n";
        cout << "Clock rate: " << devProp_.clockRate/1000 << "MHz\n";
        return;
}

int main()
{
        int devCount;
        cudaGetDeviceCount(&devCount);
        cout << "This computer has " << devCount << " GPUs\n";

        for (int i = 0; i < devCount; ++i)
        {
                cout << "CUDA device #" << i << "\n";
                cudaDeviceProp devProp;
                cudaGetDeviceProperties(&devProp, i);
                printDeviceProp(devProp);
        }

        return 0;
}
Sad to say that I still can't tell Bayley to eat my dust just yet.

No comments:

Post a Comment