Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions browsers/gpu-acceleration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<CodeGroup>
```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
```
</CodeGroup>

`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:
Expand Down
2 changes: 1 addition & 1 deletion browsers/process-execution.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<CodeGroup>
```typescript Typescript/Javascript
Expand Down
10 changes: 10 additions & 0 deletions changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</Note>

<Update label="October 9" tags={["Product", "Docs"]}>
## 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).
</Update>

<Update label="October 6" tags={["Product", "Docs"]}>
## Product updates

Expand Down
1 change: 1 addition & 0 deletions info/pricing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading