Plan

RandR is X11 extension for configuring monitors and since version 1.4 also secondary GPUs. These secondary GPUs can either provide additional monitors to output to or can render individual applications instead of the main GPU. (Or even both at once.) Once a secondary GPU is configured to do render offloading, applications can be started with DRI_PRIME=<id> environment variable to actually render on it instead of the main one. There are also USB GPUs (dummy framebuffers) that can be hot-plugged.

All this can be currently configured only using xrandr utility. And by starting applications with the DRI_PRIME set. I am not aware of any GUI tool that could do it.

I would like to extend KDE configuration to allow this. Goals are:

  1. Display available GPUs and their configuration in the KDE System Settings. Probably as part of kcm_kscreen module.

  2. React to hot-plugged GPUs and display some popup. Or configure them automagically. Just as KDED/KScreen currently does for monitors.

  3. Investigate some GUI-friendly way to set the DRI_PRIME variable to specific applications. Maybe some additional parameter to .desktop file + GUI to edit it.

Use cases:

  1. Computer with strong main GPU and some weak secondary GPU just for additional monitors - KDE should remember the configuration and configure the secondary GPU and it's monitors on start. Just as it does with the monitors now.

  2. Hot-plug of USB adapter for additional monitor - KDE should show some popup to configure the adapter and monitor on it and remember the configuration for future.

  3. Notebook with weak main GPU (intel) and strong secondary GPU (nvidia/ati) - KDE should configure the secondary GPU for render offloading and allow user to select individual applications (like games, Blender, ...) to render on the strong one.

Progress

<ol> <li> libkscreen now detects and queries randr 1.4 and exposes list of providers.</li> <li> kscreen-console can print out list of available providers:

<h6>Output from xrandr:</h6>

<pre>

xrandr --listproviders Providers: number : 3 Provider 0: id: 0x4b cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 4 outputs: 8 associated providers: 1 name:Intel Provider 1: id: 0xa2 cap: 0x7, Source Output, Sink Output, Source Offload crtcs: 2 outputs: 3 associated providers: 1 name:nouveau Provider 2: id: 0x391 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 0 name:modesetting </pre>

<h6>Output from kscreen-console:</h6>

<pre>

kscreen-console

...

Id: 75 Name: "Intel" Capabilities:
Source Output Sink Output Sink Offload


Id: 162 Name: "nouveau" Capabilities:
Source Output Sink Output Source Offload


Id: 913 Name: "modesetting" Capabilities:
Sink Output </pre>

<li>KScreen KCM module (the "Display and Monitor" panel in KDE System Settings) can display providers. Changing configuration the over GUI is still work in progress.<br>

<img src="https://dl.dropboxusercontent.com/s/rfu68zduxjev94h/screenshot.png?dl=0">

</li> </ol>

Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 11

Activity

  • over 9 years ago: vbabka liked this project.
  • over 9 years ago: michalsrb started this project.
  • over 9 years ago: sndirsch liked this project.
  • over 9 years ago: oholecek liked this project.
  • over 9 years ago: michal-m liked this project.
  • over 9 years ago: michalsrb originated this project.

  • Comments

    • vbabka
      over 9 years ago by vbabka | Reply

      That's nice! didn't know about this DRI_PRIME approach. I guess it doesn't work with nvidia-drivers though?

      • michalsrb
        over 9 years ago by michalsrb | Reply

        The nvidia driver supports output sourcing, but nothing else: http://us.download.nvidia.com/XFree86/Linux-x86/340.46/README/randr14.html So one can use additional GPUs to get additional outputs for the primary nvidia card. But not the other way around and no render offloading. Nouveau driver supports it all.

    Similar Projects

    This project is one of its kind!