Skip to main content

nvcc4jupyter: CUDA C++ plugin for Jupyter Notebook

Testing Python Versions CI - Test Coverage
Code Quality Code style: black security: bandit
Package PyPI Latest Release PyPI Downloads

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:

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

To use a working directory other than the default temporary one, configure it after loading the extension and then reload it:

%config NVCCPlugin.wd = './newWorkingDir'
%reload_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

MIT

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 -e .[dev]
pre-commit install

Go to Top

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nvcc4jupyter-1.2.2.tar.gz (38.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nvcc4jupyter-1.2.2-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file nvcc4jupyter-1.2.2.tar.gz.

File metadata

  • Download URL: nvcc4jupyter-1.2.2.tar.gz
  • Upload date:
  • Size: 38.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nvcc4jupyter-1.2.2.tar.gz
Algorithm Hash digest
SHA256 d40bb79f0f6be848a9d5b83e64c57ff0fdd473ada674eaa4f4373f13131ec525
MD5 e15b4dde63094145aaf3da46b7bf4dd7
BLAKE2b-256 5de487fdc74619e2b3fb5e648235c834985e09f67f5c9b2e40905393d8d50049

See more details on using hashes here.

Provenance

The following attestation bundles were made for nvcc4jupyter-1.2.2.tar.gz:

Publisher: publish-to-pypi.yml on andreinechaev/nvcc4jupyter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nvcc4jupyter-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: nvcc4jupyter-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nvcc4jupyter-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 00bd6dcb0a4582200954635773f110aeb749ad6f4a8ae0c17ece00783e1ae327
MD5 8ba961751dc2cc334d6744de9a58f70b
BLAKE2b-256 f83d2d541ec06edd47b335181d52d3c3b140665448c97c4f547248a84588d71b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nvcc4jupyter-1.2.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on andreinechaev/nvcc4jupyter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page