jupyter / jupyter/notebook

print() from GPU code written in numba's cuda module is displayed in the terminal rather than output cell

Open
#4,855 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

When you write a print() statement in a function decorated with @cuda.jit (numba functionality) and call it, the output is printed in the terminal rather than the cell output. Platform is windows 10.

Steps to reproduce:

1. Create a jupyter instance by typing "jupyter notebook" into terminal
2. Create a new jupyter notebook
3. Paste into the cell the following code

``` python
from numba import cuda

@cuda.jit
def d_print():
print("hi")

d_print[10, 32]()
```

4. Run it

Expected is "hi" in the output window of the cell. Instead, "hi" is printed in the terminal window.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in a Jupyter notebook with the provided @cuda.jit d_print example on Windows 10. Trace how output from the CUDA call is handled, and compare terminal output with cell output; done means "hi" appears in the cell output rather than the terminal.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.