Run blender as root?

I’m a rather noobie to blender, and I just realized that it uses my CPU instead of my GPU. So I went to System in User Prefs to change my render device, but it was like, “nope, no CUDA for you” (There was no option for CUDA) (I have a GTX 750 Ti), so after some research, I found out that running blender as root could solve the problem. I can’t figure out how to run blender as root though. I’m pretty sure I have to go to the terminal and go to my Blender dir, which I did, and I tried “sudo blender,” but it said “sudo: blender: command not found”. I’m pretty new to Linux too, and I’m running Ubuntu 15.04.

Running things as root is a sign that you don’t have something setup correctly. Also running Blender as root can cause all sorts of issues that you don’t want to deal with (like file permission issues). But, if you still want to run as root, just change your command to this:

sudo ./blender

No, you should not run Blender as root. For Ubuntu, Ubuntu family or based on Ubuntu Linux distro like Linux Mint, you must to do this:

  • Install the nvidia driver from driver manager.
  • Install the “nvidia-modprobe” package from package manager. Reboot the system (read at the end of this message for 14.04 version)
  • Install Blender from the repositories. This is only for the required dependencies are installed. After installation, you can uninstall Blender.
  • Download Blender from the official site (tar.bz2 file). Unpack tar.bz2 in a folder and execute there the “blender” file. (Official Blender includes precompiled CUDA kernel, you “do not need” to install CUDA Toolkit).
  • Follow these steps to enable CUDA:
    https://www.blender.org/manual/render/cycles/gpu_rendering.html

Configuration

To enable GPU rendering, go into the User Preferences, and under the System tab, select the Compute Device(s) to use. Next, for each scene, you can configure to use CPU or GPU rendering in the Render properties.

Note:
If you are using Ubuntu (or Ubuntu based distro) v. 14.04 and you do not find “nvidia-modprobe” in your package manager, you can download and install the .deb package from here:
http://packages.ubuntu.com/trusty-backports/nvidia-modprobe
Anyway, nvidia-modprobe is in “backports” repository in 14.04.

Remember you add as affected in this reports:

Edit:
Currently in Ubuntu 16.04 you don’t need install “nvidia-modprobe” nor Blender from repositories. You just install nvidia driver, reboot the system and download official Blender tar.bz2 file.

Thanks a lot!

Shouldn’t run as root but I’m guessing it was to test if nvidia driver bug was causing cuda to not be available.

I had the same problem and the only way i fixed it was to run as root.

It’s gksudo for a gui program

No, it is not the only way. You do what I have written above.

That is, install “nvidia-modprobe” and reboot.
And use “official” Blender, not from repositories (that way you avoid having to download about 700MB in CUDA toolkit and dependencies for developers)

some linux Distros WILL try to stop the user from
"shooting them selves in the head "
and do there BEST to prevent the user from running
NORMAL EVERYDAY PROGRAMS
as root

other OS’s will GLADLY let the user "shoot them selves in the head "

basically

do not run normal everyday programs as root

CUDA requires using the NVIDIA driver

Ubuntu like almost every other distro defaults to using the Nouveau driver ( non cuda)

you need to REPLACE the nouveau driver with the nvidia driver for YOUR distro

see the ubuntu documentation

Thanks for everyone’s help, YAFU’s solution worked like a charm for me.

Just wanted to add my thank you to the list.
I use Linux Mint 17 and nvidia-346-updates.

I updated my sources.list as described here : http://packages.ubuntu.com/trusty-backports/amd64/nvidia-modprobe/download
sudo apt-get update
sudo apt-get install nvidia-modprobe

There was no need to restart, it worked right away: CUDA was available in User prefs > System.

Thanks YAFU!

ps: btw your username sounds exactly the same as when japanese people say “Yahoo”. :slight_smile:

Hello. I decided to contribute to this thread because I face the same problem (GPU not detected in Blender unless running it with root rights), but the nvidia-modprobe solution doesn’t work for me.

My hardware configuration is a MSI laptop with a Nvidia GeForce GTX 970M GPU.
I installed Linux Mint 17.3 (KDE) and the nvidia driver 352.64 from the driver manager. No surprise, when I run Blender from my user session the GPU is not detected, unless I run it with root rights first.
To solve the problem, I tried YAFU’s solution completed with JoolsMcFly’s one (because unlike ubuntu, linux mint package manager doesn’t provide nvidia-modprobe). It worked instantly, but after turning my computer off, it wouldn’t boot any more. I had to repair my system and get rid of nvidia-modprobe. I suspect that the nvidia-modprobe installed with JoolsMcFly solution doesn’t match the 352.64 nvidia driver. And I don’t want to downgrade the driver because previous drivers don’t work well with my GPU.
I then tried this solution to get the correct nvidia-modprobe (linux mint part), but the make process failed.

Now, I don’t know what to do more.
Is there a linux mint user to explain exactly how to get the correct nvidia-modprobe for the nvidia driver 352.64, and how to install it ?
Thx

I’m going to dive in here, not about Blender specifically, but for the benefit of Linux users (especially new users) generally.

Unless you are modifying system settings, or the system itself, do not use root. You WILL at some point cause damage, or open a security hole.

If the only way a general application works is as root, you have something configured wrong. You may need root to fix it, but you DO NOT need root to run it.

I totally agree with you, that’s why I need a solution to make Blender detect the GPU in my user session.