Atlaslog
Atlaslog / luma.gl / API reference / Device
luma.gl · API reference

Device

Quick answer

Device is the single entry point for GPU resources: it creates buffers, textures, shaders, pipelines, framebuffers and canvas contexts. In v9 create it asynchronously with luma.createDevice, passing type, adapters and createCanvasContext, and read device.features and device.limits to branch on backend capabilities.

Last verified 2026-11-03 · luma.gl 9.4 · Cite this page
luma. createDevice ( props ) → Promise<Device>
Key points
Example
<script src="https://cdn.jsdelivr.net/npm/@luma.gl/core@9.4.2/dist/dist.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@luma.gl/webgl@9.4.2/dist/dist.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@luma.gl/shadertools@9.4.2/dist/dist.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@luma.gl/engine@9.4.2/dist/dist.min.js"></script>
const device = await luma.luma.createDevice({
  type: 'webgl',
  adapters: [luma.webgl2Adapter],
  createCanvasContext: {
    canvas: document.getElementById('cv'),
    useDevicePixels: Math.min(window.devicePixelRatio, 2),
    autoResize: true
  }
});
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Device. https://www.jingweizhi.com/en/lumagl/api/device.html (accessed 2026-11-03).