Skip to content

Instantly share code, notes, and snippets.

View prnake's full-sized avatar
发电

papersnake prnake

发电
View GitHub Profile
@prnake
prnake / cuda_check.py
Created October 31, 2022 16:17 — forked from f0k/cuda_check.py
Simple python script to obtain CUDA device information
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Outputs some information on CUDA-enabled devices on your computer,
including current memory usage.
It's a port of https://gist.github.com/f0k/0d6431e3faa60bffc788f8b4daa029b1
from C to Python with ctypes, so it can run without compiling anything. Note
that this is a direct translation with no attempt to make the code Pythonic.