diff --git a/cuda-stream.cu b/cuda-stream.cu index 2aecba3..2ab3adb 100644 --- a/cuda-stream.cu +++ b/cuda-stream.cu @@ -46,6 +46,7 @@ #include "common.h" std::string getDeviceName(int device); +int getDriver(void); // Code to check CUDA errors void check_cuda_error(void) @@ -162,6 +163,9 @@ int main(int argc, char *argv[]) // Print out device name std::cout << "Using CUDA device " << getDeviceName(deviceIndex) << std::endl; + // Print out device CUDA driver version + std::cout << "Driver: " << getDriver() << std::endl; + // Check buffers fit on the device cudaDeviceProp props; cudaGetDeviceProperties(&props, deviceIndex); @@ -358,6 +362,14 @@ std::string getDeviceName(int device) return std::string(prop.name); } +int getDriver(void) +{ + int driver; + cudaDriverGetVersion(&driver); + check_cuda_error(); + return driver; +} + void listDevices(void) { // Get number of devices