# Build Python wheels with SMP tools for runtime backend selection

**URL:** https://discourse.vtk.org/t/build-python-wheels-with-smp-tools-for-runtime-backend-selection/16268
**Category:** Development
**Created:** [February 3, 2026, 8:48pm UTC](https://discourse.vtk.org/t/build-python-wheels-with-smp-tools-for-runtime-backend-selection/16268 "2026-02-03T20:48:51Z")
**Posts on this page:** 1
**Page:** 2

<div class="post-metadata">

### Author: ![hakostra](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hakostra/32/2990_2.png) [@hakostra](https://discourse.vtk.org/u/hakostra)
#### Post date: [April 10, 2026, 7:33am UTC](https://discourse.vtk.org/t/build-python-wheels-with-smp-tools-for-runtime-backend-selection/16268/21 "2026-04-10T07:33:09Z")

</div>

I think you can also set the environment variable `VTK_SMP_BACKEND_IN_USE="STDThread"` to get the same effect, without changing any Python code. In that case VTK will select the maximum available number of threads on your system.

How this behave on a specific system can be tested by making a small script:

```auto
import vtk

tool = vtk.vtkSMPTools()
print(f"Present backend: {tool.GetBackend()}")
print(f"Est. number of threads: {tool.GetEstimatedNumberOfThreads()}")

```

and running it with the variable set:

```auto
$ VTK_SMP_BACKEND_IN_USE="STDThread" python3 vtk-smp-backend.py 
Present backend: STDThread
Est. number of threads: 32

```

[Previous page](https://discourse.vtk.org/t/build-python-wheels-with-smp-tools-for-runtime-backend-selection/16268.md?page=1)
