Skip to contents

r_package bixverse status badge CI License: MIT pkgdown extendr Lifecycle: experimental

What this is

GPU-accelerated methods for bixverse and manifoldsR, written in Rust on cubecl/Burn with the WGPU backend. All you need is a GPU that WGPU can talk to: Metal on macOS, Vulkan on Linux, DX12 or Vulkan on Windows. No CUDA, no vendor lock-in, no separate GPU toolchain to install.

Check with gpu_available() after installing. If that returns TRUE, you’re good to go. If it returns FALSE, your drivers are the problem, and the cubecl book covers the set up per platform.

This is not a stand-alone package. Most functions take a bixverse SingleCells or MetaCells object and slot into the same workflow as their CPU counterparts. If you only want the GPU kNN searches or a parametric UMAP, the rs_ functions and parametric_umap() work on plain matrices.

Heads up: the R-facing API can still shift between versions. lifecycle: experimental covers the whole surface and means it.

What’s in it

Domain What’s in there Read more
Single cell core Sparse PCA (exact Lanczos or randomised), kNN graphs (NN-descent, CAGRA, IVF, exhaustive), Harmony, fastMNN, BBKNN, fast clustering single cell
Meta cells SEACells, both Frank-Wolfe solves on the GPU SEACells
Regulons SCENIC with ExtraTrees and random forest learners on the GPU. grnboost2 stays on the CPU, it does not gain much SCENIC
QC and DGE Scrublet doublet detection, NEBULA mixed models Scrublet, NEBULA
Factorisation NMF, stabilised and consensus NMF, k sweeps NMF
Trees Bonsai, with Sanity running on the GPU; tree search and layout stay on the CPU ?bonsai_gpu_sc
Embeddings UMAP, tSNE (Barnes-Hut and FFT), PHATE, parametric UMAP with GPU and CPU backends UMAP, tSNE, PHATE, parametric UMAP
General k-means, Pearson and Spearman correlations, covariance other methods

The “bixverse ecosystem”

  • bixverse is the parent package. Single cell, bulk, gene set enrichment, ontologies, graphs. Everything here plugs into its classes.
  • bixverse.plots for plotting, with a large number of single cell helpers.
  • manifoldsR for manifold learning. The GPU UMAP, tSNE, PHATE and parametric UMAP here sit next to its CPU versions.

Installation

On the GPU side there is nothing extra to install beyond working drivers; whatever your OS ships is what WGPU picks up. The CPU path of the neural net methods used to go through ndarray with OpenBLAS (Linux) or Accelerate (Mac). It now runs on Burn’s flex backend, so no BLAS set up either.

The easy route is r-universe. You get a pre-built binary, so no Rust toolchain and no compile:

install.packages(
  "bixverse.gpu",
  repos = c("https://gregorlueg.r-universe.dev", "https://cloud.r-project.org")
)

From source

Building from source needs Rust on your system. Install guide here, and the rextendr guys have written a lot of further help on the Rust set up here.

  1. In the terminal, install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. In R, install rextendr:
install.packages("rextendr")
  1. Install bixverse.gpu. Keep the r-universe repo in the list: bixverse and manifoldsR live there, not on CRAN.
options(repos = c("https://gregorlueg.r-universe.dev", getOption("repos")))
devtools::install_github("https://github.com/GregorLueg/bixverse.gpu")

Windows

Windows builds and installs, but the GPU side only partly works there for now. On the DX12 backend wgpu compiles shaders with Microsoft’s FXC, which is stricter about barriers in branching code than Metal or Vulkan. A handful of kernels fail to compile, so k-means, IVF kNN, tSNE, NMF, Scrublet, SCENIC, SEACells and parts of the single-cell suite error out. UMAP, parametric UMAP, fastMNN and exhaustive / NNDescent kNN run fine. Forcing Vulkan with Sys.setenv(WGPU_BACKEND = "vulkan") before the first GPU call should sidestep FXC, but that’s untested. The tests for the affected methods are skipped on Windows until the kernels are fixed upstream. PHATE is untested there: its default spectral landmarks run the same GPU k-means, so expect it to hit the same wall; landmark_method = "random" or "density" avoids it.

The FFT-accelerated tSNE used to be the one thing missing on Windows, since FFTW did not come along for the ride. It now runs on the pure-Rust rustfft, so approx_type = "fft" and "fft_3k" work everywhere.

MLX on Apple Silicon

On Apple Silicon there is an optional second backend: MLX, via mlx-c. It is off by default because mlx-c is a system library the package cannot ship, so you opt in at install time:

brew install mlx-c
Sys.setenv(BIXVERSE_GPU_MLX = "true")
# MLX_C_PREFIX if mlx-c is not under /opt/homebrew
devtools::install_github("https://github.com/GregorLueg/bixverse.gpu")

This needs a source build, the r-universe binaries are WGPU only. Check with mlx_available(). Functions with an MLX path then take backend = "mlx": PCA, kNN graphs, Harmony, SEACells, NMF, UMAP, tSNE, PHATE and the correlations. MLX runs in fp32 only. Everything else stays on WGPU.

Older Intel Macs

Likely not a good time. A Mac without a native GPU that Metal can drive properly, such as a macOS VM with a paravirtualised GPU, may advertise subgroup (plane) operations and then silently drop every kernel that uses them. The macos-15-intel GitHub runners do exactly that. NEBULA and Bonsai check for this and refuse to run; other methods pass CI on those runners, but treat results on such a machine with suspicion and compare against the CPU version in bixverse.

Where to start

The package website is the main entry point. The single cell article is the obvious first stop: it runs the standard workflow with the GPU versions swapped in. What changed in each release: the changelog.

Working with an LLM coding agent? install_agent_skill_gpu() drops a skill into your agent set up so it stops guessing at the API.

Roadmap

Implemented

General

If you have some other ideas, please feel free to open an issue.

Last update to the read-me: 09.11.2026