# Julia in Colab

**URL:** https://discourse.julialang.org/t/julia-in-colab/126600
**Category:** General Usage
**Tags:** colab
**Created:** [March 5, 2025, 10:55pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600 "2025-03-05T22:55:11Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![metrizable](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/metrizable/32/215391_2.png) [@metrizable](https://discourse.julialang.org/u/metrizable)
#### Post date: [March 5, 2025, 10:55pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/1 "2025-03-05T22:55:11Z")

</div>

Hi Julia community!

I’m new to posting here (this is my first one :-)) and wasn’t sure the right place to post, but I’d like to share that Colab now provides the Julia language in our runtimes ([Julia as a language in runtimes · Issue #5151 · googlecolab/colabtools · GitHub](https://github.com/googlecolab/colabtools/issues/5151)).

Right up front, I work for Colab, and I think the Julia language is pretty awesome. I have some math and data science background and Julia has felt like a very natural language and I’ve wanted to see it in Colab for some time (as part of the original three in Jupyter).

Currently, we don’t provide a lot of pre-installed packages right now but I’d love to hear feedback about your experiences of the Julia language in Colab and where it hits and where it misses!

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [March 5, 2025, 11:00pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/2 "2025-03-05T23:00:33Z")

</div>

You were beaten in the announcement by other very excited users:

> [@Google Colab support for Julia party\_popper](https://discourse.julialang.org/t/google-colab-support-for-julia/126598):
>
> Just saw this amazing news. Google Colab now supports Julia out-of-the-box!!

---

<div class="post-metadata">

### Author: ![MilesCranmer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milescranmer/32/21070_2.png) [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)
#### Post date: [March 5, 2025, 11:06pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/3 "2025-03-05T23:06:08Z")

</div>

Indeed 🙂 Let’s make @Metrizable’s first post the main thread! I will update mine to link here.

---

<div class="post-metadata">

### Author: ![wsmoses](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsmoses/32/26497_2.png) [@wsmoses](https://discourse.julialang.org/u/wsmoses)
#### Post date: [March 5, 2025, 11:47pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/4 "2025-03-05T23:47:10Z")

</div>

This is awesome!!!

By the way, if you want to run your julia code on cloud TPUs, I confirmed that using Reactant works in the new Julia Colab ([Google Colab](https://colab.research.google.com/drive/10QN_AjdadMzwQnF2blUv47NS1DCHj5av?usp=sharing))

---

<div class="post-metadata">

### Author: ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)
#### Post date: [March 6, 2025, 12:58am UTC](https://discourse.julialang.org/t/julia-in-colab/126600/5 "2025-03-06T00:58:26Z")

</div>

This is huge, thank you! Is it possible to use Colab for teaching an introduction course for Julia?

---

<div class="post-metadata">

### Author: ![metrizable](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/metrizable/32/215391_2.png) [@metrizable](https://discourse.julialang.org/u/metrizable)
#### Post date: [March 6, 2025, 1:19am UTC](https://discourse.julialang.org/t/julia-in-colab/126600/6 "2025-03-06T01:19:55Z")

</div>

I would imagine so. At SIGCSE 2025, this was definitely a topic that came up.

---

<div class="post-metadata">

### Author: ![metrizable](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/metrizable/32/215391_2.png) [@metrizable](https://discourse.julialang.org/u/metrizable)
#### Post date: [March 6, 2025, 1:21am UTC](https://discourse.julialang.org/t/julia-in-colab/126600/7 "2025-03-06T01:21:23Z")

</div>

Wow, neat! I wasn’t aware of Reactant. Nice!

---

<div class="post-metadata">

### Author: ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)
#### Post date: [March 6, 2025, 1:24am UTC](https://discourse.julialang.org/t/julia-in-colab/126600/8 "2025-03-06T01:24:04Z")

</div>

Wow! This is incredible news @metrizable! It sounds like you had an outsize role in making this happen alongside your team – many thanks! This has been a requested feature for years so it is exciting to see it happen.

I know it is your first time posting on Discourse so welcome to the Julia Discourse! You are also welcome to join the [Slack community](https://julialang.org/slack/#to_create_a_free_account_in_the_julia_language_slack_please_use_the_following_link) where [folks are having an excited discussion](https://julialang.slack.com/archives/C67910KEH/p1741211903211389) about the news!

Cheers!

~ tcp 🌳

---

<div class="post-metadata">

### Author: ![NonDairyNeutrino](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nondairyneutrino/32/221496_2.png) [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)
#### Post date: [March 6, 2025, 2:21am UTC](https://discourse.julialang.org/t/julia-in-colab/126600/9 "2025-03-06T02:21:59Z")

</div>

**NOTE FROM THE FUTURE** : @roflmaostc noted that I forgot to synchronize the GPU call, leading to timing only the kernel launch ☹ . They have included this synchronization (`CUDA.@sync $xGPU + $yGPU`) and provided the correct benchmarking code and plot [here](https://discourse.julialang.org/t/julia-in-colab/126600/42).

==============================================================

A quick and dirty CPU vs GPU benchmark! Using the (free!) “T4 GPU” runtime. Stopped at 10^8 because 10^9 exceeded either the 12.7GB of RAM or 15.0GB of VRAM.

```julia
using Pkg
Pkg.add("CUDA")
Pkg.add("BenchmarkTools")
using Plots, CUDA, BenchmarkTools

pMax = 8
powerVector = 1:pMax
timeVectorCPU = Vector{Float16}(undef, pMax)
timeVectorGPU = Vector{Float16}(undef, pMax)

for p in powerVector
    n = 10^p
    xCPU, yCPU = (ones(n), ones(n))
    xGPU, yGPU = (cu(xCPU), cu(yCPU))

    timeVectorCPU[p] = @belapsed $xCPU + $yCPU
    timeVectorGPU[p] = @belapsed $xGPU + $yGPU
end

timeVectorCPU |> display
timeVectorGPU |> display

plot(
    10 .^ powerVector, 
    [timeVectorCPU timeVectorGPU], 
    label = ["CPU" "GPU"], 
    title = "CPU vs GPU",
    xscale = :log10,
    yscale = :log10,
    ylabel = "Elapsed time [s]",
    fmt = :png
)

```

 ![colab_bench](https://global.discourse-cdn.com/julialang/original/3X/1/c/1c9bd5f579137a0ea6e1b42c66a63b176d47b948.png)

---

<div class="post-metadata">

### Author: ![raman\_kumar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raman_kumar/32/26782_2.png) [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)
#### Post date: [March 6, 2025, 9:42am UTC](https://discourse.julialang.org/t/julia-in-colab/126600/10 "2025-03-06T09:42:03Z")

</div>

Can we run PLUTO notebook in Google Collab?

---

<div class="post-metadata">

### Author: ![indymnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/indymnv/32/212594_2.png) [@indymnv](https://discourse.julialang.org/u/indymnv)
#### Post date: [March 6, 2025, 2:41pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/11 "2025-03-06T14:41:47Z")

</div>

That’s good news, now we have to knock the door on Kaggle Notebooks 🤭

---

<div class="post-metadata">

### Author: ![Paul\_Soderlind](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_soderlind/32/1753_2.png) [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)
#### Post date: [March 6, 2025, 3:11pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/12 "2025-03-06T15:11:50Z")

</div>

Lazy question: how do I set a path to subfolders? (My notebook is at Google Drive and I can run it, but when I do `pwd()` I get `"/content"`)

---

<div class="post-metadata">

### Author: ![metrizable](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/metrizable/32/215391_2.png) [@metrizable](https://discourse.julialang.org/u/metrizable)
#### Post date: [March 6, 2025, 3:37pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/13 "2025-03-06T15:37:56Z")

</div>

As of a [couple months ago](https://www.kaggle.com/discussions/product-announcements/552460), Kaggle started deriving their Docker images from Colab’s public releases, so this is a real possibility in the near future. Colab hasn’t pushed the image with the Julia kernel to the public repo yet, but some time following this at least the bits should be there.

---

<div class="post-metadata">

### Author: ![jbytecode](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbytecode/32/17719_2.png) [@jbytecode](https://discourse.julialang.org/u/jbytecode)
#### Post date: [March 6, 2025, 3:42pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/14 "2025-03-06T15:42:50Z")

</div>

Congratulations!

That’s a big thing and a great opportunity for growing up the community.

Ju Pyt R, revisited 🎈🙃

---

<div class="post-metadata">

### Author: ![metrizable](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/metrizable/32/215391_2.png) [@metrizable](https://discourse.julialang.org/u/metrizable)
#### Post date: [March 6, 2025, 3:50pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/15 "2025-03-06T15:50:10Z")

</div>

Currently in Colab, we don’t provide a simple way to determine the path in Google Drive of the notebook you’re editing. However, I am aware of code snippets to allow this discovery, but they’re a little slow.

One way to access the artifacts on Google Drive is to mount it. A smooth UX in Colab for Julia is not present, but it is available in Python. Until something is available, one “hacky” way could be to use the Python runtime to mount Google Drive (and it remains mounted), then switch to the Julia runtime (via the Runtime menu (or patching the session)).

 ![BGJFwbHXwpUKVRA](https://global.discourse-cdn.com/julialang/original/3X/8/a/8a8114ecb6ba1a001f5ba28725cc6aba4c18b6be.png)

I’m aware of some fuse commands/rclone/etc approaches are out there, too.

---

<div class="post-metadata">

### Author: ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)
#### Post date: [March 6, 2025, 4:11pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/17 "2025-03-06T16:11:42Z")

</div>

I was trying just now to directly use `google.colab` from within Julia, with some limited success

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/d/1d9a778189947e082c56eceda913b4a76327ce81.jpeg)

---

<div class="post-metadata">

### Author: ![metrizable](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/metrizable/32/215391_2.png) [@metrizable](https://discourse.julialang.org/u/metrizable)
#### Post date: [March 6, 2025, 5:53pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600/18 "2025-03-06T17:53:23Z")

</div>

Agreed. I had tried similar, but it seems the Python that’s invoked is not associated with the IJulia kernel. There may be something more we could do here to hook those up.

It would also be cool to build up native Julia tooling to replicate functionality found in the google.colab Python package, like [colabtools/google/colab/drive.py at e8519e12f553b0597c0e067cd9e4df821bdc6b2e · googlecolab/colabtools · GitHub](https://github.com/googlecolab/colabtools/blob/e8519e12f553b0597c0e067cd9e4df821bdc6b2e/google/colab/drive.py#L98).

---

<div class="post-metadata">

### Author: ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)
#### Post date: [March 7, 2025, 5:40am UTC](https://discourse.julialang.org/t/julia-in-colab/126600/20 "2025-03-07T05:40:14Z")

</div>

Can GPU be used? I tried to add CUDA.jl, but it said

```julia
CUDA.jl could not find an appropriate CUDA runtime to use.

```

---

<div class="post-metadata">

### Author: ![NonDairyNeutrino](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nondairyneutrino/32/221496_2.png) [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)
#### Post date: [March 7, 2025, 5:48am UTC](https://discourse.julialang.org/t/julia-in-colab/126600/21 "2025-03-07T05:48:24Z")

</div>

First in the “Select a runtime”, you need to choose the GPU accelerator instead of the CPU. Then `Pkg.add("CUDA")` to the environment (they’re working on getting CUDA pre-added to GPU runtimes; see metrizable’s link). THEN we can `using CUDA; CUDA.versioninfo()`.

---

<div class="post-metadata">

### Author: ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)
#### Post date: [March 7, 2025, 5:53am UTC](https://discourse.julialang.org/t/julia-in-colab/126600/22 "2025-03-07T05:53:19Z")

</div>

Yes, I exactly chose the T4 GPU runtime and then used `Pkg.add("CUDA")`, but saw the error message.

[Next page](https://discourse.julialang.org/t/julia-in-colab/126600.md?page=2)
