Skip to content

02 - Installation and setup

Hardware and operating system

Item Embree (CPU) Vulkan (GPU) OptiX (GPU)
Hardware x86-64 CPU or Apple Silicon NVIDIA, AMD or Intel GPU with Vulkan ray queries NVIDIA GPU
GPU memory — 4 GB or more, 8 GB recommended 4 GB or more, 8 GB recommended
Driver none a recent graphics driver a recent NVIDIA driver
Operating system Windows 10/11, Linux, macOS 15 or later Windows 10/11, Linux Windows 10/11, Linux
Python 3.10–3.13 3.10–3.13 3.10–3.13

Use Embree for CPU simulations. On NVIDIA hardware OptiX is usually the fastest. AMD and Intel GPUs use Vulkan.

Installing

In your Python environment, install LESS from PyPI.

pip install less3d

Pip selects the wheel for your operating system and Python version. LESS 3.1.1 has wheels for Python 3.10–3.13 on Windows and Linux x86-64 and on Apple Silicon with macOS 15 or later. The wheel includes the compute libraries. GPU backends require a compatible graphics driver.

Optional components

Some features need extra Python libraries:

Component Used for Installs
lidar Reconstructing scenes from .las/.laz point clouds (chapter 18) laspy, cloth-simulation-filter
atmosphere Cloud and gas optical tables, or the 6S atmosphere (chapter 17) h5py, filelock, Py6S
pip install "less3d[lidar]"
pip install "less3d[atmosphere]"

Checking the installation

import less

print("LESS", less.__version__)
for backend in less.list_backends(probe=True):
    print(backend.name, backend.available, backend.unavailable_reason or "")

A working installation prints something like:

LESS 3.1.1
optix True
embree True
vulkan True

When a backend shows False, the reason follows, for example that no supported GPU was found or that the driver is too old.

Choosing the backend and device

scene = less.Scene()                            # automatic
scene = less.Scene(backend="optix")             # NVIDIA OptiX
scene = less.Scene(backend="vulkan")            # Vulkan
scene = less.Scene(backend="embree")            # CPU
scene = less.Scene(backend="vulkan", device=1)  # second Vulkan device
Parameter Default Meaning
backend "auto" "auto", "optix", "vulkan" or "embree"
device 0 GPU index within the chosen backend

If the requested backend is not available, LESS raises an error with the reason instead of switching to another backend. Choose the backend explicitly when you compare performance or need fixed hardware.

To see which features run on this machine:

print(less.available_features())
print(less.can_use("lidar_waveform", backend="embree"))

Comparing the three backends

import time
import less

def run(backend):
    scene = less.Scene(backend=backend)
    scene.size = 10.0
    scene.terrain = less.Terrain(property=less.Lambertian(reflectance=0.3))
    scene.illumination = less.Illumination(
        source=less.Sun(zenith=30, azimuth=150),
        atmosphere=less.SimpleSpectralAtmosphere(turbidity=2.0))
    sensor = less.OpticalImager(
        less.Orthographic(image_size=256), bands=[650, 550, 450], quality=64)
    scene.simulate(sensor)                 # the first run also builds the scene
    start = time.perf_counter()
    scene.simulate(sensor)
    return time.perf_counter() - start

for name in ("optix", "vulkan", "embree"):
    try:
        print(f"{name}: {run(name) * 1000:.1f} ms")
    except Exception as error:
        print(f"{name}: not available ({error})")

The first run on a given GPU is noticeably slower because the driver compiles the compute programs. The compiled programs are cached in your user directory and reused afterwards. To keep the cache in a fixed place, set the environment variable LESS_CACHE_DIR before starting Python.

macOS on Apple Silicon

On macOS 15 or later, run the installation command from an arm64 Python 3.10–3.13 environment. Use less.Scene(backend="embree") to run simulations on the CPU. The Apple Silicon wheel includes the microwave module. Use the Embree backend for SAR imaging, radar backscatter, and microwave radiometry.

Built-in examples

LESS ships with a few complete scenes that are handy for checking an installation:

python -m less.examples autumn_forest
python -m less.examples maize_field

They open the 3-D viewer in your browser (see chapter 6).

Common problems

A GPU backend is reported as unavailable. Run less.list_backends(probe=True) to see why. Usually updating the graphics driver fixes it; AMD and Intel GPUs must also support Vulkan ray queries. NVIDIA users can check the driver with nvidia-smi.

Out of GPU memory. Reduce the number of triangles or the scene extent, close other programs that use the GPU, or use backend="embree".

image.show() does not open a window. matplotlib is using a non-interactive backend. Choose an interactive one at the top of your script:

import matplotlib
matplotlib.use("TkAgg")

If you only need the picture, use image.save("out.png").

Next