Description
When running pyflamegpu from a notebook, jitify compile errors are not shown to the user
I.e. all that is seen is:
FLAMEGPURuntimeException: (InvalidAgentFunc) /__w/FLAMEGPU2/FLAMEGPU2/src/flamegpu/util/detail/JitifyCache.cu(342): Error compiling runtime agent function (or function condition) ('grass_growth'): function had compilation errors (see std::cout), in JitifyCache::buildProgram().
This is not the case for running python outside of a notebook
This appears to be resolved by running a more recent version of ipython/jupyter, but a workaround is still required for collab where we cannot update this.
Todo
- Update instance hub to use a newer jupyter/ipython (@mondus)
ipykernel >= 6.0.0a5
outputs the stdout when an exception is thrown- Requires python >= 3.7, process will depend on the base AWS image used.
- Describe this issue in a known issues section of the readme + the solution(s) (update, and/or restart the kernel)
- Colab branch needs a new cell and section to perform this update, and instructions on how to restart the kernel. Potentially make this opt-in (i.e. comment it out initially unless there is a way to exclude from run_all
Notes
Locally, jupyter lab
and jupyter notebook
both show stdout on Ubuntu 21.04, python 3.9 with the following jupyter packages:
ipykernel 6.3.1
ipython 7.27.0
ipython-genutils 0.2.0
nbclassic 0.3.1
nbclient 0.5.4
nbconvert 6.1.0
jupyter-client 7.0.2
jupyter-core 4.7.1
jupyter-server 1.10.2
jupyterlab 3.1.10
jupyterlab-pygments 0.1.2
jupyterlab-server 2.8.0
And from About juptyer notebook:
The version of the notebook server is: 6.4.3-86f11a1
Python 3.9.5 (default, May 11 2021, 08:20:37)
[GCC 10.3.0]
Python 3.9.5 (default, May 11 2021, 08:20:37)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.27.0 -- An enhanced Interactive Python. Type '?' for help.
The Innstance hub jupyter notebook is running:
ipykernel 5.5.5
ipython 7.16.1
ipython-genutils 0.2.0
ipywidgets 7.6.3
nbclient 0.5.3
nbconvert 6.0.7
nbformat 5.1.3
jupyter 1.0.0
jupyter-client 6.1.12
jupyter-console 6.4.0
jupyter-core 4.7.1
jupyterlab-pygments 0.1.2
jupyterlab-widgets 1.0.0
The version of the notebook server is: 6.4.0
The server is running on this version of Python:
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0]
Current Kernel Information:
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
Installing the exact versions as found on the intancehub hosted copy, the stdout
being consumed can be reproduced:
python3 -m pip install ipykernel==5.5.5 ipython==7.16.1 ipython-genutils==0.2.0 ipywidgets==7.6.3 nbclient==0.5.3 nbconvert==6.0.7 nbformat==5.1.3 jupyter==1.0.0 jupyter-client==6.1.12 jupyter-console==6.4.0 jupyter-core==4.7.1 jupyterlab-pygments==0.1.2 jupyterlab-widgets==1.0.0
Colab is running the following:
ipython 5.5.0
ipython-genutils 0.2.0
ipython-sql 0.3.9
jupyter 1.0.0
jupyter-client 5.3.5
jupyter-console 5.2.0
jupyter-core 4.7.1
jupyterlab-pygments 0.1.2
jupyterlab-widgets 1.0.0
nbclient 0.5.4
nbconvert 5.6.1
nbformat 5.1.3
Installing differnt versions of ipykernel
has identified 6.0.0a5
(Released: Apr 26, 2021) as the first pypi release version which fixes this issue / introduces the change. This may help find a workaround.
The closed issues for milestone 6.0 for the ipykernel project may provide some insight.
The diff between 6.0.0a4 and 6.0.0a5 can also be found: ipython/ipykernel@6.0.0a4...6.0.0a5
ipython/ipykernel#630 is the relevant PR.