nvcc4jupyter: CUDA C++ plugin for Jupyter Notebook
| Testing | |
| Code Quality | |
| Package |
nvcc4jupyter is a Jupyter Notebook plugin that provides cell and line magics to allow running CUDA C++ code from a notebook. This is especially useful when combined with a hosted service such a Google's Colab which provide CUDA capable GPUs and you can start learning CUDA C++ without having to install anything or even to own a GPU yourself.
Table of Contents
Main Features
Here are just a few of the things that nvcc4jupyter does well:
- Easily run CUDA C++ code
- Profile your code with NVIDIA Nsight Compute
- Compile your code with external libraries (e.g. OpenCV)
- Share code between different programs in the same notebook / split your code into multiple files for improved readability
Install
The installer for the latest released version is available at the Python Package Index (PyPI).
pip install nvcc4jupyter
Usage
First, load the extension to enable the magic commands:
%load_ext nvcc4jupyter
Running a quick CUDA Hello World program:
%%cuda
#include <stdio.h>
__global__ void hello(){
printf("Hello from block: %u, thread: %u\n", blockIdx.x, threadIdx.x);
}
int main(){
hello<<<2, 2>>>();
cudaDeviceSynchronize();
}
For more advanced use cases, see the documentation.
Documentation
The official documentation is hosted on readthedocs.
License
Contributing
The recommended setup for development is using the devcontainer in GitHub Codespaces or locally in VSCode.
If not using the devcontainer you need to install the package with the development dependencies and install the pre-commit hook before commiting any changes:
pip install .[dev]
pre-commit install
Metadata
Release files for nvcc4jupyter 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nvcc4jupyter-1.1.0.tar.gz | 21.7 kB | Without provenance | Details for nvcc4jupyter-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nvcc4jupyter-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for nvcc4jupyter-1.1.0-py3-none-any.whl |
Total release size: 29.7 kB
Release files / nvcc4jupyter-1.1.0.tar.gz
| Download URL | nvcc4jupyter-1.1.0.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7375a6fb2bf4fb17c0c5065a7dbe655f02cd633c135c603da07444d2e952283
|
|
BLAKE2b-256 checksum How to use checksums |
f62339493bc2a1db914b927f81a161ae5ea30cdc3619efd8d6935c698e7a2b2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / nvcc4jupyter-1.1.0-py3-none-any.whl
| Download URL | nvcc4jupyter-1.1.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2b2acbb79d726227ace2ffdeb18b901e4debb9cf9419b13a35a389a655ee4ac
|
|
BLAKE2b-256 checksum How to use checksums |
e188587a32224649c40a4c7c9217b9c75bacb5d6a29a6270ef942455f85387d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for nvcc4jupyter 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.