76

A little teaser of what is to come :) - Linux - Level1Techs Forums

 6 years ago
source link: https://forum.level1techs.com/t/a-little-teaser-of-what-is-to-come/121641?u=curioustommy
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

A little teaser of what is to come :)

Skip to main content

135808_1.png gnif:

All in good time :slight_smile:. Just wetting your appetite

Call me a sceptic, but what is it you’re developing exactly?

The 5ms latency sounds like you’re doing some form of screen recording.

Edit: read on, there’s no 5ms of latency, shuffling graphics around this way should get you mere microseconds of latency at less than or around 1% of CPU core at 4k 60Hz. There might be some overhead somewhere but theoretically this is all coming together as a very efficient mechanism to send graphics from one GPU to another.

The guest OS is rendering its graphics directly into a frame buffer in memory that is read and displayed directly by the host graphics card. There is no compression or anything like that. Essentially, it is a memory to memory copy.

As such it does not suffer from side effects from lossy compression (color shift, artifacts) and the latency is only as long as it takes to do memory copies, which on modern cpus is handled almost entirely without needing the CPU proper.

This will permit windows guests on linux hosts to display GPU accelerated video and graphics on the host with basically no delay, which will be the best user experience. Your windows guest with a passed-through graphics card no longer needs its own dedicated monitor.

Unfortunately NO.

Optimus is a whole other ballgame that involves Hardware MUX’s and DMA Framebuffer magic which prevents GPU passthrough entirely since you cannot uncouple one GPU from the other in an effective manner.

It can work for some very Niche cases however where the hardware is setup correctly:

reddit.com

Short report (WIP): Got the NVIDIA GPU to passthrough on an optimus laptop •... 131

Since there haven't been any successful posts regarding this setup, I'm sharing this so that others can try and improve this. This should work on...

The technical TLDR:

Most laptops are of the middle type. dGPU passthrough needs a laptop of the far right type.

image
gist.github.com

https://gist.github.com/Misairu-G/616f7b2756c488148b7309addc940b28 84

[GUIDE] Optimus laptop dGPU passthrough.md
[Reddit post](https://www.reddit.com/r/VFIO/comments/7d27sz/you_can_now_passthrough_your_dgpu_as_you_wish/)

#### Table of Content

- [What to expect?](#what-to-expect)
- [Prerequisites](#prerequisites)
  - [Hardware](#hardware)
  - [System & Software](#system--software)
  - [Update: Attention for MUXless laptop](#update-attention-for-muxless-laptop)
- [Bumblebee setup guide](#bumblebee-setup-guide)
This file has been truncated. show original
tap_ifdown
#!/bin/bash

# tap device name
TAP=tap0

# Network information
NETWORK=192.168.99.0
NETMASK=255.255.255.0
GATEWAY=192.168.99.1
This file has been truncated. show original
tap_ifup
#!/bin/bash

# Set to the name of your tap device
TAP=tap0

# Network information
NETWORK=192.168.99.0
NETMASK=255.255.255.0
GATEWAY=192.168.99.1
DHCPRANGE=192.168.99.2,192.168.99.10

This file has been truncated. show original



I’ve seen the video with Wendell and I got some questions, if you don’t mind…

  • Looks like you’re using Spice (or maybe you hacked Spice to use it). Will this work across a LAN?

  • Since you’re copying frames across memory region, does this opens the option to run few VM’s on a single GPU? (I’m pretty sure the answer is No, but one can always hope…)

  • Can other operations work on the same GPU that runs the guest VM? like using it’s GPU to compress/decompress those frames so it can work reliably on network?

Thanks and keep up the good work :wink:

gnifThe Mad-Developer 

139678_1.png hetz:

Looks like you’re using Spice

Spice is being used simply for keyboard and mouse input, I wrote my own light weight C client from scratch for this as the spice libraries are not really usable in their existing state in external projects. It is optional if you wan’t to use Spice if you would rather pass the VM a physical KB & Mouse directly.

139678_1.png hetz:

Since you’re copying frames across memory region, does this opens the option to run few VM’s on a single GPU? (I’m pretty sure the answer is No, but one can always hope…)

No, each VM needs dedicated access to the GPU, this is a physical hardware limitation. It would be nice though.

139678_1.png hetz:

Can other operations work on the same GPU that runs the guest VM? like using it’s GPU to compress/decompress those frames so it can work reliably on network?

Yes, compression in the guest in VGA hardware is completely possible, but it introduces latency and quality loss, which is what this project is attempting to avoid. At a later date we can look at adding this as I know there at current the other options to do this (Steam InHouse Streaming) is all game targetted and not general desktop.

gnifThe Mad-Developer 

40.png CuriousTommy:

Would it be possible to tell Windows to dynamically change it’s resolution based on the size of the Window?

At this point in time, no.

The video card has no concept of VM and wants to drive a physical monitor, the only way to do this would be to convince the video card that the monitor attached can do anything. For now this is outside the scope of the project, but it is certainly not off the table, I believe there is a way to make this work with nVidia but no idea for VEGA until I can play with the hardware.

w00t just saw the vid, awesome stuff @gnif and thanks to @wendell for the sneak peak. Having a (headless) workflow in linux would be incredible.

There are times when I do cringe cringe need to debug some JS in IE, and I have to suffer painfully slow services such as BrowserStack — yes, this is a rather boring use case, but for devs it certainly would be something. Imagine you need to administer some Citrix Xen boxes and need to use their windows only client… now you can (headless!)…

Oh… and decent gaming too I imagine (when the boss isn’t looking…)

gnifThe Mad-Developer 

129350_1.png bsodmike:

There are times when I do cringe cringe need to debug some JS in IE

One of my primary use cases for VMs :slight_smile:

129350_1.png bsodmike:

Oh… and decent gaming too I imagine (when the boss isn’t looking…)

My secondary use case, I can already confirm that major online titles like PUBG and BF3, BF4, BF1 and TitanFall all work perfectly under this setup. The capture method doesn’t hook or inject into any of the applications as such it doesn’t risk triggering any anti-cheat measures.

135808_1.png gnif:

At this point in time, no.

The video card has no concept of VM and wants to drive a physical monitor, the only way to do this would be to convince the video card that the monitor attached can do anything. For now this is outside the scope of the project, but it is certainly not off the table, I believe there is a way to make this work with nVidia but no idea for VEGA until I can play with the hardware.

Why not simulate the resize request to the VM/GPU as a monitor disconnect/reconnect w/fake EDID data for a resolution >= resized window?

gnifThe Mad-Developer 

40.png NaCl:

Why not simulate the resize request to the VM/GPU as a monitor disconnect/reconnect w/fake EDID data for a resolution >= resized window?

In time, at current this is a low priority :slight_smile:.

Also remember that the monitor is not a virtual device, you can’t exactly simulate a reconnect, there will need to be some vendor specific trickery here to achieve this. It is possible and I have a solution for nVidia at this point, but as stated above, this is low priority at current.

120785_1.png DirtyDan:

Do the drivers work for every graphics card or do new drivers have to be made for each card to work?

The driver is not related to the video card at all, it is simply a way of mapping memory between the guest and the host. I have been working with RedHat to have this included into the official VirtIO driver package. The source has been accepted upstream, we are just waiting for an official signed build now.

For now I am signing a test driver using my personal driver signing certificate, which is one of the reasons we can’t just release this yet.

hey so this is insanely awesome, I just watched the video wendell made and had an idea that might work for the needing a monitor attached situation. Not sure if it’s been brought up yet, but you can get “dummy plugs” for running on headless units:

amazon.com

Amazon.com: HDMI Displayport Dummy Plug Display Emulator for Headless PCs 4096x2160@60Hz, 3 Pack: Computers & Accessories 71

What does Display Emulator / Dummy Plug do? It fixes a problem you probably didn't even know you had - unlocking the full potential of your graphics card hardware. By simulating the presence of an att ...

$18.55

amazon.com

Amazon.com: FREEGENE DisplayPort Headless Ghost Display Emulator for PC 4K DP Dummy Plug 3840x2160@17Hz-3 Pack: MP3 Players & Accessories 27

What does Display Emulator / Dummy Plug do? It fixes a problem you probably didn't even know you had - unlocking the full potential of your graphics card hardware. By simulating the presence of an att ...

$18.55

not sure if anyone’s thought about this, but it could be really useful if you need to trick the system into thinking there’s a monitor attached in order to send the display to the buffer without needing an actual monitor

havent tested this but I remember coming across these a while back when i was working on my 4k stream/recording setup. hope it helps!

well, i have another solution, but it’s not cheap. I own one of these:

hdfury.com

Linker 4K60 4:4:4 600MHz | HDFury.com | Connect and Fix everything in HDMI 49

UHD and HDR scaler and HDCP converter, connect any HDMI/HDCP 1.x device in HDMI/HDCP 2.x setup

with it you can clone your monitor’s edid to the device

ie hdmi out on gpu->hdfury (with cloned id from monitor)->hdfury out to dummy

i havent tested it with a dummy plug but i can snag the plug and give an update. with the price im not sure if itd be worth though

also the edid clone software is windows only. womp womp


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK