Skip to content

Commit ba37e4e

Browse files
committed
Move cuda runtime error to end
1 parent adfc8a5 commit ba37e4e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/smoke_test/smoke_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def cuda_runtime_error():
7272
def smoke_test_cuda(package: str) -> None:
7373
if not torch.cuda.is_available() and is_cuda_system:
7474
raise RuntimeError(f"Expected CUDA {gpu_arch_ver}. However CUDA is not loaded.")
75-
if torch.cuda.is_available():
75+
7676
if torch.version.cuda != gpu_arch_ver:
7777
raise RuntimeError(
7878
f"Wrong CUDA version. Loaded: {torch.version.cuda} Expected: {gpu_arch_ver}"
@@ -81,7 +81,6 @@ def smoke_test_cuda(package: str) -> None:
8181
# todo add cudnn version validation
8282
print(f"torch cudnn: {torch.backends.cudnn.version()}")
8383
print(f"cuDNN enabled? {torch.backends.cudnn.enabled}")
84-
cuda_runtime_error()
8584

8685
if(package == 'all' and is_cuda_system):
8786
for module in MODULES:
@@ -152,6 +151,10 @@ def main() -> None:
152151
if installation_str.find("nightly") != -1:
153152
check_nightly_binaries_date(options.package)
154153

154+
# This check has to be run last, since its messing up CUDA runtime
155+
if torch.cuda.is_available():
156+
cuda_runtime_error()
157+
155158

156159
if __name__ == "__main__":
157160
main()

0 commit comments

Comments
 (0)