Skip to main content

Jupyter notebook plugin to run CUDA C/C++ code

Project description

NVCC Plugin for Jupyter notebook

V2 is available

V2 brings support of multiple source and header files.

Usage
  • Install and load extension
!pip install git+https://github.com/andreinechaev/nvcc4jupyter.git
%load_ext nvcc_plugin
  • Mark a cell to be treated as cuda cell

%%cuda --name example.cu --compile false

NOTE: The cell must contain either code or comments to be run successfully. It accepts 2 arguments. -n | --name - which is the name of either CUDA source or Header The name parameter must have extension .cu or .h Second argument -c | --compile; default value is false. The argument is a flag to specify if the cell will be compiled and run right away or not. It might be usefull if you're playing in the main function

  • To compile and run all CUDA files you need to run
%%cuda_run
# This line just to bypass an exeption and can contain any text
  • To profile your CUDA kernels using NVIDIA Nsight Compute CLI profiler you need to run
%%cu --profile
  • You can add options to the profiler. Keep in mind that any argument after "--profiler-args" will be considered as a profiler argument. For example, to select which sections to collect metrics for you need to run
%%cu --profile --profiler-args --section SpeedOfLight --section MemoryWorkloadAnalysis --section Occupancy

Project details


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.0.0.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

nvcc4jupyter-1.0.0-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page