From ce4a2e34e6ca79bfe2353d0c3653fe33600c8045 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Thu, 22 Sep 2022 06:51:03 +0000 Subject: [PATCH] first try --- test/smoke_test/smoke_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/smoke_test/smoke_test.py b/test/smoke_test/smoke_test.py index f5245b4da3..c99048e6ef 100644 --- a/test/smoke_test/smoke_test.py +++ b/test/smoke_test/smoke_test.py @@ -19,6 +19,14 @@ def smoke_test_cuda() -> None: print(f"torch cuda: {torch.version.cuda}") # todo add cudnn version validation print(f"torch cudnn: {torch.backends.cudnn.version()}") + # check torchvision's cuda version against system cuda version + if(torch.ops.torchvision.__cuda__version() != gpu_arch_ver): + raise RuntimeError(f"Wrong CUDA version. Loaded: {torch.version.cuda} Expected: {gpu_arch_ver}") + # check torchaudio's cuda version against system cuda version + if 'cu'+str(gpu_arch_ver).replace(".", "") not in torchaudio.__version__.split("+") + raise RuntimeError(f"Wrong CUDA version. Loaded: {torchaudio.__version__} Expected: {gpu_arch_ver} + + def smoke_test_conv2d() -> None: import torch.nn as nn