Registry / ai-ml / mitsuba

mitsuba

JSON →
library3.8.0pypypi✓ verified 85d ago

Mitsuba 3 is a research-oriented retargetable forward and inverse renderer, version 3.8.0, with variable release cadence. It provides a Python API for physically based rendering and differentiable rendering.

pip install mitsuba
INSTALL
IMPORT
SIG · MITSUBA
M
mitsuba
ai-mlpythonv3.8.0
Install
4.4s avg
Import
Disk
220MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.4s · import 0.000s · 222MB
220MB installed
● package 220MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mitsuba
import mitsuba as mi
import mitsuba
Convention is to import as 'mi' for brevity.
Scene
mi.load_file('scene.xml')
mitsuba.load_xml('scene.xml')
Use load_file to load XML scenes, not load_xml.
render
mi.render(scene)
mitsuba.render_scene(scene)
Render function is 'mi.render'.

Initialize Mitsuba, load the Cornell Box scene, render, and save result.

import mitsuba as mi mi.set_variant('scalar_rgb') scene = mi.load_file(mi.cornell_box()) image = mi.render(scene) mi.util.write_bitmap('out.png', image) print('Rendered Cornell Box to out.png')
Debug
Known issues
breakingVariant must be set before any scene loading or rendering. Not setting a variant leads to ImportError or runtime errors.
fix
Call mi.set_variant('scalar_rgb') (or other variant) at the start of your script.
affects: 3.x
deprecatedmi.load_xml() and mi.render_scene() are deprecated. Use mi.load_file() and mi.render() instead.
fix
Replace mi.load_xml with mi.load_file, and mi.render_scene with mi.render.
affects: 3.0 - 3.8
gotchaRepeated set_variant calls in the same process cause undefined behavior. You can only set variant once per session.
fix
Set variant once at the top; avoid calling set_variant again.
affects: 3.x
gotchaMitsuba uses a custom memory allocator; mixing with other libraries that use incompatible allocators (e.g., PyTorch with CUDA) may cause segmentation faults.
fix
Enable memory pooling via mi.set_memory_pool_enabled(True) or manage allocation scope. For differentiable rendering, use the provided mitsuba.python.autodiff module.
affects: 3.x
Errors
Common errors & fixes
ImportError: cannot import name 'load_xml' from 'mitsuba'
Deprecated load_xml was removed in newer versions. Use mi.load_file.
fix
Replace 'mi.load_xml' with 'mi.load_file'.
RuntimeError: No variant selected! Use mi.set_variant() before calling any Mitsuba functions.
You forgot to set a variant before using the API.
fix
Add 'mi.set_variant('scalar_rgb')' (or appropriate variant) at the beginning of your script.
AttributeError: module 'mitsuba' has no attribute 'render'
Variant not set, or using old API 'mi.render_scene'.
fix
Set variant first: mi.set_variant('scalar_rgb'); then call mi.render(scene).
OSError: cannot load library: ...libmitsuba-core.so: cannot open shared object file
Missing dynamic libraries, typically because mitsuba is not built with the correct variant or installed from source without proper setup.
fix
Install precompiled wheel via 'pip install mitsuba' for your variant (e.g., 'scalar_rgb', 'cuda_ad_rgb').
Upgrade
Version history
3.8.0latest on PyPI · released Feb 23, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
mitsuba — pip install mitsuba · libregistry