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.

Sorry, something went wrong.

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 501+ labels May 9, 2018
@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.

@GrahamcOfBorg GrahamcOfBorg added 8.has: package (new) This PR adds a new package 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels May 11, 2018
@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!

@GrahamcOfBorg GrahamcOfBorg added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 29, 2018
@GrahamcOfBorg GrahamcOfBorg removed the 2.status: merge conflict This PR has merge conflicts with the target branch label May 29, 2018
@matthewbauer matthewbauer changed the base branch from master to staging June 2, 2018 03:14
@matthewbauer matthewbauer merged commit 0135f04 into NixOS:staging Jun 2, 2018
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux and removed 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-linux: 501+ labels Jun 2, 2018
@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
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants