# \[Omniscape\] Convergence error while trying to run it on almost any raster

**URL:** <https://discourse.julialang.org/t/omniscape-convergence-error-while-trying-to-run-it-on-almost-any-raster/138580>\
**Category:** General Usage\
**Tags:** package\
**Created:** [August 3, 2026, 8:28am UTC](https://discourse.julialang.org/t/omniscape-convergence-error-while-trying-to-run-it-on-almost-any-raster/138580 "2026-08-03T08:28:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![GimbalLock](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@GimbalLock](https://discourse.julialang.org/u/GimbalLock)\
**Post date:** [August 3, 2026, 8:28am UTC](https://discourse.julialang.org/t/omniscape-convergence-error-while-trying-to-run-it-on-almost-any-raster/138580/1 "2026-08-03T08:28:45Z")

</div>

Hello, I am trying to run the Omniscape example given on its documentation page: [Examples · Omniscape.jl](https://docs.circuitscape.org/Omniscape.jl/latest/examples/)

When I get to the line where I actually start the Omniscape algorithm, it errors out with the message: “CG solver did not converge: relative residual exceeds tolerance 1e-4”

Previously I’ve had success with running Omniscape in Julia 1.11 on my own rasters.

But after reinstalling Julia 1.11 on a new system, almost every raster I try gives me the “solver did not converge” error.  
The error occurs even on previously tried-out rasters that gave me good connectivity outputs… I tried changing the solver and numerous other settings, to no avail.

Is it possible that there are some new compatibility issues with packages that Omniscape depends on?

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [August 3, 2026, 9:06am UTC](https://discourse.julialang.org/t/omniscape-convergence-error-while-trying-to-run-it-on-almost-any-raster/138580/2 "2026-08-03T09:06:20Z")

</div>

Hi, welcome to the forum!  
Could you provide a complete example of the code you’re trying to run? This looks more like a numerical issue than a compatibility conflict to me

---

<div class="post-metadata">

**Author:** ![GimbalLock](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@GimbalLock](https://discourse.julialang.org/u/GimbalLock)\
**Post date:** [August 3, 2026, 10:22am UTC](https://discourse.julialang.org/t/omniscape-convergence-error-while-trying-to-run-it-on-almost-any-raster/138580/3 "2026-08-03T10:22:34Z")

</div>

This is the code that gives the convergence error, taken straight from their tutorial on the page I linked in the original post, without the raster visualization lines. It crashes after calling the run\_omniscape function.

```julia-auto
using Pkg; Pkg.add(["Omniscape", "Rasters", "Plots"])
using Omniscape, Rasters, Plots

url_base = "https://raw.githubusercontent.com/Circuitscape/datasets/main/"
# Download the NLCD tile used to create the resistance surface and load it
download(string(url_base, "data/nlcd_2016_frederick_md.tif"),
         "nlcd_2016_frederick_md.tif")

land_cover, wkt, transform = Omniscape.read_raster("nlcd_2016_frederick_md.tif", Float64)

# Create the reclassification table used to translate land cover into resistance
reclass_table = [
    11.	100; # Water
    21	500; # Developed, open space
    22	1000; # Developed, low intensity
    23	missing; # Developed, medium intensity
    24	missing; # Developed, high intensity
    31	100; # Barren land
    41	1; # Deciduous forest
    42	1; # Evergreen forest
    43	1; # Mixed forest
    52	20; # Shrub/scrub
    71	30; # Grassland/herbaceous
    81	200; # Pasture/hay
    82	300; # Cultivated crops
    90	20; # Woody wetlands
    95	30; # Emergent herbaceous wetlands
]

# Specify the configuration options
config = Dict{String, String}(
    "radius" => "100",
    "block_size" => "21",
    "project_name" => "md_nlcd_omniscape_output",
    "source_from_resistance" => "true",
    "r_cutoff" => "1", # Only forest pixels should be sources
    "reclassify_resistance" => "true",
    "calc_normalized_current" => "true",
    "calc_flow_potential" => "true"
)

currmap, flow_pot, norm_current = run_omniscape(config,
                                                land_cover,
                                                reclass_table = reclass_table,
                                                wkt = wkt,
                                                geotransform = transform,
                                                write_outputs = true)

```

---

<div class="post-metadata">

**Author:** ![GimbalLock](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@GimbalLock](https://discourse.julialang.org/u/GimbalLock)\
**Post date:** [August 3, 2026, 10:31am UTC](https://discourse.julialang.org/t/omniscape-convergence-error-while-trying-to-run-it-on-almost-any-raster/138580/4 "2026-08-03T10:31:03Z")

</div>

The code I’ve used on my own rasters is like this tutorial but without the mapping of categories, as I supply the continuous resistance raster directly, not a categorical raster. But this example is more convenient to share, as the raster used in it can be downloaded by you.

My key concerns here are that I get the convergence crash even on **their** example, and that I could previously run these connectivity analyses with the **same Julia version** on my old workstation, but now running it on the same resistance rasters with the same config gives these errors.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [August 3, 2026, 12:33pm UTC](https://discourse.julialang.org/t/omniscape-convergence-error-while-trying-to-run-it-on-almost-any-raster/138580/5 "2026-08-03T12:33:00Z")

</div>

What happens if you freeze the Manifest on your old workstation and try to instantiate it on your new one?

---

<div class="post-metadata">

**Author:** ![GimbalLock](https://avatars.discourse-cdn.com/v4/letter/g/f17d59/32.png) [@GimbalLock](https://discourse.julialang.org/u/GimbalLock)\
**Post date:** [August 3, 2026, 1:22pm UTC](https://discourse.julialang.org/t/omniscape-convergence-error-while-trying-to-run-it-on-almost-any-raster/138580/6 "2026-08-03T13:22:53Z")

</div>

Just instantiating the Manifest from my old workstation on my new one did not result in any errors.  
I tried running the code from the tutorial again, but got the same error. The stack trace traces it to Circuitscape’s multiple\_solve function which calls solve\_linear\_system where the error is finally thrown.

The text I’ve pasted below is Omniscape’s whole output before the long stacktrace of the error:

```julia-auto
[ Info: Starting up Omniscape with 1 workers and double precision  
[ Info: Using Circuitscape with the cg+amg solver... 
[ Info: Calculating block artifact correction array... 
[ Info: Solver used: AMG accelerated by CG 
ERROR: LoadError: CG solver did not converge: relative residual 0.00010853220771087492 exceeds tolerance 1e-4

```

---

<div class="post-metadata">

**Author:** ![siskczk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/siskczk/32/223888_2.png) [@siskczk](https://discourse.julialang.org/u/siskczk)\
**Post date:** [September 8, 2026, 11:03pm UTC](https://discourse.julialang.org/t/omniscape-convergence-error-while-trying-to-run-it-on-almost-any-raster/138580/7 "2026-09-08T23:03:56Z")

</div>

Hello I am having an identical issue with a Julia 1.11.9 using a linux Bootstrap: docker. The version of circuitscape is “5.17.1” and the version of Omniscape is “0.6.2” from my manifest.toml file. Based on the Github for omniscape it appears that there is a restriction of the version to 5.15. this was released 4 days ago so may be a fix. [Omniscape.jl/Project.toml at main · Circuitscape/Omniscape.jl · GitHub](https://github.com/Circuitscape/Omniscape.jl/blob/main/Project.toml)
