felixdoerre / primus_vk

Vulkan GPU-offloading layer
BSD 2-Clause "Simplified" License
229 stars 17 forks source link

Correct methodology to install primus vk on Linux mint #84

Closed zimudec closed 3 years ago

zimudec commented 3 years ago

Linux mint is based on Ubuntu, and it is based on debian. The only way to install and configure vulkan with primus vk, is to install it manually by compiling the source code? It is the best way?

The primus-vk-nvidia package is mentioned, but it seems that it is not available on Ubuntu or Linux mint.

felixdoerre commented 3 years ago

primus-vk-nvidia already made it into ubuntu groovy: https://packages.ubuntu.com/groovy/primus-vk-nvidia but it seems this does not (yet) have reached linux mint. I am not sure what I would recommend for linux mint right now. Either install it manually, or just clone the debian package's source from here: https://salsa.debian.org/nvidia-team/primus-vk/ and build and install it as a debian package. That should work as well.

zimudec commented 3 years ago

All right! I will do the test these days and comment on it.

Thank you!

zimudec commented 3 years ago

I've been reading about linux mint 20, and dedicated nvidia gpu, and apparently mint opted for a new nvidia prime "on-demand".

If so, in this case it doesn't use bumblebee, and therefore it doesn't use optirun or primus run to switch to the dedicated card, with opengl or vulkan, right?

felixdoerre commented 3 years ago

I haven't seen the new nvidia prime working yet but yes, when you would use that, you wouldn't use optirun/bumblebee/primus/primus_vk. As far as I have read about their implementation, using the nvidia-implemented prime will not allow you to completely power down/unload the nvidia driver anymore, so the kernel module will always be loaded, preventing upgrades without X-Session reboot.

Also its not really "one or the other", under debian you should be able to use both (depending on what you install). If you install primus-vk-nvidia, you will end up with the bumblebee/opiturn/etc. If you do not install that, the nvidia driver should auto-detect optimus graphics and it all should work with the nvidia implementation.

zimudec commented 3 years ago

I haven't seen the new nvidia prime working yet but yes, when you would use that, you wouldn't use optirun/bumblebee/primus/primus_vk. As far as I have read about their implementation, using the nvidia-implemented prime will not allow you to completely power down/unload the nvidia driver anymore, so the kernel module will always be loaded, preventing upgrades without X-Session reboot.

That's right, it would be quite similar to bumblebee, with a few pros and cons. Linux mint 20 has already implemented it: https://linuxmint.com/rel_ulyana_xfce_whatsnew.php

It can be turned on with the commands:

nvidia-optimus-offload-glx or nvidia-optimus-offload-vulkan

Also its not really "one or the other", under debian you should be able to use both (depending on what you install). If you install primus-vk-nvidia, you will end up with the bumblebee/opiturn/etc. If you do not install that, the nvidia driver should auto-detect optimus graphics and it all should work with the nvidia implementation.

Interesting. Linux mint may have the same behavior. Is it the same swapping between prime and bumblebee / optirun / primusrun / primusvk?

felixdoerre commented 3 years ago

I don't really understand the question. The situation that I described for debian is that the users can choose whether to use "bumblebee/optirun/primus/primusvk" (which is required for graphics devices that don't work with the latest nvidia drivers), whether to use nvidia-xrun (starting a new x-session when they want to use optimus), of whether to install/user the "newer" nvidia prime implementation, depending on what packages they install and what commands they use to run their games.

zimudec commented 3 years ago

I think I understand.

I have been testing the prime implementation included in linux mint, very similar to using optirun / primusrun / primusvk, changing an environment variable to start using the dedicated on-demand gpu with vulkan by default, and another variable to use GLX with nvidia, for some games that require it to use the dedicated gpu instead of the integrated one.

https://download.nvidia.com/XFree86/Linux-x86_64/455.38/README/primerenderoffload.html