Running Julia in a Jupyter Notebook on TACC Vista
Julia is the one language here that does not come from conda. conda-forge has no linux-aarch64 build, so conda create -c conda-forge julia fails with PackagesNotFoundInChannelsError. Use the official installer, which detects ARM correctly.
Install
curl -fsSL https://install.julialang.org | sh
. ~/.bashrc
julia -e 'using Pkg; Pkg.add("IJulia")'
IJulia registers its own kernelspec in ~/.local/share/jupyter/kernels/julia-<version>/, so unlike xeus-cpp there is no copy step.
Two things to know about where this lands:
- juliaup installs to
$HOME(~/.juliaup,~/.julia), not$WORK. Fine against the 23 GB home quota, but it does count against the file-count limit. - It appends itself to
.bashrc,.profile,.zshrc, and.cshrc. If you already added conda lines to.bashrc, check both survived.
Two fixes
Both go in ~/.local/share/jupyter/kernels/julia-<version>/kernel.json. setup-kernels.sh applies them.
Thread count
Julia defaults to one thread, and the count is fixed at startup; you cannot change it from inside a running notebook. Add to argv:
"--threads=16"
libcurl noise
If a conda environment is active, its LD_LIBRARY_PATH shadows the libcurl that Julia ships with, and every Pkg operation floods the output with a 20-line warning:
Error: curl_easy_setopt: 48
You may be using an old system libcurl library...
It is cosmetic; installs still succeed. But it is alarming and it buries real errors. Clear the variable in the kernelspec:
"env": { "LD_LIBRARY_PATH": "" }
Safe to blank entirely, because Julia bundles everything it needs. In a terminal, conda deactivate before running julia has the same effect.
Verifying
println("Julia ", VERSION)
using LinearAlgebra
A = rand(1000, 1000)
@time A * A;
Roughly 0.15 s for the multiply on a Grace core.
println("threads: ", Threads.nthreads())
Threads.@threads for i in 1:8
println("iteration $i on thread ", Threads.threadid())
end
Note: Julia 1.12 counts the default thread pool separately from the interactive one, so nthreads() can report a lower number than the thread IDs you actually see. Not a bug.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
PackagesNotFoundInChannelsError: julia |
No conda-forge aarch64 build | Use the juliaup installer |
threads: 1 |
Julia’s default; fixed at startup | --threads=16 in argv, then restart the Jupyter server |
Walls of curl_easy_setopt: 48 |
Conda’s LD_LIBRARY_PATH shadowing Julia’s libcurl |
"LD_LIBRARY_PATH": "" in the kernelspec |
julia: command not found after install |
PATH not reloaded | . ~/.bashrc |
Related
- Project overview
- C and C++ — the other threading story, OpenMP