helloall1900 / pynvx

Python bindings for NVIDIA CUDA APIs.
MIT License
12 stars 2 forks source link
cuda gpu gpu-information macos memory nvidia nvidia-cuda-apis osx
██████╗ ██╗   ██╗███╗   ██╗██╗   ██╗██╗  ██╗
██╔══██╗╚██╗ ██╔╝████╗  ██║██║   ██║╚██╗██╔╝
██████╔╝ ╚████╔╝ ██╔██╗ ██║██║   ██║ ╚███╔╝
██╔═══╝   ╚██╔╝  ██║╚██╗██║╚██╗ ██╔╝ ██╔██╗
██║        ██║   ██║ ╚████║ ╚████╔╝ ██╔╝ ██╗
╚═╝        ╚═╝   ╚═╝  ╚═══╝  ╚═══╝  ╚═╝  ╚═╝

pynvx

Python bindings for NVIDIA CUDA APIs.

PyPI Release Version

A Python interface to get GPU information, built with pybind11. The main purpose of this project is providing a solution for managing GPU information on OS X, because there is no NVML library on OS X.

You can use pynvx as:

Table of Contents

Prerequisites

1. CUDA

You should set up CUDA before installation.

2. Compiler

Used When installing from source

On Unix (Linux, OS X)

On Windows

Installation

1. Install by pip (recommended)

pip install pynvx

2. Install from offline wheel file

Download wheel file in Release page, then install with pip:

pip install pynvx-*.whl

3. Install from source

Please install CUDA and set environment variables first.

See FindCUDA.cmake:548 (message): Specify CUDA_TOOLKIT_ROOT_DIR in TROUBLESHOOTING.

Just clone this repository and pip install. Note the --recursive option which is needed for the pybind11 submodule:

git clone --recursive https://github.com/helloall1900/pynvx.git
pip install ./pynvx

With the setup.py file included in this project, the pip install command will invoke CMake and build the pybind11 module as specified in CMakeLists.txt.

APIs

Special notes for Windows

Compiler requirements

Pybind11 requires a C++11 compliant compiler, i.e Visual Studio 2015 on Windows (Visual Studio 2017 for Python 3.11 and above). This applies to all Python versions, including 2.7. Unlike regular C extension modules, it's perfectly fine to compile a pybind11 module with a VS version newer than the target Python's VS version. See the FAQ for more details.

Runtime requirements

The Visual C++ 2015/2017 redistributable packages are a runtime requirement for this project. It can be found here. If you use the Anaconda Python distribution, you can add vs2015_runtime/vs2017_runtime as a platform-dependent runtime requirement for you package: see the conda.recipe/meta.yaml file in this example.

License

pynvx is provided under MIT License, see LICENSE file.

Troubleshooting

If you have problem while installing pynvx, see TROUBLESHOOTING before opening an issue.

Test & Example

Special Thanks