Install
run this on jupyter(*.ipynb) files
!pip3 install nvcc4jupyter
Usage
load the extension to enable the magic commands:
%load_ext nvcc4jupyter
Run cuda test
%%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();
}
Other Problem
ModuleNotFoundError: No module named 'nvcc_plugin'
try this
!pip3 install nvcc_plugin
or
!pip3 install nvcc4jupyter==1.0.0
标签:load,nvcc4jupyter,jupyter,pip3,python,c++,cuda,install
From: https://www.cnblogs.com/blueflylabor/p/18343944