LizardByte / LizardByte/Sunshine

Frames not captured correctly in vm's running with Native Context gpu passthrough on amd hardware.

Open
#5,635 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
41.3k
Forks
2.1k
Avg merge
23h 47m
Merged PRs (30d)
124

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your issue described in the documentation?

- [x] I have read the documentation

### Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

### Describe the Bug

Native Context has a few issues in sunshine, the first is that everything other then KMS capture crashes outright (or shows a solid color screen). The second is that KMS capture does *not* handle DCC or tiling properly, this results in garbled frame data. To fix the latter issue you can add AMD_DEBUG=nodcc,notiling but this heavily kneecaps performance.

For a guest os I recommend cachyos because it's guest mesa is natively compiled with the required options. I have tested on ubuntu and debian though it's a lot jankier to set up.

### Expected Behavior

No crashing, and no garbled frame data.

### Additional Context

Native Context is a (relatively) new feature added to the virtio suite. It's definitely still maturing but having proper support in sunshine would be a godsend since it's the best app for interacting with these virtual VM's.

This may be best fixed outside the project if it's an issue of DCC and tiling not being presented correctly within the os. I've been meaning to look more into it for the better part of a year and haven't had enough time :/ . I figure I should make an issue and hopefully someone else can pick it up sooner then I'll be able to lol. (thanks to whoever does)

### Host Operating System

Linux

### Operating System Version

>=6.14

### Architecture

amd64/x86_64

### Package

other (self built)

### GPU Type

AMD

### GPU Model

8060s

### GPU Driver/Mesa Version

13.2 (everything since native context existed)

### Capture Method

KMS (Linux)

### Apps

```json

```

### Log output

```shell

```

### Online logs

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Sunshine's Linux KMS capture path and reproduce the issue using Native Context with AMD GPU passthrough on Linux 6.14 or newer. Compare capture behavior with and without AMD_DEBUG=nodcc,notiling; done means capture no longer crashes or produces garbled frames without that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
computer-graphics, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.