diff --git a/browsers/gpu-acceleration.mdx b/browsers/gpu-acceleration.mdx index dc05c127..69e94b62 100644 --- a/browsers/gpu-acceleration.mdx +++ b/browsers/gpu-acceleration.mdx @@ -59,6 +59,68 @@ func main() { You can also enable GPU acceleration in the dashboard when deploying a browser under **Advanced Configuration**. +## Request more video memory + +A GPU browser gets 2 GiB of video memory by default, with 4 vCPUs and 6 GiB of memory. For WebGL scenes, large canvases, or video that run out of video memory, set `video_memory` to `4GiB`. That browser gets 4 GiB of video memory, 8 vCPUs, and 12 GiB of memory. + + +```typescript Typescript/Javascript +import Kernel from '@onkernel/sdk'; + +const kernel = new Kernel(); + +const kernelBrowser = await kernel.browsers.create({ + gpu: true, + video_memory: '4GiB', +}); +``` + +```python Python +from kernel import Kernel + +kernel = Kernel() + +kernel_browser = kernel.browsers.create( + gpu=True, + video_memory="4GiB", +) +``` + +```go Go +package main + +import ( + "context" + + "github.com/kernel/kernel-go-sdk" +) + +func main() { + ctx := context.Background() + client := kernel.NewClient() + + kernelBrowser, err := client.Browsers.New(ctx, kernel.BrowserNewParams{ + GPU: kernel.Bool(true), + VideoMemory: kernel.BrowserVideoMemory4GiB, + }) + if err != nil { + panic(err) + } + _ = kernelBrowser +} +``` + +```bash CLI +kernel browsers create --gpu --video-memory 4GiB +``` + + +`video_memory` requires SDK version 0.123.0 or later, or CLI version 0.47.0 or later. It accepts `2GiB` or `4GiB` and requires `gpu: true`. You can't set `memory` on a GPU browser, because `video_memory` determines its memory. The browser response includes `video_memory` and `memory`, so you can confirm the allocation you received. + +A browser with 4 GiB of video memory is billed for its 12 GiB of memory, so it costs twice the [standard GPU rate](/info/pricing#usage-rates). + +These browsers come from separate capacity. If none is available, creation fails with HTTP 529 and the `no_gpu_browsers_available` code instead of falling back to 2 GiB of video memory. Retry later, or omit `video_memory` to get a standard GPU browser. + ## Use cases GPU acceleration is useful for: diff --git a/browsers/process-execution.mdx b/browsers/process-execution.mdx index 8701b3df..e3cfdea4 100644 --- a/browsers/process-execution.mdx +++ b/browsers/process-execution.mdx @@ -240,7 +240,7 @@ Kernel doesn't expose a per-session memory metric in the API, CLI, or dashboard ### Read whole-session memory -`free` reports the memory allocated to your browser. A headless browser gets 1 GiB; a headful, non-GPU browser gets 8 GiB by default and 16 GiB when you set `memory` on [create](/api-reference/browsers/create-a-browser-session). +`free` reports the memory allocated to your browser. A headless browser gets 1 GiB; a headful, non-GPU browser gets 8 GiB by default and 16 GiB when you set `memory` on [create](/api-reference/browsers/create-a-browser-session). A GPU browser gets 6 GiB, or 12 GiB when you [request 4 GiB of video memory](/browsers/gpu-acceleration#request-more-video-memory). ```typescript Typescript/Javascript diff --git a/changelog.mdx b/changelog.mdx index a1fe87b8..d4886461 100644 --- a/changelog.mdx +++ b/changelog.mdx @@ -9,6 +9,16 @@ import { YouTubeVideo } from '/snippets/youtube-video.mdx'; For API library updates, see the [Node SDK](https://github.com/onkernel/kernel-node-sdk/blob/main/CHANGELOG.md), [Python SDK](https://github.com/onkernel/kernel-python-sdk/blob/next/CHANGELOG.md), and [Go SDK](https://github.com/onkernel/kernel-go-sdk/blob/main/CHANGELOG.md) changelogs. + +## Product updates + +- Added **`video_memory`** for [GPU browsers](/browsers/gpu-acceleration#request-more-video-memory). Set it to `4GiB` with `gpu: true` to get 4 GiB of video memory, 8 vCPUs, and 12 GiB of memory, double the default GPU browser. Available in the Node, Python, and Go SDKs from 0.123.0 and in the CLI from 0.47.0 as `--video-memory`. + +## Documentation updates + +- Documented [video memory](/browsers/gpu-acceleration#request-more-video-memory) on the GPU acceleration page and added its rate to [pricing](/info/pricing#usage-rates). + + ## Product updates diff --git a/info/pricing.mdx b/info/pricing.mdx index fe834374..1bd69ccb 100644 --- a/info/pricing.mdx +++ b/info/pricing.mdx @@ -20,6 +20,7 @@ With Kernel, you only pay for what you use and nothing more. You don't pay for i | Headful browser | 0.0001333336 | | Headless browser | 0.0000166667 | | Headful browser + GPU acceleration | 0.0008000016 | +| Headful browser + GPU acceleration, [4 GiB video memory](/browsers/gpu-acceleration#request-more-video-memory) | 0.0016000032 | | App invocation | 0.0000666668 | > Included monthly credits apply to usage costs only.