Skip to content

Instantly share code, notes, and snippets.

@FlyingFathead
Created November 12, 2023 19:21
Show Gist options
  • Save FlyingFathead/613de3fab0f0cc6df7579c1e39ac0a7c to your computer and use it in GitHub Desktop.
Save FlyingFathead/613de3fab0f0cc6df7579c1e39ac0a7c to your computer and use it in GitHub Desktop.
Get your CUDA compute level on CLI
# requires the pip `pycuda` package
# install it with: `pip install pycuda`
import pycuda.driver as cuda
cuda.init()
# Assuming you want to check the first GPU
device = cuda.Device(0)
compute_capability = device.compute_capability()
print(f"CUDA Compute Capability: {compute_capability[0]}.{compute_capability[1]}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment