void-docs icon indicating copy to clipboard operation
void-docs copied to clipboard

added pci passthrough guide

Open anjandev opened this issue 4 years ago • 22 comments

@the-maldridge @HadetTheUndying

Spent my time tonight working on this. It's pretty late so my grammar is not going to be great. Looking for early feedback. I reference the archwiki alot but there is alot of void specific things in here. I have a shameless self promotion to my own blog at some point. Please let me know if theres a better source or if it's good to do without that shameless self-promotion.

This is all the information I have. Please send me specific changes if you have them. Please redirect new users to this so we can test if these instructions are actually good. I have done pci passthrough so many times that there are things I think are obvious but might not be to a new user.

Closes #208

anjandev avatar Apr 26 '20 09:04 anjandev

Thanks for your contribution!

i've just done an initial review pass on this. Apart from my specific review comments, my overall feeling at this stage is that it's currently too much of a step-by-step tutorial and not focused enough on Void specifics. As the "About this Handbook" section of the Handbook says:

This handbook is not an extensive guide on how to use and configure common Linux software. The purpose of this document is to explain how to install, configure, and maintain Void Linux systems, and to highlight the differences between common Linux distributions and Void.

flexibeast avatar Apr 27 '20 01:04 flexibeast

@flexibeast Although I agree, there's comments regularly on irc asking how to configure pci passthrough on voidlinux. These people are looking for void specific documentation on it.

Even if we have a page with mostly links to archwiki and "here's the differences with void", I think that would lower the questions we get in irc about this.

anjandev avatar Apr 27 '20 02:04 anjandev

Oh i'm not making an assessment of whether this should be in the Handbook- that decision is above my pay grade. :-) i'm just saying that, assuming this section is included, it needs to be a lot more succinct. As an example, contrast the GNOME page on the old wiki with this near-final draft of the GNOME page for the Handbook.

flexibeast avatar Apr 27 '20 03:04 flexibeast

@flexibeast thanks for your review. That was a long guide and I appreciate the time you spent reviewing this. Please let me know if there's other changes you want me to make.

anjandev avatar Apr 30 '20 05:04 anjandev

All changes requested have been made

anjandev avatar May 03 '20 07:05 anjandev

@anjandev: i've just completed my second review pass. Thanks for addressing the feedback thus far! We're getting there. :-)

flexibeast avatar May 03 '20 13:05 flexibeast

Thanks for the review. This is definitely a big guide. =)

anjandev avatar May 03 '20 23:05 anjandev

@anjandev:

In fact, compared to the pages currently on master:

$ find . -name '*.md' -exec wc -l {} \; | sort -n | tail -n5
126 ./src/contributing/void-docs/style-guide.md
128 ./src/installation/live-images/guide.md
135 ./src/config/kernel.md
135 ./src/config/network/wpa_supplicant.md
254 ./src/installation/guides/fde.md

pci-passthrough.md is currently at 270 lines, surpassing even fde.md.

Most of pci-passthrough.md is not Void-specific, but applicable to many other distros as well - the Void-specific parts are the particular package and runit service names. Given that the Handbook is generally not intended to contain "how to do X on Linux systems", nor contain guides for everything one might want to do with one's Void system, i'd like to see if this page can be made any more concise.

@ericonr: Would you be able to read over this page as it currently stands, and offer any thoughts you might have?

flexibeast avatar May 04 '20 04:05 flexibeast

@ericonr, @bobertlo

this guide feels like it should be in a separate "advanced guides" section, which currently doesn't exist because the advanced guides we have are only for installation. Do you think we could create one, or would it make stuff even more complicated?

i'd certainly like to have a discussion about this. In reviewing this PR, i've been torn between:

  • on the one hand, feeling this is a valuable guide with concrete information that isn't easily available elsewhere in such a "bring everything together" way, even though much of the information isn't Void-specific; and
  • on the other hand, the Handbook not 'officially' being a place for such guides, at least when they're not about installing Void itself.

So i guess i'd like to have a clearer idea of what sort of non-installation guides are appropriate for inclusion in the Handbook, and whether guides that aren't considered appropriate for inclusion could be provided elsewhere somehow. For example, there are regular questions on IRC about getting Steam working: although we're clear that the ins and outs of this are not something that should be included in the Handbook, i feel it would be nice if there was somewhere outside the Handbook to put such a guide.

flexibeast avatar May 05 '20 04:05 flexibeast

@HadetTheUndying can you please review this guide?

anjandev avatar May 06 '20 04:05 anjandev

This is probably the most in-depth and up-to-date guide on Passthrough. At the very least if this doesn't get merged it needs to be made into a GitHub page. Finding all of this information in one spot and it being up-to-date is a horrendous amount of effort and googling.

I am no longer running my Passthrough setup because the game I needed it for works fine with Proton now, and it was choking the airflow to my Host machine's GPU. To my knowledge this is the most concise guide I've seen on this topic, even browsing the guides on r/VFIO the information in those guides is scattered and poorly documented.

Over the weekend I will grab one of my single slot GPUs and follow the guide to do a full setup to see if there are any issues, but i foresee none.

HadetTheUndying avatar May 07 '20 01:05 HadetTheUndying

@HadetTheUndying: Thanks. :-) @bobertlo: At this point, @ericonr and i feel that it would be good to get your input on what more, if anything, still needs to be done. :-)

flexibeast avatar May 07 '20 07:05 flexibeast

According to hadet on irc:

Yeah I commented on it, and was able to go through step-by-step with my GT 710 to verify it worked

anjandev avatar May 15 '20 03:05 anjandev

Cool! I will try to do a final review over the weeked so we can merge it. We mostly need to determine if the file is in the right place. Should the "advanced configuration guides" section only be created if we get another guide? Would this section even be inside configuration or should it be somewhere else?

I think having a single file means we should stick with not having a section for now, but that could change.

ericonr avatar May 15 '20 05:05 ericonr

@ericonr: Please don't merge this before @bobertlo can offer his thoughts.

To me, this document, which overwhelmingly contains non-Void-specific information, very much needs to be considered under our policy that, as much as possible, the Handbook should contain information which is specific to Void, and not to Linux in general. As far as i can tell, the Void team has been quite consistent on this point; @Piraty recently wrote:

Everybody needs to keep in mind that Void usually goes by 'upstream knows best', which means that the handbook ideally contains very little content (only Void specific) because upstream projects are considered the main source of documentation. Else we will face the same issues we (and everyone else maintaining one) had with the wiki. For easy setup guides of application X, people can still consult the Arch wiki.

As i've said elsewhere, i agree that this document contains valuable information, which apparently isn't otherwise available. However, i don't feel it should be Void's responsibility to include information about how to use Linux in particular ways, simply because that information isn't provided elsewhere. With our limited volunteer time and resources, i'd like us to prioritise content that is very Void-specific.

@bobertlo is the senior member of the docs team, with lots of experience determining what is and isn't appropriate content for the Handbook. If he's fine with these sort of guides being included, then that's good enough for me, and we should clarify the situation in the "About this Handbook" section. But even if @bobertlo decides this section shouldn't be included, @anjandev's extensive work in putting this together won't have been wasted; it could be made available elsewhere (e.g. via @anjandev's GH space).

flexibeast avatar May 15 '20 06:05 flexibeast

So just to update, I went through this step by step with my machine and didn't have any issues.

HadetTheUndying avatar May 16 '20 05:05 HadetTheUndying

I have nothing to say, other than this looks really good!

Personally, would prefer this sort of information in some distro's (any distro, not void specifically) documentation page as opposed to reading random peoples' blogs/GH site to figure out linuxy stuff.

travankor avatar May 18 '20 09:05 travankor

@the-maldridge: In the absence of @bobertlo, what are your thoughts on including this? @Piraty and @Vaelatern have given a thumbs-up to @travankor's comment above:

Personally, would prefer this sort of information in some distro's (any distro, not void specifically) documentation page as opposed to reading random peoples' blogs/GH site to figure out linuxy stuff.

flexibeast avatar Jun 26 '20 02:06 flexibeast

Ping @bobertlo, if you're free c:

ericonr avatar Jul 03 '20 17:07 ericonr

For now, this is blocked on https://github.com/void-linux/void-packages/pull/17225 , having links to in-progress PRs is not ideal.

Try to ping the PR and see if there have been any updates to the package since then. Also mention that it is working well for your use case, if possible.

ericonr avatar Jul 04 '20 15:07 ericonr

So, I set up a gaming VM using this guide yesterday and ran into a few issues. I think the most problematic was that the vfio-pci module wasn't being loaded, even after specifying vfio-pci.ids=[] on the kernel cmdline. This meant that the device was not using the vfio-pci kernel driver, when looking at the device with lspci -nnk -d ${device_id} Loading the module via /etc/modules-load.d fixed that, so you might want to include that in your guide.

Aside of that, I think this guide looks still quite WIP. It looks like some stuff was plain copied from the arch wiki, which might be problematic due to licensing as they use a different license for their wiki that we do for void-docs.

jcgruenhage avatar Jul 10 '20 10:07 jcgruenhage

BTW I wrote a section in Alpine Linux KVM wiki page about VFIO, see https://wiki.alpinelinux.org/wiki/KVM#vfio. And there's no need to compile OVMF files, it's just binary files, one can download them from any other distro, extract, until Void linux has native package.

jirib avatar Feb 15 '21 15:02 jirib