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

Blender viewport not working with nVidia optimus correctly #120

Open
jkms opened this issue Aug 19, 2022 · 1 comment
Open

Blender viewport not working with nVidia optimus correctly #120

jkms opened this issue Aug 19, 2022 · 1 comment

Comments

@jkms
Copy link

jkms commented Aug 19, 2022

When I launch Blender via Flatpak on my nVidia Optimus laptop Blender correctly detects my nVidia card and it's CUDA abilities, but it doesn't actually use the nVidia GPU for rendering the viewport (notice that there's nothing in the output of nvidia-smi in the first screenshot):

If I try to manually start blender with the Optimus/Prime environment variables:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia flatpak run org.blender.Blender 
Read prefs: /home/john/.var/app/org.blender.Blender/config/blender/3.2/config/userpref.blend
Error! Unsupported graphics card or driver.
A graphics card and driver with support for OpenGL 3.3 or higher is required.
The program will now close.

However, when I start the non-flatpak version, it works correctly:

__NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ./blender 
Read prefs: /home/john/.config/blender/3.2/config/userpref.blend
/run/user/1000/gvfs/ non-existent directory
Saved session recovery to '/tmp/quit.blend'

Blender quit # this is just me closing the window

Flatpak

Like I said, blender flatpak works, and it sees my nVidia card:
image

Notice the GPU usage on my radeon iGPU vs the nVidia GPU.
image

Non-flatpak

However, when running the non-flatpak version with the Optimus/Prime env variables, I get buttery smooth performance, and the viewport rendering is offloaded to my nVidia card:
image

Is this a bug? or missing how to launch the flatpak correctly so that the viewport will use my nVidia GPU?

@Martin15135215
Copy link

I had this solution from this answer

In Short: Run this command

flatpak override --user --device=dri --env=__NV_PRIME_RENDER_OFFLOAD=1 --env=__VK_LAYER_NV_optimus=NVIDIA_only --env=__GLX_VENDOR_LIBRARY_NAME=nvidia org.blender.Blender

However, Cuda did not function for me :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants