-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test files for nvidia-smi parsing
Update to the new nvidia-smi pmon output fields Add a pycuda GPU burner script for tests
- Loading branch information
1 parent
931646a
commit 52671cf
Showing
6 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,4 +254,4 @@ to CMake using `Gperftools_ROOT_DIR`. | |
|
||
# Copyright | ||
|
||
Copyright (c) 2018-2023 CERN. | ||
Copyright (c) 2018-2024 CERN. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#! /usr/bin/env python | ||
# | ||
# This is a slightly adapted "hello, world" script from | ||
# pycuda, that can be used for stressing a CUDA GPU for | ||
# tests | ||
# | ||
# pycuda is required! | ||
# | ||
|
||
import pycuda.autoinit | ||
import pycuda.driver as drv | ||
import numpy | ||
from time import time | ||
|
||
from pycuda.compiler import SourceModule | ||
mod = SourceModule(""" | ||
__global__ void multiply_them(float *dest, float *a, float *b, float *c) | ||
{ | ||
const int i = threadIdx.x; | ||
dest[i] = a[i] * b[i] + c[i]; | ||
} | ||
""") | ||
|
||
multiply_them = mod.get_function("multiply_them") | ||
|
||
a = numpy.random.randn(1024).astype(numpy.float32) | ||
b = numpy.random.randn(1024).astype(numpy.float32) | ||
c = numpy.random.randn(1024).astype(numpy.float32) | ||
|
||
dest = numpy.zeros_like(a) | ||
|
||
start = time() | ||
while (time() - start < 20): | ||
multiply_them( | ||
drv.Out(dest), drv.In(a), drv.In(b), drv.In(c), | ||
block=(1024,1,1), grid=(1,1)) | ||
|
||
print(dest-a*b+c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0 1729 G 50 50 0 0 50 python3 | ||
0 1729 G 86 53 - - - - 9077 0 python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0 1729 G 100 100 0 0 100 python3 | ||
0 1729 G 17 93 - - - - 4374 0 python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0 1729 G 20 20 0 0 20 python3 | ||
0 1729 G 2 69 - - - - 4629 0 python3 |