Nvidia Prime is here, But cuda not found!

If you want use Nvidia GPU, all monitor must be connected to Nvidia card, switching from iGPU to Nvidia card with monitor connect to iGPU will not work

That’s not the solution. It’s somehow worked in windows. But linux is diffrent.

It same as in Windows, Blender stall and not open if you set Blender to use Nvidia card and use iGPU with connect monitor, try have cost ZERO

Hi. What you say is not correct, with nvidia PRIME and with iGPU as primary display configured from BIOS (monitor connected to motherboard/iGPU), you can use CUDA in Blender.

Stable PRIME on Linux is relatively new. What you mention about being able to connect monitor to nvidia GPU is Reverse PRIME, and it is only supported in latest drivers. However this will slow down the system/graphics while CUDA is hard working in Blender, so this is surely not what the user is looking for. So monitor must be connected to motherboard and iGPU selected as primary display in BIOS if you want to take advantage of using your machine while Bleneder works with CUDA.

AFAIK Linux not load CUDA libs until one CUDA compatible GPU is not linked to one monitor in hardware or in software disabling iGPU. Blender support only X11 under Linux, Wayland is in experimental stage on 2.91ALPHA

Believe me, I have been trying this for many years and this is as I have told you:

After posting this topic I reinstall the nvidia driver 440.100 in kubuntu, and select prime profile nvidia on demand. By default my iGPU display not worked, So I add a xorg config file on /etc/X11/xorg.conf

Section "Device"
	Identifier "iGPU"
	Driver	"modesetting"
	BusID	"PCI:00:2:0"
EndSection
Section "Screen"
	Identifier "iGPU"
	Device	"iGPU"
EndSection
Section "Device"
	Identifier "dGPU"
	Driver	"nvidia"
	BusID	"PCI:01:0:0"
EndSection

Note, I copy and paste the whole file and I need BusID to work.
After It my iGPU display come, but somehow dGPU not in work.

I found that I need to set env-vars in /etc/environment.
According to this docs. I set

__NV_PRIME_RENDER_OFFLOAD="1"
__GLX_VENDOR_LIBRARY_NAME="nvidia"

After That I notice my dGPU is working for my iGPU and able to show 200+ fps in game. But I also notice that all transition(animation) on my desktop is not working. I found


is some error in my desktop. Also notice some screen tearing (v-sync issue) in my whole desktop specially in Firefox. Currently I am sucked here. And guess what, Cuda still not support in blender.

Here I dump same helpful info

result of lspci | grep -iE 'vga|3D'

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 610 (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GP108 [GeForce GT 1030] (rev a1)

result of sudo lshw -c video

-display                 
       description: VGA compatible controller
       product: GP108 [GeForce GT 1030]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:131 memory:de000000-deffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:df000000-df07ffff
  *-display
       description: VGA compatible controller
       product: HD Graphics 610
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 04
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:128 memory:dd000000-ddffffff memory:b0000000-bfffffff ioport:f000(size=64) memory:c0000-dffff

Result of xrandr --listproviders

Providers: number : 2
Provider 0: id: 0x43 cap: 0x9, Source Output, Sink Offload crtcs: 2 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x1d5 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0

For that you have to setup windows setting app -> graphics. I don’t remember the exact path, But I give the hint.

I also have Kubuntu. I don’t need to configure any xorg.conf files unless I want to use render offload for OpenGL, which I recommend you do not do until you can get the basic PRIME configuration and CUDA working.

So in summary these would be the steps:
Delete /etc/X11/xorg.conf or clear its content.
You must have installed nvidia prime package in Ubuntu: nvidia-prime
From BIOS configuration iGPU must be selected as primary display, and multi monitor/multi GPU option enabled.
Enter the system with the monitor connected to iGPU/motherboard, and from nvidia settings in PRIME Profiles select the option “NVIDIA On-Demand”.
Restart the machine.

Then if you want to try Render Offload for OpenGL, you can try to configure with the example of this xorg.conf from this guide:
https://forums.linuxmint.com/viewtopic.php?t=301410

for the latter I recommend installing the latest drivers from PPA:

Very important: You use official Blender downloaded from Blender site. You don’t do the tests with Blender installed from repositories.
Extract the contents of tar.xz package to a folder. Enter the folder and execute (double click) “blender” file there.

You know what? I have retested to make sure the mini tutorial steps I had written above were correct and I was wrong about something. Since On Demand mode has been implemented, you will not be able to work with CUDA in: intel (Power Saving Mode). So you always have to choose: NVIDIA On-Demand.
I will edit the above post to correct that.
BTW, CUDA is running here in On-Demand mode without any cables or monitor connected to my nvidia GPU, and empty xorg.conf.
And you remember what I have indicated above about using official Blender. Apparently you are using 2.82a from repositories.

Regarding tearing when scrolling in Firefox, the problem also occurs here. Perhaps it is due to an intel drivers problem (You remember that Intel is who is handling the display here). I don’t have time right now to keep testing by changing xorg.conf to be able to run render offload applications to test Firefox that way.
To avoid that kind of tearing problems when the monitor is handled by the nvidia driver without using PRIME, if I remember correctly that is why I had enabled the option nvidia settings > Xserver Display Configuration > Advanced > Force full composition pipeline. So I then Save to X Configuration file with that option.

Maybe if you have more time later you can report this in:

prime-select query is resulting

on-demand

Well Thank you for helping,
missing-setting
nvidia settings > Xserver Display Configuration > Advanced, I don’t have those options. Am I missing some packages or setting? Is it possible via rc file, if yes provide me doc? I am also searching it.

Just a little off-topic.
https://answers.launchpad.net/ubuntu/+source/nvidia-prime/+question/692775 see the 3 & 5. Is there any way to add env vars directly on blender ( like .blenderrc file or something )?

No, that’s why I clarified: “when the monitor is handled by the nvidia driver without using PRIME”, because I also had the tearing problem without using PRIME, and that configuration reduces the problem. That setting is not available when you use PRIME. You should ask in the nvidia forum link I shared above if it is possible to add that in xorg.conf when you use PRIME, but in theory the intel driver is the one that handles the display in that case.

You can create a custom launcher from the KDE launcher (icon bottom left on panel). Right mouse button on the icon and Edit Applications to open KDE Menu Editor. Then you create a new entry for Blender-RenderOffload, and in “Command” field you should add something like this:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia /home/YOUR_USER/BLENDER_FOLDER/blender

Assuming you have downloaded blender in /home/YOUR_USER/ , you should replace /YOUR_USER/BLENDER_FOLDER/ with your real Linux user, and the location of the folder where “blender” file/binary is located.

https://docs.kde.org/trunk5/en/kde-workspace/kmenuedit/quickstart.html

Then you read about “File Associations” methods in KDE to associate .blend files with the custom launcher you just created:


You notice that the first launcher in the list will be the default when you double click on .blend files. But you don’t need to put the “Blender-RenderOffload” launcher that you created first on the list. You can just create another launcher for the default “blender” and put it first in the list, and then you will have the following launchers available from Dolphin file explorer when you right-click on a .blend file, open with…

For Me Screen tearing is not a driver issue, it’s issue of opengl. The default system setting -> display & montor -> compositor is using rending backend openGL 2.0. Which causing problem, so I changed it openGL 3.1 and it solved my animation issue. Screen-tearing is way less then before. Everything seems works, But blender still unable to detect any gpu for path tracing.

Because of Time limit — I edited this and adding here…

Yes, latest blender downloaded form blender website is detect the cuda enabled gpu for path tracing. This is issue of Ubuntu, I going to report this. That’s the end closing the issue. Thanks for helping. You guys are really awesome.

Forgive my insistence, but I think you did not answer before. Are you using official Blender downloaded from Blender site (tar.xz package)?
Was CUDA detected before you tried to use PRIME? (NVIDIA - Performance mode)

1 Like

That is why I had insisted that it was very important.
I don’t think you need to report this. Official Blender includes precompiled CUDA kernels. Ubuntu Blender packages do not include precompiled CUDA kernels, and this is an intentional decision from Ubuntu maintainers. For ubuntu packages to work, you must install cuda toolkit which are basically for developers, but allow Blender to compile CUDA kernels on your system. If you are going to use official Blender (which is what Blender developers recommend), you don’t need to install cuda toolkit.

2 Likes

I’ve googled the way to run Debian blender build with CUDA support: Blender, CUDA and Linux: the happy-end story - Analytics Vidhya - Medium

TL;DR: you must have /usr/bin/cuda-gcc installed.

fox@aiur:~$ apt-file search /usr/bin/cuda-gcc
nvidia-cuda-toolkit-gcc: /usr/bin/cuda-gcc