Giter Site home page Giter Site logo

matteoonger / nvcc4jupyter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andreinechaev/nvcc4jupyter

0.0 0.0 0.0 119 KB

A plugin for Jupyter Notebook to run CUDA C/C++ code

License: MIT License

Shell 0.18% Python 43.20% Dockerfile 1.51% Jupyter Notebook 55.11%

nvcc4jupyter's Introduction

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 set a working dirctory other than the default one:

%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

nvcc4jupyter's People

Contributors

cosminc98 avatar matteoonger avatar ianneee avatar msaroufim avatar ssakuh avatar project-tuva avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.