# LinearSolveCUDAExt fails to compile

**URL:** https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693
**Category:** Optimization (Mathematical)
**Created:** [August 18, 2025, 11:28pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693 "2025-08-18T23:28:59Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [August 18, 2025, 11:28pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/1 "2025-08-18T23:28:59Z")

</div>

As a dependency of `DiffEqGPU` (version 3.8,0), it fails to compile on Julia 1.11.6 (Linux).

```julia-auto
(Test) pkg> precompile
Precompiling project...
  ✗ LinearSolve → LinearSolveCUDAExt
  33 dependencies successfully precompiled in 131 seconds. 583 already precompiled.
  1 dependency had output during precompilation:
┌ Test
│ ERROR: LoadError: UndefVarError: `LinearVerbosity` not defined in `LinearSolveCUDAExt`
│ Stacktrace:
│ [1] top-level scope
│ @ ~/.julia/packages/LinearSolve/fHamo/ext/LinearSolveCUDAExt.jl:52
│ [2] include
│ @ ./Base.jl:562 [inlined]
│ [3] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
│ @ Base ./loading.jl:2881
│ [4] top-level scope
│ @ stdin:6
│ in expression starting at /home/sob/.julia/packages/LinearSolve/fHamo/ext/LinearSolveCUDAExt.jl:1
│ in expression starting at stdin:6
│ ┌ Error: Error during loading of extension LinearSolveCUDAExt of LinearSolve, use `Base.retry_load_extensions()` to retry.
│ │ exception =
│ │ 1-element ExceptionStack:
│ │ Failed to precompile LinearSolveCUDAExt [e24d4dde-ed20-5ee7-b465-f1dd73f9b6ba] to "/home/sob/.julia/compiled/v1.11/LinearSolveCUDAExt/jl_7Ajqnz".
│ │ Stacktrace:
│ │ [1] error(s::String)
│ │ @ Base ./error.jl:35
│ │ [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64}, loadable_exts::Vector{Base.PkgId})
│ │ @ Base ./loading.jl:3174
│ │ [3] (::Base.var"#1110#1111"{Base.PkgId})()
│ │ @ Base ./loading.jl:2579

```

Anybody getting the same error?

---

<div class="post-metadata">

### Author: ![dcelisgarza](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dcelisgarza/32/215951_2.png) [@dcelisgarza](https://discourse.julialang.org/u/dcelisgarza)
#### Post date: [August 19, 2025, 5:16pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/2 "2025-08-19T17:16:21Z")

</div>

I’m getting the same error in two different machines.

```julia
Julia Version 1.11.6
Commit 9615af0f269 (2025-07-09 12:58 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 1700 Eight-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver1)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)

```

```julia
Julia Version 1.11.6
Commit 9615af0f269 (2025-07-09 12:58 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver1)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

```

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [August 19, 2025, 8:58pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/3 "2025-08-19T20:58:45Z")

</div>

Sorry, there was a patch where this caused an issue with the CUDA extension. It should not be fixed on LinearSolve v3.34.0

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [August 19, 2025, 9:21pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/4 "2025-08-19T21:21:24Z")

</div>

Works now thank you @ChrisRackauckas

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [August 19, 2025, 10:12pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/5 "2025-08-19T22:12:08Z")

</div>

Still getting a warning that `init_cacheval()` is overwritten though.

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [August 20, 2025, 12:43pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/6 "2025-08-20T12:43:03Z")

</div>

Can you share that warning?

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [August 20, 2025, 3:12pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/7 "2025-08-20T15:12:47Z")

</div>

New empty project upon calling `add CUDA DiffEqGPU` (Linux, Julia 1.11.6)

```julia-auto
Precompiling project...
  ? LinearSolve → LinearSolveCUDAExt
  1 dependency successfully precompiled in 3 seconds. 227 already precompiled.
  1 dependencies failed but may be precompilable after restarting julia
  1 dependency had output during precompilation:
┌ LinearSolve → LinearSolveCUDAExt
│ WARNING: Method definition init_cacheval(LinearSolve.CudaOffloadLUFactorization, Any, Any, Any, Any, Any, Int64, Any, Any, LinearSolve.LinearVerbosity{T} where T, LinearSolve.OperatorAssumptions{T} where T) in module LinearSolve at /home/sob/.julia/packages/LinearSolve/507yZ/src/factorization.jl:1213 overwritten in module LinearSolveCUDAExt at /home/sob/.julia/packages/LinearSolve/507yZ/ext/LinearSolveCUDAExt.jl:55.
│ ERROR: Method overwriting is not permitted during Module precompilation. Use ` __precompile__ (false)` to opt-out of precompilation.
└  
 
(Blah) pkg> 

```

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [August 21, 2025, 11:40am UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/8 "2025-08-21T11:40:24Z")

</div>

Alright we got our GPU CI machines fixed. Try LinearSolve.jl v3.36.0. That should be good now 🤞

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [August 21, 2025, 12:16pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/9 "2025-08-21T12:16:51Z")

</div>

All clear now thanks @ChrisRackauckas

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [September 29, 2025, 9:23pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/10 "2025-09-29T21:23:13Z")

</div>

More issues in the same package @ChrisRackauckas

```julia-auto
julia> using Test
Precompiling LinearSolveCUDAExt...
Info Given LinearSolveCUDAExt was explicitly requested, output will be shown live 
WARNING: Method definition usecuda() in module LinearSolve at /home/sob/.julia/packages/LinearSolve/IJofQ/src/LinearSolve.jl:440 overwritten in module LinearSolveCUDAExt at /home/sob/.julia/packages/LinearSolve/IJofQ/ext/LinearSolveCUDAExt.jl:14.
ERROR: Method overwriting is not permitted during Module precompilation. Use ` __precompile__ (false)` to opt-out of precompilation.
  ? LinearSolve → LinearSolveCUDAExt
[Info: Precompiling LinearSolveCUDAExt [e24d4dde-ed20-5ee7-b465-f1dd73f9b6ba] (cache misses: incompatible header (8))
WARNING: Method definition usecuda() in module LinearSolve at /home/sob/.julia/packages/LinearSolve/IJofQ/src/LinearSolve.jl:440 overwritten in module LinearSolveCUDAExt at /home/sob/.julia/packages/LinearSolve/IJofQ/ext/LinearSolveCUDAExt.jl:14.
ERROR: Method overwriting is not permitted during Module precompilation. Use ` __precompile__ (false)` to opt-out of precompilation.
┌ Info: Skipping precompilation due to precompilable error. Importing LinearSolveCUDAExt [e24d4dde-ed20-5ee7-b465-f1dd73f9b6ba].
└ exception = Error when precompiling module, potentially caused by a __precompile__ (false) declaration in the module.
 
julia> 

```

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [October 2, 2025, 1:33am UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/11 "2025-10-02T01:33:15Z")

</div>

Thanks for the error message. Fixed in [Fix precompilation of usecuda, usemetal, and useblis by ChrisRackauckas · Pull Request #792 · SciML/LinearSolve.jl · GitHub](https://github.com/SciML/LinearSolve.jl/pull/792)

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [October 2, 2025, 4:29pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/12 "2025-10-02T16:29:21Z")

</div>

Attempting to update my project now has me downgrade a couple packages including `LinearSolve`:

```julia-auto
(Test) pkg> update
    Updating registry at `~/.julia/registries/General.toml`
   Installed NonlinearSolveSpectralMethods ─ v1.5.0
   Installed OptimizationOptimJL ─────────── v0.4.5
   Installed BracketingNonlinearSolve ────── v1.5.0
   Installed NonlinearSolveQuasiNewton ───── v1.10.0
   Installed SimpleNonlinearSolve ────────── v2.9.0
   Installed TimeZones ───────────────────── v1.22.1
   Installed NonlinearSolve ──────────────── v4.12.0
   Installed LinearSolve ─────────────────── v3.28.0
   Installed NonlinearSolveFirstOrder ────── v1.9.0
   Installed NonlinearSolveBase ──────────── v2.0.0
   Installed Distributions ───────────────── v0.25.121
   Installed OptimizationBase ────────────── v2.12.0
   Installed Optimization ────────────────── v4.8.0
    Updating `~/workspace/Test/Project.toml`
  [31c24e10] ↑ Distributions v0.25.120 ⇒ v0.25.121
  [7f7a1694] ↑ Optimization v4.7.0 ⇒ v4.8.0
  [36348300] ↑ OptimizationOptimJL v0.4.4 ⇒ v0.4.5
  [f269a46b] ↑ TimeZones v1.22.0 ⇒ v1.22.1
    Updating `~/workspace/Test/Manifest.toml`
  [70df07ce] ↑ BracketingNonlinearSolve v1.4.0 ⇒ v1.5.0
  [31c24e10] ↑ Distributions v0.25.120 ⇒ v0.25.121
⌃ [7ed4a6bd] ↓ LinearSolve v3.40.2 ⇒ v3.28.0
  [8913a72c] ↑ NonlinearSolve v4.11.0 ⇒ v4.12.0
  [be0214bd] ↑ NonlinearSolveBase v1.16.1 ⇒ v2.0.0
  [5959db7a] ↑ NonlinearSolveFirstOrder v1.8.0 ⇒ v1.9.0
  [9a2c21bd] ↑ NonlinearSolveQuasiNewton v1.9.0 ⇒ v1.10.0
  [26075421] ↑ NonlinearSolveSpectralMethods v1.4.0 ⇒ v1.5.0
  [7f7a1694] ↑ Optimization v4.7.0 ⇒ v4.8.0
  [bca83a33] ↑ OptimizationBase v2.11.0 ⇒ v2.12.0
  [36348300] ↑ OptimizationOptimJL v0.4.4 ⇒ v0.4.5
  [727e6d20] ↑ SimpleNonlinearSolve v2.8.0 ⇒ v2.9.0
⌃ [9672c7b4] ↓ SteadyStateDiffEq v2.5.0 ⇒ v2.4.1
  [f269a46b] ↑ TimeZones v1.22.0 ⇒ v1.22.1
        Info Packages marked with ⌃ have new versions available and may be upgradable.
Precompiling project...
  ✗ SteadyStateDiffEq
  ✗ DifferentialEquations
  ✗ Test
  75 dependencies successfully precompiled in 113 seconds. 550 already precompiled.
  3 dependencies errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`
 
(Test) pkg>

```

And the root cause seems to be:

```julia-auto
ERROR: LoadError: UndefVarError: `AbstractNonlinearTerminationMode` not defined in `SteadyStateDiffEq`

```

EDIT:

A blank new project with only `DifferentialEquations` and `CUDA` compiles fine (including the recent `LinearSolve`. Meaning the my real world project has a package that is forcing an older version of `LinearSolve` which errors, but a more recent version shouldn’t.

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [October 2, 2025, 5:53pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/13 "2025-10-02T17:53:26Z")

</div>

So @ChrisRackauckas it seems `SteadyStateDiffEq` is held/dowgraded (at v2.4.1, instead of v2.5.0) by a package in the `DifferentialEquations` or `Optimization` tree.

I was able to recover a broken environment by doing the following:

- rm DifferentialEquations
- add SteadyStateDiffEq (to have explicitely in Project, goes to v2.5.0)
- add DifferentialEquations (didn’t downgrade SteadyStateDiffEq… however if I were to remove SteadyStateDiffEq from Project, up would downgrade it as a dep to DifferentialEquations)

```julia-auto

```

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [October 3, 2025, 3:20am UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/14 "2025-10-03T03:20:03Z")

</div>

Try with the new SteadyStateDiffEq.jl. It looks like I forgot to do that release with the crucial patch which changes it to using NonlinearSolveBase instead of DiffEqBase

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [October 3, 2025, 9:52am UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/15 "2025-10-03T09:52:58Z")

</div>

The newer package still gets downgraded unless explicitly in Project.toml

```julia-auto
(Test) pkg> update
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `~/workspace/Test/Project.toml`
    Updating `~/workspace/Test/Manifest.toml`
  [70df07ce] ↑ BracketingNonlinearSolve v1.4.0 ⇒ v1.5.0
  [8913a72c] ↑ NonlinearSolve v4.11.0 ⇒ v4.12.0
  [be0214bd] ↑ NonlinearSolveBase v1.16.1 ⇒ v2.0.0
  [5959db7a] ↑ NonlinearSolveFirstOrder v1.8.0 ⇒ v1.9.0
  [9a2c21bd] ↑ NonlinearSolveQuasiNewton v1.9.0 ⇒ v1.10.0
  [26075421] ↑ NonlinearSolveSpectralMethods v1.4.0 ⇒ v1.5.0
  [727e6d20] ↑ SimpleNonlinearSolve v2.8.0 ⇒ v2.9.0
⌃ [9672c7b4] ↓ SteadyStateDiffEq v2.6.0 ⇒ v2.4.1
        Info Packages marked with ⌃ have new versions available and may be upgradable.

```

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [October 3, 2025, 9:56am UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/16 "2025-10-03T09:56:49Z")

</div>

Check why

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [October 3, 2025, 11:54am UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/17 "2025-10-03T11:54:14Z")

</div>

> [@sob](#):
>
> `SteadyStateDiffEq`

This is where my knowledge of Julia package management is the limiting factor.

However, I have narrowed it down to the following MWE:

1. create empty project
2. add DifferentialEquations
3. update

What I observe on multiple machines is:

1. will install DifferentialEquations v7.16.1 and its dependency SteadyStateDiffEq v2.6.0
2. will downgrade SteadyStateDiffEq v2.6.0 ⇒ v2.4.1 (and  
ForwardDiff v1.2.1 ⇒ v0.10.39)

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [October 3, 2025, 12:37pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/18 "2025-10-03T12:37:11Z")

</div>

]why SteadyStateDiffEq

---

<div class="post-metadata">

### Author: ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)
#### Post date: [October 3, 2025, 12:59pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/19 "2025-10-03T12:59:57Z")

</div>

As per my MWE, it’s there because of DifferentialEquations (sole package in Project).

Additional note on my MWE: using julia 1.12 rc3, it’s necessary to add DiffEqGPU to step 2) to reproduce.

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [October 3, 2025, 1:13pm UTC](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693/20 "2025-10-03T13:13:12Z")

</div>

Ahh I found the issue. It was a NonlinearSolveBase bound in SteadyStateDiffEq that put things into an odd state. I just created a new release of that. I think we’re good now, 🤞 sorry for the troubles.

[Next page](https://discourse.julialang.org/t/linearsolvecudaext-fails-to-compile/131693.md?page=2)
