def validate_gpu(): """ Validate gpu by trying a cuda-add. """ if platform.machine() != "x86_64": print("GPU tests are only relevant in x86 architectures") return wait_for_pod_state("", "kube-system", "running", label="name=nvidia-device-plugin-ds") here = os.path.dirname(os.path.abspath(__file__)) manifest = os.path.join(here, "templates", "cuda-add.yaml") get_pod = kubectl_get("po") if "cuda-vector-add" in str(get_pod): # Cleanup kubectl("delete -f {}".format(manifest)) time.sleep(10) kubectl("apply -f {}".format(manifest)) wait_for_pod_state("cuda-vector-add", "default", "terminated") result = kubectl("logs pod/cuda-vector-add") assert "PASSED" in result
def validate_inaccel(): """ Validate inaccel """ if platform.machine() != "x86_64": print("FPGA tests are only relevant in x86 architectures") return wait_for_pod_state("", "kube-system", "running", label="app.kubernetes.io/name=fpga-operator") here = os.path.dirname(os.path.abspath(__file__)) manifest = os.path.join(here, "templates", "inaccel.yaml") get_pod = kubectl_get("po") if "inaccel-vadd" in str(get_pod): # Cleanup kubectl("delete -f {}".format(manifest)) time.sleep(10) kubectl("apply -f {}".format(manifest)) wait_for_pod_state("inaccel-vadd", "default", "terminated") result = kubectl("logs pod/inaccel-vadd") assert "PASSED" in result