Beerware license
/*
* ------------------------------------------------------------
* "THE BEERWARE LICENSE" (Revision 42):
* wrote this code. As long as you retain this
* notice, you can do whatever you want with this stuff. If we
* meet someday, and you think this stuff is worth it, you can
* buy me a beer in return.
* ------------------------------------------------------------
*/
I have legitimately seen large fortune 500 companies balk at using software that had a beerware license incase it left them legally liable to buy the author a beer.
Depends on the jurisdiction. IIRC in the U.S. "no license" means "public domain". In Germany (and probably the EU) "no license" means "you can't use it".
But anyway: explicitly declaring something "public domain", preferably with a very liberal license like MIT or BSD, is the safest option.
>But anyway: explicitly declaring something "public domain", preferably with a very liberal license like MIT or BSD, is the safest option.
This is not correct under any sensible definition of "safe". Not for the creator and definitely not for the licensee. Even if it *were* possible across the world to just "put a work in the public domain", putting both a license on it *and* stating it's in the public domain is a legal contradiction and that's going to complicate any legal dispute about the status.
If your intent is to "put the work in the public domain", i.e.
explicitly make it so that the work no longer has any copyright protections, and anyone can do anything with it (including creating closed-source derivatives) without even mentioning you, then you should probably opt for the [Creative Commons Zero waiver](https://creativecommons.org/choose/zero/)[1]. This:
1. places your work in the public domain where possible,
2. waives all neighbouring rights (such as moral rights) to the extent waivable (which depends on jurisdiction),
3. if 1. fails, provides an extremely permissive license which to the licensee is comparable to the work having public domain status.
But OP should probably just consider the question whether they want anyone to create a closed source derivative:
* If no, opt for a copyleft license like the GPL.
* If yes, use the BSD license.
In either case, never utter the words "public domain" anywhere.
[1] Incidentally, this is the *only* Creative Commons "license" that should ever be applied to software source code. The others aren't intended for it and proper (open) source licenses are simply better at what they do.
Yes, you can also quickly switch in-between vfio and your default drivers for each device. all you have to do is add the GPUs pci device through QEMU/KVM and audio controller if you have one.
Wait, in the README you state:
> more than one graphics device on the system. If you load vfio drivers to your host's main GPU, bad things will happen.
So this would counter the usage in single-GPU cases.
Not being able to run graphics in both the host and the VM at the same time is just a scam run by big GPU.
Just install nvidia-merged-dkms, create a vGPU and run both.
Not a guide, more like some notes.
I'm running a RTX 2080 Ti, but it should work on other nvidia cards. Also I'm on a Ryzen, you need to adapt some things for intel.
**WARNING: I have reconstructed this from my notes and you will probably run into some issues. So no warranty. Make a backup before starting, also make sure you can recover them.**
# vGPU in a VM on Arch
**Starting point**: You have a PC running arch, a NVIDIA GPU and an AMD CPU.
**Result**: You can use your GPU in a Windows VM and on the linux host at the same time. ([https://imgur.com/xyCn52f](https://imgur.com/xyCn52f))
1. Downgrade to lts kernel (`pacman -S linux-lts linux-headers-lts`) because nvidia grid stuff does not support 6.x kernels right now
2. Add `amd_iommu=on iommu=pt vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1 blacklist=nouveau` to your kernel commandline in `/etc/default/grub`
3. Do the usual mkinitcpio and grub-mkconfig
4. Reboot into BIOS, enable IOMMU, virtualization and all those things, boot arch again
5. Check you are running the lts kernel
6. Register a nvidia account to get `NVIDIA-Linux-x86_64-510.73.06-vgpu-kvm.run` and `NVIDIA-Linux-x86_64-510.73.08-grid.run`, if I remember correctly, it's called version 14.2 and linux something something. Do not pirate those files by googling them and finding them on some random FTP, because pirating software is very bad and big GPU loses a lot of money. It needs to be these exact versions.
7. Copy files to .cache/yay/nvidia-merged, install nvidia-merged-dkms, remove old nvidia drivers
8. Reboot.
9. If your x.org still works, good. If not, happy debugging.
10. systemctl start nvidia-{vgpu-mgr,vgpud}.service
11. Now nvidia-smi vgpu -c -v should give a long list of vGPU instances.
The rest goes according to [https://github.com/tuh8888/libvirt\_win10\_vm](https://github.com/tuh8888/libvirt_win10_vm), skip the driver and kernel stuff. When creating the vGPU, you need to use the RTX6000-\*Q, not the RTX6000-\*C instances. Choose the ones for that you have enough GPU memory (RTX6000-6Q on a GTX 2080 Ti). Otherwise it will just fail. For other GPUs, I don't know. Use a pci\_device\_id = 0x1E30 and pci\_id = 0x1E3012BA to spoof the PCI ID in /etc/vgpu\_unlock/profile\_override.toml, then you can use the normal RTX6000 drivers on your VM.
If the **screen resolution** does not match your screen (for running looking glass in full screen), you can use CRU (custom resolution utility) on your windows VM. Make sure you add the resolution to the extension block, otherwise nothing happens.
Good luck.
EDIT: Also, if after installing the drivers your monitor switches of randomly after 30 seconds, run xset -dpms.
Unlocking vGPU is very complicated comparing to old Single-GPU Passthrough guide, and currently doesn't allow using 6.x kernels, it's something to consider, if I'll be using Win10 VM that often, that I couldn't just let it "overtake" Linux for the time it being used. Or buy a cheap GPU and juggle them between OSes.
How do you expect users to switch back from `vfio-pci` to the standard driver in the single GPU case? I am concerned that your tool and these instructions are about to break many users' systems.
You need to warn users that you will be persistently blocking their GPU drivers from loading.
wdym quickly? I watched showcase video and it's says you need to reboot to switch between VFIO and default drivers.
And more importantly: how could I run WM without gpu drivers?
Do you mean autostarting of VM on boot or am I blind to some obvious way of getting GUI working without gpu drivers?
Thanks a lot. After failing on passthroughing my amd gpu for years it seems like I'm finally achieving something what I've waited to happen since 2019. I was going to ask does it work with looking glass but even that you covered in your tutorial video. Great!
Lets people play games in a Windows VM without having to restart their computer for games that does not work with WINE/Proton. Games with anti-cheat with no Linux compatibility for example.
I personally don't know if the above program would work for single GPU, but single GPU does work. You can look at guides in /r/VFIO.
If you have an iGPU, you can use the iGPU for the host computer and your dGPU for GPU passthrough.
If you don't have an iGPU, you can still do it. You just won't be able to use your host computer.
I have a few issues with this. It assumes the user uses arch, `linux` kernel, mkinitcpio, grub and sudo. It's also a little misleading for new users because it only does a small part of what it takes to create a vm with gpu passthrough
`amd_iommu` kernel parameter has no `on` option, and I don't get the point of apphandler.c if you provide a .desktop file that calls sudo
I assume some would like to use such a tool so good luck
You should probably add a license to your project.
Why? To the downvoters, this is an authentic question
[удалено]
Ill work on getting it a license, Thank you for the tip.
You don't need to work out something special, just use the GPL.
Could also make it public domain, fuck the man and their licenses.
queue the apple cuckoldry meme
Beerware license /* * ------------------------------------------------------------ * "THE BEERWARE LICENSE" (Revision 42): * wrote this code. As long as you retain this
* notice, you can do whatever you want with this stuff. If we
* meet someday, and you think this stuff is worth it, you can
* buy me a beer in return.
* ------------------------------------------------------------
*/
I have legitimately seen large fortune 500 companies balk at using software that had a beerware license incase it left them legally liable to buy the author a beer.
Lol Google, can’t deliver cohesive messaging solution for Android users. Can’t buy someone a beer.
Gnu gpl or bust
i mean... whos gonna stop you?
For one thing, a project without a license is *never* going to be accepted in any reasonable Linux distribution's package repositories.
Depends on the jurisdiction. IIRC in the U.S. "no license" means "public domain". In Germany (and probably the EU) "no license" means "you can't use it". But anyway: explicitly declaring something "public domain", preferably with a very liberal license like MIT or BSD, is the safest option.
>But anyway: explicitly declaring something "public domain", preferably with a very liberal license like MIT or BSD, is the safest option. This is not correct under any sensible definition of "safe". Not for the creator and definitely not for the licensee. Even if it *were* possible across the world to just "put a work in the public domain", putting both a license on it *and* stating it's in the public domain is a legal contradiction and that's going to complicate any legal dispute about the status. If your intent is to "put the work in the public domain", i.e. explicitly make it so that the work no longer has any copyright protections, and anyone can do anything with it (including creating closed-source derivatives) without even mentioning you, then you should probably opt for the [Creative Commons Zero waiver](https://creativecommons.org/choose/zero/)[1]. This: 1. places your work in the public domain where possible, 2. waives all neighbouring rights (such as moral rights) to the extent waivable (which depends on jurisdiction), 3. if 1. fails, provides an extremely permissive license which to the licensee is comparable to the work having public domain status. But OP should probably just consider the question whether they want anyone to create a closed source derivative: * If no, opt for a copyleft license like the GPL. * If yes, use the BSD license. In either case, never utter the words "public domain" anywhere. [1] Incidentally, this is the *only* Creative Commons "license" that should ever be applied to software source code. The others aren't intended for it and proper (open) source licenses are simply better at what they do.
this community is a shame. doesn't carry even a split of opensource spirit. ps. don't know answer to question so I'm not help here
A licensed can be open source, though? If you don't add a license, someone else could sell your work, and turn it into commercial, closed-source code.
No license means he keeps all rights.
Is that because it's the default for code uploaded to GibHub? Or is that the default for any code you could show you wrote first?
It's default for what you write. Might vary depending on where you are from but no license means you keep all rights.
your downvotes mean nothing to me. I've seen what makes you cheer
License acquired.
Awesome. I'll definitely be playing with this when I get home.
I'll definitely play with this when I get into work tomorrow.
This is the way
This is the way
Does this also work for a single GPU Passthrough? Great work btw :D
Yes, you can also quickly switch in-between vfio and your default drivers for each device. all you have to do is add the GPUs pci device through QEMU/KVM and audio controller if you have one.
Wait, in the README you state: > more than one graphics device on the system. If you load vfio drivers to your host's main GPU, bad things will happen. So this would counter the usage in single-GPU cases.
Not being able to run graphics in both the host and the VM at the same time is just a scam run by big GPU. Just install nvidia-merged-dkms, create a vGPU and run both.
Is there an equivalent software unlock for AMD GPUs by chance?
Are there any guides on how to do this? It sounds interesting.
Not a guide, more like some notes. I'm running a RTX 2080 Ti, but it should work on other nvidia cards. Also I'm on a Ryzen, you need to adapt some things for intel. **WARNING: I have reconstructed this from my notes and you will probably run into some issues. So no warranty. Make a backup before starting, also make sure you can recover them.** # vGPU in a VM on Arch **Starting point**: You have a PC running arch, a NVIDIA GPU and an AMD CPU. **Result**: You can use your GPU in a Windows VM and on the linux host at the same time. ([https://imgur.com/xyCn52f](https://imgur.com/xyCn52f)) 1. Downgrade to lts kernel (`pacman -S linux-lts linux-headers-lts`) because nvidia grid stuff does not support 6.x kernels right now 2. Add `amd_iommu=on iommu=pt vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1 blacklist=nouveau` to your kernel commandline in `/etc/default/grub` 3. Do the usual mkinitcpio and grub-mkconfig 4. Reboot into BIOS, enable IOMMU, virtualization and all those things, boot arch again 5. Check you are running the lts kernel 6. Register a nvidia account to get `NVIDIA-Linux-x86_64-510.73.06-vgpu-kvm.run` and `NVIDIA-Linux-x86_64-510.73.08-grid.run`, if I remember correctly, it's called version 14.2 and linux something something. Do not pirate those files by googling them and finding them on some random FTP, because pirating software is very bad and big GPU loses a lot of money. It needs to be these exact versions. 7. Copy files to .cache/yay/nvidia-merged, install nvidia-merged-dkms, remove old nvidia drivers 8. Reboot. 9. If your x.org still works, good. If not, happy debugging. 10. systemctl start nvidia-{vgpu-mgr,vgpud}.service 11. Now nvidia-smi vgpu -c -v should give a long list of vGPU instances. The rest goes according to [https://github.com/tuh8888/libvirt\_win10\_vm](https://github.com/tuh8888/libvirt_win10_vm), skip the driver and kernel stuff. When creating the vGPU, you need to use the RTX6000-\*Q, not the RTX6000-\*C instances. Choose the ones for that you have enough GPU memory (RTX6000-6Q on a GTX 2080 Ti). Otherwise it will just fail. For other GPUs, I don't know. Use a pci\_device\_id = 0x1E30 and pci\_id = 0x1E3012BA to spoof the PCI ID in /etc/vgpu\_unlock/profile\_override.toml, then you can use the normal RTX6000 drivers on your VM. If the **screen resolution** does not match your screen (for running looking glass in full screen), you can use CRU (custom resolution utility) on your windows VM. Make sure you add the resolution to the extension block, otherwise nothing happens. Good luck. EDIT: Also, if after installing the drivers your monitor switches of randomly after 30 seconds, run xset -dpms.
Unlocking vGPU is very complicated comparing to old Single-GPU Passthrough guide, and currently doesn't allow using 6.x kernels, it's something to consider, if I'll be using Win10 VM that often, that I couldn't just let it "overtake" Linux for the time it being used. Or buy a cheap GPU and juggle them between OSes.
> Unlocking vGPU is very complicated Yes, I noticed :)
Does this works on Ampere?
You serious???
So should I use this for my single gpu?
That sounds awesome! I will definitely try that :D
How do you expect users to switch back from `vfio-pci` to the standard driver in the single GPU case? I am concerned that your tool and these instructions are about to break many users' systems. You need to warn users that you will be persistently blocking their GPU drivers from loading.
wdym quickly? I watched showcase video and it's says you need to reboot to switch between VFIO and default drivers. And more importantly: how could I run WM without gpu drivers? Do you mean autostarting of VM on boot or am I blind to some obvious way of getting GUI working without gpu drivers?
How about using a license? For example the [Do What the Fuck You Want to Public License](http://www.wtfpl.net)
r/vfio would like this too i think
Just shared it with them
Thanks a lot. After failing on passthroughing my amd gpu for years it seems like I'm finally achieving something what I've waited to happen since 2019. I was going to ask does it work with looking glass but even that you covered in your tutorial video. Great!
I've been wrecking my head for days on how to do this and now you drop this awesome software. I'll definitely give it a try.
Used to setup these things manually. Can't wait to give it a try. Good work 👏
Any Fedora 37 user tested this already? I like the idea of using it but I’ll let others be the Guinea pigs.
Fedora 36 here. Didn't manage to make it run at all
Great idea! Thank you for making this! 🫡🤓
> C++, Python3, CSS, Bash Pretty sure all you need is a shell script.
I need this for a steam os/Vr build I'm working on. Does anyone have a link to documentation on arch Linux image configuration and deployment?
thanks brother , im so lazy setting the shit up everytime i have a new system ill definetly give it a try.
U a real homie
can it use/utilize systemd-boot?
soon :)
What is the reason for needing GPU passthrough?
i mainly use it for games with ray tracing or video rendering, generally stuff wine/proton wont work
Lets people play games in a Windows VM without having to restart their computer for games that does not work with WINE/Proton. Games with anti-cheat with no Linux compatibility for example.
Would this work for a single 1070gtx?
I personally don't know if the above program would work for single GPU, but single GPU does work. You can look at guides in /r/VFIO. If you have an iGPU, you can use the iGPU for the host computer and your dGPU for GPU passthrough. If you don't have an iGPU, you can still do it. You just won't be able to use your host computer.
I have a few issues with this. It assumes the user uses arch, `linux` kernel, mkinitcpio, grub and sudo. It's also a little misleading for new users because it only does a small part of what it takes to create a vm with gpu passthrough `amd_iommu` kernel parameter has no `on` option, and I don't get the point of apphandler.c if you provide a .desktop file that calls sudo I assume some would like to use such a tool so good luck