Skip to content

Commit d5e0e87

Browse files
williamwen42malfet
andauthored
Use device capability instead of device name
Co-authored-by: Nikita Shulga <nshulga@meta.com>
1 parent 039a26f commit d5e0e87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intermediate_source/torch_compile_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343

4444
gpu_ok = False
4545
if torch.cuda.is_available():
46-
device = torch.cuda.get_device_name()
47-
if "V100" in device or "A100" in device:
46+
device_cap = torch.cuda.get_device_capability()
47+
if device_cap in [(7, 0), (8,0)]:
4848
gpu_ok = True
4949

5050
if not gpu_ok:

0 commit comments

Comments
 (0)