Skip to content
Merged
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
66 changes: 66 additions & 0 deletions browsers/gpu-acceleration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,72 @@ func main() {

You can also enable GPU acceleration in the dashboard when deploying a browser under **Advanced Configuration**.

## Request more video memory

GPU browsers come with 3 GiB of video memory, 4 vCPUs, and 6 GiB of memory by default. For WebGL scenes, large canvases, or video workloads that need more, set `video_memory` to `6GiB` to get 6 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: '6GiB',
});
```

```python Python
from kernel import Kernel

kernel = Kernel()

kernel_browser = kernel.browsers.create(
gpu=True,
video_memory="6GiB",
)
```

```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.BrowserVideoMemory6GiB,
})
if err != nil {
panic(err)
}
_ = kernelBrowser
}
```

```bash CLI
kernel browsers create --gpu --video-memory 6GiB
```
</CodeGroup>

`video_memory` accepts `3GiB` or `6GiB` (SDK `0.141.0` or later) and requires `gpu: true`. You can't set `memory` on a GPU browser because `video_memory` sets its system memory too. The browser response returns both `video_memory` and `memory`.

<Note>
`2GiB` and `4GiB` are deprecated aliases for `3GiB` and `6GiB`. Requests that send them receive the `3GiB` or `6GiB` allocation, and responses always report `3GiB` or `6GiB`. Update to the new values when you upgrade your SDK.
</Note>

A `6GiB` video memory browser has 12 GiB of system memory and bills at twice the [standard GPU rate](/info/pricing#usage-rates).

Large GPU browsers use a separate capacity pool. When that pool is full, creation fails with HTTP `529` (`no_gpu_browsers_available`) rather than falling back to `3GiB`. Retry later, or omit `video_memory` to create 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. non-gpu headless browsers use `1GiB` by default and support `2GiB` or `4GiB`; non-gpu headful browsers use `8GiB` by default and support `16GiB`. set `memory` when you [create a browser](https://www.kernel.sh/docs/api-reference/browsers/create-a-browser-session) to select the larger allocation.
`free` reports the memory allocated to your browser. Non-GPU headless browsers use `1GiB` by default and support `2GiB` or `4GiB`; non-GPU headful browsers use `8GiB` by default and support `16GiB`. Set `memory` when you [create a browser](/api-reference/browsers/create-a-browser-session) to select the larger allocation. GPU browsers use `6GiB` by default, or `12GiB` when you [request 6 GiB of video memory](/browsers/gpu-acceleration#request-more-video-memory).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relative API reference link

Medium Severity

The create-a-browser link was changed from an absolute https://www.kernel.sh/docs/api-reference/... URL to a relative /api-reference/ path. API reference pages are generated from the remote OpenAPI spec and are not local MDX files, so relative /api-reference/ links fail mint broken-links.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bed735f. Configure here.


<CodeGroup>
```typescript Typescript/Javascript
Expand Down
Loading