24 lines
673 B
Python
24 lines
673 B
Python
from __future__ import annotations
|
|
|
|
import torch
|
|
|
|
|
|
def main() -> None:
|
|
if not torch.cuda.is_available():
|
|
print("CUDA is not available.")
|
|
return
|
|
|
|
for idx in range(torch.cuda.device_count()):
|
|
props = torch.cuda.get_device_properties(idx)
|
|
print(f"device {idx}: {props.name}")
|
|
print(f" capability: {props.major}.{props.minor}")
|
|
print(f" total memory (GB): {props.total_memory / 1e9:.2f}")
|
|
print(f" multiprocessors: {props.multi_processor_count}")
|
|
print(f" max threads per block: {props.max_threads_per_block}")
|
|
print(f" warp size: {props.warp_size}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|