DualCoder / vgpu_unlock

Unlock vGPU functionality for consumer grade GPUs.
MIT License
4.61k stars 430 forks source link

script run on proxmox 7 #84

Open wordain opened 3 years ago

wordain commented 3 years ago

Hi,

after trying the scipt on a fresh proxmox install, the first dkms install fails. I followed the guide found in https://wvthoog.nl/proxmox-7-vgpu/. In the attached log seems something tottaly breaks when the 5.12 patch is applied. Any chance for an insight what I might doing wrong?

driver version : NVIDIA-Linux-x86_64-460.32.04-vgpu-kvm gpu : NVIDIA Corporation GM206GL [Quadro M2000] (yea not like the mostly tested 1050,1650,1600,2060, but theoritaclly, the card should be in the supported ranges)

make.log

DualCoder commented 3 years ago
/var/lib/dkms/nvidia/460.32.04/build/nvidia-vgpu-vfio/nvidia-vgpu-vfio.c:162:25: error: initialization of 'int (*)(struct mdev_device *)' from incompatible pointer type 'int (*)(struct kobject *, struct mdev_device *)' [-Werror=incompatible-pointer-types]
  162 |     .create           = nv_vgpu_vfio_create,
      |                         ^~~~~~~~~~~~~~~~~~~
/var/lib/dkms/nvidia/460.32.04/build/nvidia-vgpu-vfio/nvidia-vgpu-vfio.c:162:25: note: (near initialization for 'vgpu_fops.create')

This error is caused by this change to the linux kernel: https://github.com/torvalds/linux/commit/c2ef2f50ad0ccf5460bf4824bc6669240b6c7936 so you need a kernel version prior to that or you will need more patches.

mlinton commented 2 years ago

Additionally, with a fully updated proxmox installation as of Nov 28th, 2021, the kernel is updated to 5.13.10-1-pve. Following instructions in this repo and here fail, and I believe an update to the code will be required to get it working on the latest installation of proxmox 7.1

wordain commented 2 years ago

I did manage to succeed on the first install of the drivers due to - as DualCoder pointed - the latest kernel changes break the install (the 7.0 proxmox is 5.11, and 7.1 is 5.13). On the 7.0, in order to avoid the upgrade of the pve-headder, you just have to skip the installation of any header upgrade when updating or skip any update calls.

Despite that though, for my try, I have not managed to make the magical phrase "vgpu unlock patch applied" be shown in dmesg in either gpu I tried: a K620, a K2200 and a m2000. The first 2 are maxwell1.0, the second is maxwell 2.0. One is not a high-end model, but the other 2 were kinda the "gtx 1060" of their time.

I haven't managed to find any time to test it on a 6.5 proxmox installation on the m2000 - i did try with the k620,k2200 and again no magic phrase. But it would be problematic as the iso is upgraded to the latest headers (5.10 I believe) which still needs to have patches applied. Downgrading an iso's header looks wrong to me. And the other option would be to try a centos-like installation and see if it could work there.

justynbell commented 2 years ago

It looks like if you use the newest version of the NVIDIA drivers from the trial website, 470.82, it works on Proxmox 7.1.

One small thing that took me too long to realize is that the dmesg output for vgpu unlock is turned off by default, so you'll never see the "vGPU unlock patch applied" message, even if it's working. That kind of threw me for a loop for a while.

(you can turn it on and rebuild your patched drivers here): https://github.com/DualCoder/vgpu_unlock/blob/f432ffc8b7ed245df8858e9b38000d3b8f0352f4/vgpu_unlock_hooks.c#L567

Dardrai commented 2 years ago

you can also run mdevctl types - if you have output there it should be working and if you do not have output something is not right/correctly done

mcdull commented 2 years ago

It looks like if you use the newest version of the NVIDIA drivers from the trial website, 470.82, it works on Proxmox 7.1.

One small thing that took me too long to realize is that the dmesg output for vgpu unlock is turned off by default, so you'll never see the "vGPU unlock patch applied" message, even if it's working. That kind of threw me for a loop for a while.

(you can turn it on and rebuild your patched drivers here):

https://github.com/DualCoder/vgpu_unlock/blob/f432ffc8b7ed245df8858e9b38000d3b8f0352f4/vgpu_unlock_hooks.c#L567

The same 5.12 patch required for the 470.82 to work under Proxmox 7.1?

Dardrai commented 2 years ago

Dont think that this is working with 470 I would use the same version as the linked one in the wiki - know that the newer driver like 470 have additional checks in it - one checks the vram of the spoofed gpu and the real amount from the gpu and if not matching error out. Also 5.12 kernels can be patched Vgpu was broken in 5.13 and again in 5.14, these kernels are not working yet (I heard a patch is incomimg next week for 5.14/5.15)

pete1019 commented 2 years ago

Any news on this? Patch available?

Should this work from 5.12 and later? https://github.com/rupansh/vgpu_unlock_5.12

Thank you.

VGPU-Community-Drivers commented 2 years ago

https://transfer.sh/AyU4xv/fourteen.patch

Works on some newer 5.14.x and 5.15+ - some earlier 5.14 are not working with that.

mcdull commented 2 years ago

https://transfer.sh/AyU4xv/fourteen.patch

Works on some newer 5.14.x and 5.15+ - some earlier 5.14 are not working with that.

file not found.

And is it safe to update to 5.15 under proxmox?

VGPU-Community-Drivers commented 2 years ago

Saw that :/ - otherwise use this patch - https://github.com/VGPU-Community-Drivers/Merged-Rust-Drivers/tree/main/NVIDIA-Linux-x86_64-460.73.01-grid-vgpu-kvm/kernel/patches - it should be usable with just the kvm driver too and this patches - some work needs to be done bc if you are not using merged, it will try to patch to much / not existing things - also users in the discord have it running ;) so I would say its save

pete1019 commented 2 years ago

@VGPU-Community-Drivers can you please give a link to the Discord-Channel? Thx

VGPU-Community-Drivers commented 2 years ago

In the google doc https://docs.google.com/document/d/1pzrWJ9h-zANCtyqRgS7Vzla0Y8Ea2-5z2HEi4X75d2Q/edit?usp=sharing first pagejoin our discord :)

mcdull commented 2 years ago

Due to my server setting, I do not want to use the merge driver. And I tried the kvm driver KVM-460.73.02, the fourteen.patch did not complete. And it seems to apply to only merge driver?

actionhenkt commented 2 years ago

Is there a working version for kernel 5.15+ yet ?

mcdull commented 2 years ago

Yes. You probably need to check the discord.

actionhenkt @.***> 於 2022年1月6日 週四 上午12:36 寫道:

Is there a working version for kernel 5.15+ yet ?

— Reply to this email directly, view it on GitHub https://github.com/DualCoder/vgpu_unlock/issues/84#issuecomment-1005884674, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEVQOXVEQMRXZ67T5SHD5TUURXRXANCNFSM5INAN3VQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

mcdull commented 2 years ago

in general 460 driver now works with 5.15. 470 still pending.

Dardrai commented 2 years ago

Patch 5.16 is out and is running - just some imports fixed to get 5.16 working -> a patch for 5.13 is also comming for the sad ubuntu users but not yet implemented on git drivers

mcdull commented 2 years ago

do you mean patch for 460 or 470 driver?

Dardrai commented 2 years ago

Forgot the 460 part https://github.com/VGPU-Community-Drivers/Merged-Rust-Drivers/blob/main/NVIDIA-Linux-x86_64-460.73.01-grid-vgpu-kvm/kernel/patches/sixteen.patch

mcdull commented 2 years ago

i always dont understand how these patches work.. do I have to apply all for 5.16? or just apply sixteen for 5.16?

Dardrai commented 2 years ago

The simplest way is to add them on dkms and let it do it for you, as you can see above link if you go one folder up to the dkms conf. But yes for 5.16 you need the patches for 5.12+5.14 too It only applies patches that are req for the kernel you have and are needed, also it does not make sense to have a complete merged 5.16 patch with all prior patch merged to one file. Bc of the duplication/maintainability of the patches/applying them

mcdull commented 2 years ago

problem is there is no fifteen patch around. And prormox 7.1 can opt into 5.15 only. Anyway, I can confirm the merge driver works in 5.15 kernel under promox with 460 driver.

Dardrai commented 2 years ago

5.15 is enabled with fourteen patch - there are no changes between 5.14.x to 5.15 that would have req a patch

zaixia108 commented 1 year ago

I've seen the vGPU unlock patch applied, but my 1070ti still shows up as a 1070ti, not p4