# Error: All viewed matrices must belong to the same allocation extent

**URL:** <https://pyfr.discourse.group/t/error-all-viewed-matrices-must-belong-to-the-same-allocation-extent/1363>\
**Category:** Errors\
**Created:** [20 May 2026 08:00 UTC](https://pyfr.discourse.group/t/error-all-viewed-matrices-must-belong-to-the-same-allocation-extent/1363 "2026-05-20T08:00:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![julius](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@julius](https://pyfr.discourse.group/u/julius)\
**Post date:** [20 May 2026 08:00 UTC](https://pyfr.discourse.group/t/error-all-viewed-matrices-must-belong-to-the-same-allocation-extent/1363/1 "2026-05-20T08:00:19Z")

</div>

Hi Everyone!

As the title suggests, I encounter the error “TypeError: All viewed matrices must belong to the same allocation extent”, raised in pyfr/backends/base/types.py, when starting a case.

I have set up a very simple test case in 2D and 3D, consisting of quads and tri elements or quads, tri, hex, pyr and tet elements, respectively. You can find the meshes / .ini files below. I noticed that the error is only raised for certain combinations of polynomial order & solution / flux point sets:

2D, working:

- Quad elements: GLL
- Tri elements: Alpha-Opt
- Line interfaces: GLL

2D, not working:

- Quad elements: GLL
- Tri elements: Williams-Shunn
- Line interfaces: GLL

For 2D, changing polynomial order did not change anything. However, in 3D it is a bit different:

3D, p = 1,2, working:

- Quad, Pyr & Hex elements: GLL
- Tri, Tet elements: Alpha-Opt
- Line & Quad interfaces: GLL
- Tri interfaces: Alpha-Opt

For p \>= 3 the configuration above raised the error.

3D, all p, not working:

- Quad, Pyr & Hex elements: GLL
- Tri elements: Williams-Shun
- Tet elements: Shunn-Ham
- Line & Quad interfaces: GLL
- Tri interfaces: Williams-Shun

I mainly used PyFR version 2.1 (in 3.1 it raised the same error, although technically my rocm version is not new enough), with hip backend and rocm/6.4.0. The BCs & ICs are relatively arbitrary, since the issue arises before anything starts anyways.

Here are the meshes and .ini files:  
[Test\_folder](https://drive.google.com/drive/folders/1M5yY7e43rQctLOOiPtX33TPgpmSPs8YK?usp=sharing)

Does anyone know how to solve this issue?

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [21 May 2026 01:26 UTC](https://pyfr.discourse.group/t/error-all-viewed-matrices-must-belong-to-the-same-allocation-extent/1363/2 "2026-05-21T01:26:34Z")

</div>

This is an edge case which we currently don’t handle, it shouldn’t be to difficult to fix. I’ll put together a patch tomorrow.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [23 May 2026 13:08 UTC](https://pyfr.discourse.group/t/error-all-viewed-matrices-must-belong-to-the-same-allocation-extent/1363/3 "2026-05-23T13:08:10Z")

</div>

A fix should now be in the develop branch.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![julius](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@julius](https://pyfr.discourse.group/u/julius)\
**Post date:** [25 May 2026 06:34 UTC](https://pyfr.discourse.group/t/error-all-viewed-matrices-must-belong-to-the-same-allocation-extent/1363/4 "2026-05-25T06:34:29Z")

</div>

It worked, great, thanks a lot!
