Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux: enable support for iGVT-g VGPU #40242

Merged
merged 5 commits into from Jun 2, 2018
Merged

linux: enable support for iGVT-g VGPU #40242

merged 5 commits into from Jun 2, 2018

Conversation

ghost
Copy link

@ghost ghost commented May 9, 2018

Motivation for this change

Intel GVT-g (KVMGT) is a full GPU virtualization solution with mediated pass-through which allows host and multiple KVM guests to share same Intel integrated videocard. Guest gets a near-native graphics peformance.

This PR adds missing kernel configuration options. See https://nixos.wiki/wiki/IGVT-g
It also adds module which simplifies setup:

  virtualisation.kvmgt.enable = true;
  virtualisation.kvmgt.vgpus = {
    "i915-GVTg_V5_8" = {
      uuid = "a297db4a-f4c2-11e6-90f6-d3b88d6c9525";
    };
  };
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@andir
Copy link
Member

andir commented May 10, 2018

Is this everything we need for that to work? How about qemu version/features?

@ghost
Copy link
Author

ghost commented May 10, 2018

@andir Yes, that's all. Qemu 2.12 is already in nixos-unstable built with necessary features.

@matthewbauer
Copy link
Member

@GrahamcOfBorg build phodav spice-gtk

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: phodav, spice-gtk

Partial log (click to expand)

gzipping man pages under /nix/store/2agj7zk1qz5q1yxpy0knysxnagwhgzzc-spice-gtk-0.34/share/man/
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/2agj7zk1qz5q1yxpy0knysxnagwhgzzc-spice-gtk-0.34/lib  /nix/store/2agj7zk1qz5q1yxpy0knysxnagwhgzzc-spice-gtk-0.34/bin
patching script interpreter paths in /nix/store/2agj7zk1qz5q1yxpy0knysxnagwhgzzc-spice-gtk-0.34
checking for references to /build in /nix/store/2agj7zk1qz5q1yxpy0knysxnagwhgzzc-spice-gtk-0.34...
shrinking RPATHs of ELF executables and libraries in /nix/store/wx7qxymgixgx6c1v88h6xpykxc4z5xz2-spice-gtk-0.34-dev
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/wx7qxymgixgx6c1v88h6xpykxc4z5xz2-spice-gtk-0.34-dev/lib
patching script interpreter paths in /nix/store/wx7qxymgixgx6c1v88h6xpykxc4z5xz2-spice-gtk-0.34-dev
checking for references to /build in /nix/store/wx7qxymgixgx6c1v88h6xpykxc4z5xz2-spice-gtk-0.34-dev...

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: phodav, spice-gtk

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: phodav, spice-gtk

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/hzb65ph6iygrw5lbamb1lz37bvc98d2d-spice-gtk-0.34/lib  /nix/store/hzb65ph6iygrw5lbamb1lz37bvc98d2d-spice-gtk-0.34/bin
patching script interpreter paths in /nix/store/hzb65ph6iygrw5lbamb1lz37bvc98d2d-spice-gtk-0.34
checking for references to /build in /nix/store/hzb65ph6iygrw5lbamb1lz37bvc98d2d-spice-gtk-0.34...
shrinking RPATHs of ELF executables and libraries in /nix/store/g4dnacpik2l7jh4n09vq4rnv3j6j2lch-spice-gtk-0.34-dev
strip is /nix/store/jk6j4lh9v5mvjdbdc35sj0zffhhf6s56-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/g4dnacpik2l7jh4n09vq4rnv3j6j2lch-spice-gtk-0.34-dev/lib
patching script interpreter paths in /nix/store/g4dnacpik2l7jh4n09vq4rnv3j6j2lch-spice-gtk-0.34-dev
checking for references to /build in /nix/store/g4dnacpik2l7jh4n09vq4rnv3j6j2lch-spice-gtk-0.34-dev...
/nix/store/dkly9bmdin0fv9flgwd0lg41qzvqnw4v-phodav-2.2
/nix/store/hzb65ph6iygrw5lbamb1lz37bvc98d2d-spice-gtk-0.34

vgpuOptions = {
uuid = mkOption {
type = types.string;
description = "UUID of VGPU device.";
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably add some info where to get this UUID, even if it can be randomly generated.

in {
options = {
virtualisation.kvmgt = {
enable = mkEnableOption "KVMGT (iGVT-g) VGPU support.";
Copy link
Contributor

Choose a reason for hiding this comment

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

While technically correct, maybe add some info what this is about. Like, "allows virtual guests to share host's graphics card. Currently only one graphical device can be shared"

device = mkOption {
type = types.string;
default = "0000:00:02.0";
description = "PCI ID of graphics card.";
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be extremely cool if this description showed how to get that PCI ID. Otherwise one have to resort to google...

@ghost
Copy link
Author

ghost commented May 26, 2018

@danbst Done, thanks!

@ghost
Copy link
Author

ghost commented Jun 3, 2018

@matthewbauer Thanks!

@ghost ghost deleted the gvt branch June 3, 2018 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants