Julia on Google Colab: Free GPU-Accelerated Shareable Notebooks

I’m trying this out, installing Julia seems to work fine and from the install notebook I see e.g.


But I can’t get a second notebook started “in this same runtime” such that it sees the julia-1.2 kernel. I’ve tried the hyperlink suggestion from above which doesn’t work (maybe I got the URL wrong?) and I’ve tried uploading into the install session (but then how do I load the new notebook?). In all cases it gives me the Unrecognized runtime "julia-1.2"; defaulting to "python3" error. Any tips?


I have elaborately written about my issue in this link https://stackoverflow.com/questions/58270424/julia-in-google-colab. I hope some help will come my way?

1 Like

When you insert a hyperlink, is there a preceding command like - !wget or something else - to be able to run the script in the link?

Based on conversations in #gpu, it seems that the original hack broke last month due to changes in how Colaboratory handles associating “runtimes” (VMs) and notebooks. The best solution I managed to come up with was to craft a notebook that claims to be a Julia notebook, just like @jekbradbury’s original hack, and then have a cell at the top of each notebook that installs Julia and IJulia. One you run that cell, you can simply reload the page and things mostly work as expected as Colaboratory picks up on your IJulia installation. Here is a link to the notebook I am currently providing to my students for a class. While it may sound awful to have to install Julia and IJulia each time the runtime disconnects, it happens only after an hour or so in practice and it also seems that a complete CUDA stack is installed by default, so there is no need to install CUDA anymore which cuts down the installation time to just over a minute.

Known issues are code completion and syntax highlighting, I lack to expertise/time to look into this so any and all help is more than helpful.


Thanks a lot! It works also for Julia 1.2 for me (changing the URL for download and the kernelspec section locally in the ipynb file):

  "nbformat": 4,
  "nbformat_minor": 0,
 "metadata": {
    "kernelspec": {
      "name": "julia-1.2",
      "display_name": "Julia 1.2"

@ninjin Two suggestions for the notebook template: maybe use Julia 1.1 or 1.2, since 1.0 has a bug that displays a nasty (but harmless) stacktrace when importing CuArrays. You also should do @benchmark CuArrays.@sync ... or you’re just measuring kernel launch time.


@maleadt Duly noted, I had wondered for some time why that scary stacktrace showed up from time to time, yet had no effect on the actual usage of CuArrays. While I have updated the benchmarking code, I will stick to 1.0 for now as the class is in full swing.

Works for me!

1 Like

I saw that many people in this discourse were getting confused on how to upload the notebook to enable Julia, here is a blog(attached with video) I made. Blog also contains link to the Youtube video on Walkthrough.


I posted over in the flux forum but since this has to do with Colab, I’ll ref that post here: [ANN] Flux v0.10

Your code works really fine … CUDA gets precompiled without any problems

I tried solving the problem the problem for the Julia in Google Collab.The Julia 1.3.1 notebook works completely fine with GPU functionality.The notebook contains step by step information for the execution of code.
visit this repository:

I tried what you mentioned in the repository, and got stuck after the first step. I am not able to find any options which can change the runtime type (Initially, I used to see Python 2 and Python 3 as options). The option for Julia 1.x is not shown in Notebook settings (I remember the option existing before). I only see the option which lets me change the accelerator (None, GPU, TPU). Can you tell if there is any other method to shift to Julia in this step? I think Colab has stopped giving us options to change runtime type, and has started using Python 3 by default.

1 Like

This kind of error can occurr when you try to just copy the contents of the first cell into another notebook and run it.This notebook is a template to work on.
Try using the notebook in the repository directly.



It works for me, but I’m curious on why that kind of error happens?

Hi Julians,

I created a Colab notebook template, inspired by the notebooks above, but which supports easily setting the version of Julia (any version since 0.7.0 up to the latest version), and changing the list of Julia packages to be installed.

I hope this helps!


Hi ageron,

Some feedback for you regarding your post above

  1. Please add the package Plots to your colab notebook template by default
  2. Please make it clear to the user that “Reload this page and continue to the next section.” means press the RELOAD button on your webbrowser. I spent too much time looking for the option to reload the page on the google website
  3. Inform your user that to write new julia code on colab notebook, they first need to click on the “+ Code” button on the top of the page and then look for the new code section to add in the julia code. Not every newbie is familiar with Google colab notebook
  4. Inform the user, that they need to have a google account, to use google drive. The easiest way is to set up a gmail account even if they do not use gmail.

By the way, I appreciate the work you have done to get julia to work with colab

Thanks for your kind words, Steven. I implemented your suggestions.


This is great work!

I just tried the template and updated to Julia verson 1.5.0. Running the first cell generated the

Unrecognized runtime “julia”; defaulting to “python3” Notebook settings

but the template appears to work, however.

Success! Please reload this page and jump to the next section.

Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
** OS: Linux (x86_64-pc-linux-gnu)**
** CPU: Intel® Xeon® CPU @ 2.20GHz**
** WORD_SIZE: 64**
** LIBM: libopenlibm**
** LLVM: libLLVM-9.0.1 (ORCJIT, broadwell)**

Per instructions, I understand that we should run the template’s first cell in each new cola notebook.



Using Julia on google colab via SSH with vscode server

“Run VS Code on any machine anywhere and access it in the browser.” code-server

Please let me know if you have any suggestions for improving the script!

1 Like