Initial project scaffold
This commit is contained in:
23
tools/print_device_info.py
Normal file
23
tools/print_device_info.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user