UndefVarError: cuda_version in Google Colab with CUDA.jl

Hello,

I’m working in a Google Colab notebook with a GPU runtime and am running into UndefVarError when trying to use CUDA.jl. For instance when I run CUDA.versioninfo():

using CUDA
CUDA.versioninfo()

I get the following stacktrace

CUDA toolchain: 
- runtime 12.5, local installation
- driver 550.54.15 for 13.0
UndefVarError: `cuda_version` not defined in `CUDA_Compiler_jll`
Suggestion: check for spelling errors or missing imports.

Stacktrace:
 [1] getproperty
   @ ./Base.jl:42 [inlined]
 [2] compiler_version
   @ ~/.julia/packages/CUDA/Wfi8S/lib/cudadrv/version.jl:101 [inlined]
 [3] versioninfo(io::IJulia.IJuliaStdio{Base.PipeEndpoint})
   @ CUDA ~/.julia/packages/CUDA/Wfi8S/src/utilities.jl:58
 [4] versioninfo()
   @ CUDA ~/.julia/packages/CUDA/Wfi8S/src/utilities.jl:42
 [5] top-level scope
   @ In[26]:2

Has anyone else encountered this issue in a Google Colab environment? What’s the best way to resolve this issue?

I suspect this is related to Issues with Reactant unable to find GPU on Colab, but CUDA.jl can - #6 by giordano. Try something like

rm(joinpath(Base.DEPOT_PATH[1], "compiled", "v$(VERSION.major).$(VERSION.minor)", "CUDA_Compiler_jll"); recursive=true, force=true)
using CUDA
CUDA.versioninfo()

Does that solve the issue?

I tested it and I can confirm that it solved the issue. Thanks!