Output the nvidia gpu information in the E2E test.

Including the gpu information simplifies driver version verification.
nvidia-smi is used in order to display gpu information, which contains the driver version.
This commit is contained in:
Richard Chen 2019-05-07 14:30:00 -07:00
parent 0f9077d0af
commit 794ec63bbd
2 changed files with 10 additions and 1 deletions

View File

@ -179,6 +179,7 @@ func testNvidiaGPUs(f *framework.Framework) {
// Wait for all pods to succeed
for _, pod := range podList {
f.PodClient().WaitForSuccess(pod.Name, 5*time.Minute)
logContainers(f, pod)
}
e2elog.Logf("Stopping ResourceUsageGather")
@ -189,6 +190,14 @@ func testNvidiaGPUs(f *framework.Framework) {
framework.ExpectNoError(err, "getting resource usage summary")
}
func logContainers(f *framework.Framework, pod *v1.Pod) {
for _, container := range pod.Spec.Containers {
logs, err := e2epod.GetPodLogs(f.ClientSet, f.Namespace.Name, pod.Name, container.Name)
framework.ExpectNoError(err, "Should be able to get container logs for container: %s", container.Name)
e2elog.Logf("Got container logs for %s:\n%v", container.Name, logs)
}
}
var _ = SIGDescribe("[Feature:GPUDevicePlugin]", func() {
f := framework.NewDefaultFramework("device-plugin-gpus")
ginkgo.It("run Nvidia GPU Device Plugin tests", func() {

View File

@ -23,4 +23,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
WORKDIR /usr/local/cuda/samples/0_Simple/vectorAdd
RUN make
CMD ./vectorAdd
CMD nvidia-smi && ./vectorAdd