Does WSL2 support GPU acceleration for launching Android emulators?
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
**Is your feature request related to a problem? Please describe.**
I built an AOSP Android image based off Android 14.0.0_r66. I launch the built emulator with `cvd start --report_anonymous_usage_stats=n --daemon --start_webrtc=true --run_adb_connector=true`. Everything works fine, except that it complains the GPU acceleration is not available and switches to a software rendering.
```
cvd start --report_anonymous_usage_stats=n --daemon --start_webrtc=true --run_adb_connector=true
...
GPU auto mode: did not detect prerequisites for accelerated rendering support, enabling --gpu_mode=guest_swiftshader.
GPU vhost user auto mode: not needed for --gpu_mode=guest_swiftshader. Not enabling vhost user gpu.
```
**Describe the solution you'd like**
Not sure why `cvd start` cannot detect the GPU acceleration. It should detect it automatically.
**Describe alternatives you've considered**
Running with `--gpu_mode=gfxstream`
**Additional context**
```
> wsl --version
WSL version: 2.5.10.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.66
MSRDC version: 1.2.6074
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.6899
```
```
wsl --list --verbose
NAME STATE VERSION
* Ubuntu-24.04 Running 2
```
In Ubuntu:
```
$ ls -l /dev/dxg
crw-rw-rw- 1 root root 10, 125 Nov 4 20:43 /dev/dxg
$ vulkaninfo | grep -E "apiVersion|deviceName"
apiVersion = 1.4.305 (4210993)
deviceName = llvmpipe (LLVM 20.1.2, 256 bits)
```
My laptop has two graphics adapters: Intel (display only) and nVidia (render only). `dxdiag` is attached.
Contributor guide
Research direction
Start by reproducing the `cvd start` command in the reported Ubuntu-24.04 WSL2 environment, then inspect `/dev/dxg` and the `vulkaninfo` output. Done means the emulator detects accelerated rendering rather than selecting `guest_swiftshader`, with the reported Intel and nVidia adapter setup accounted for.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cpp, linux
- Domain
- computer-graphics, mobile-dev, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100