Skip to content

Commit

Permalink
cuda: add driver version to minimal.cu
Browse files Browse the repository at this point in the history
  • Loading branch information
danbev committed Oct 10, 2024
1 parent 15f0a5c commit 6869757
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gpu/cuda/src/minimal.cu
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ int main() {

int runtimeVersion = 0;

// Get CUDA runtime version
err = cudaRuntimeGetVersion(&runtimeVersion);
if (err != cudaSuccess) {
printf("cudaRuntimeGetVersion failed: %s\n", cudaGetErrorString(err));
return 1;
}

printf("CUDA Runtime version: %d.%d\n", runtimeVersion / 1000, (runtimeVersion % 100) / 10);

int driverVersion = 0;
err = cudaDriverGetVersion(&driverVersion);
if (err != cudaSuccess) {
printf("cudaDriverGetVersion failed: %s\n", cudaGetErrorString(err));
return 1;
}
printf("CUDA Driver version: %d.%d\n", driverVersion / 1000, (driverVersion % 100) / 10);

err = cudaGetDeviceCount(&count);
if (err != cudaSuccess) {
Expand Down

0 comments on commit 6869757

Please sign in to comment.