mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
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:
parent
0f9077d0af
commit
794ec63bbd
@ -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() {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user