[GH-ISSUE #841] nvidia driver and noroot setting #573

Closed
opened 2026-05-05 06:11:17 -06:00 by gitea-mirror · 29 comments
Owner

Originally created by @reinerh on GitHub (Oct 6, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/841

A Debian user reported that Steam was segfaulting when run with firejail after upgrading the nvidia driver to 367.44-2.
(Also glxgears behaves wrong with the steam profile)

The problematic line in the steam profile is the "noroot" setting, though I don't know why exactly this is causing issues.

The complete bug report is here.

Originally created by @reinerh on GitHub (Oct 6, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/841 A Debian user reported that Steam was segfaulting when run with firejail after upgrading the nvidia driver to 367.44-2. (Also glxgears behaves wrong with the steam profile) The problematic line in the steam profile is the "noroot" setting, though I don't know why exactly this is causing issues. The complete bug report is [here](https://bugs.debian.org/839868).
gitea-mirror 2026-05-05 06:11:17 -06:00
Author
Owner

@netblue30 commented on GitHub (Oct 8, 2016):

I have a fix in 40ed53c20b

I don't have a Nvidia card, but I think it will fix the issue. I added video and games to the groups allowed in the user namespace. I close the bug for now and reopen it if necessary. Thanks.

<!-- gh-comment-id:252422373 --> @netblue30 commented on GitHub (Oct 8, 2016): I have a fix in https://github.com/netblue30/firejail/commit/40ed53c20b7a1a5569795a858c3bfe100083c666 I don't have a Nvidia card, but I think it will fix the issue. I added video and games to the groups allowed in the user namespace. I close the bug for now and reopen it if necessary. Thanks.
Author
Owner

@kevinoid commented on GitHub (Mar 11, 2017):

I'm seeing this same issue with Firejail 0.9.44.8-1 on Debian with an nVidia NVS 5400M. It looks like 40ed53c either did not fix the issue or it has reappeared.

I compiled from the current master (22414ad) and captured the strace output for glxgears with and without --noroot and posted it as a gist: https://gist.github.com/kevinoid/cb1c4ed6c8f073d41b1c4e1039e04e99#file-glxgears-strace-diff

Notably, when running with --noroot it tries and fails to chmod /dev/nvidia-modeset, /dev/nvidia-modeset, and /dev/nvidia0 then forks a child which fails to chmod the device, then opens it (which succeeds, since the devices are still root:root 0666 which stat showed before chmod). It also does not try to write anything to ~/.nv/GLCache (although the train may have left the tracks before this point). It doesn't make much sense to me. Any ideas?

Thanks,
Kevin

<!-- gh-comment-id:285846554 --> @kevinoid commented on GitHub (Mar 11, 2017): I'm seeing this same issue with Firejail 0.9.44.8-1 on Debian with an nVidia NVS 5400M. It looks like 40ed53c either did not fix the issue or it has reappeared. I compiled from the current master (22414ad) and captured the `strace` output for `glxgears` with and without `--noroot` and posted it as a gist: https://gist.github.com/kevinoid/cb1c4ed6c8f073d41b1c4e1039e04e99#file-glxgears-strace-diff Notably, when running with `--noroot` it tries and fails to `chmod` `/dev/nvidia-modeset`, `/dev/nvidia-modeset`, and `/dev/nvidia0` then forks a child which fails to `chmod` the device, then opens it (which succeeds, since the devices are still `root:root` `0666` which `stat` showed before `chmod`). It also does not try to write anything to `~/.nv/GLCache` (although the train may have left the tracks before this point). It doesn't make much sense to me. Any ideas? Thanks, Kevin
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 19, 2018):

I have an Nvidia card and have used noroot with with nvidia driver for a while now with no issues. Is anyone still seeing this issue?

<!-- gh-comment-id:414141174 --> @chiraag-nataraj commented on GitHub (Aug 19, 2018): I have an Nvidia card and have used `noroot` with with `nvidia` driver for a while now with no issues. Is anyone still seeing this issue?
Author
Owner

@kevinoid commented on GitHub (Aug 19, 2018):

I can confirm that this is still an issue for me on Debian with firejail 0.9.54-1, nvidia 390.77-1, and Linux 4.18.0 (from kernel.org, without Debian patches). firejail --noprofile glxgears works fine, but firejail --noprofile --noroot glxgears shows a black window without the spinning gears. I updated the gist at https://gist.github.com/kevinoid/cb1c4ed6c8f073d41b1c4e1039e04e99#file-glxgears-strace-diff with the strace differences between the two.

<!-- gh-comment-id:414146240 --> @kevinoid commented on GitHub (Aug 19, 2018): I can confirm that this is still an issue for me on Debian with firejail 0.9.54-1, nvidia 390.77-1, and Linux 4.18.0 (from kernel.org, without Debian patches). `firejail --noprofile glxgears` works fine, but `firejail --noprofile --noroot glxgears` shows a black window without the spinning gears. I updated the gist at https://gist.github.com/kevinoid/cb1c4ed6c8f073d41b1c4e1039e04e99#file-glxgears-strace-diff with the `strace` differences between the two.
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 19, 2018):

That's very interesting. I'm on Debian sid/experimental, with firejail 0.9.55 (from git), nvidia 396.51-1, and Linux 4.17.8 (custom-built from linux-source-4.17). Both firejail --noprofile glxgears and firejail --noprofile --noroot glxgears give me the normal window (spinning gears).

<!-- gh-comment-id:414146926 --> @chiraag-nataraj commented on GitHub (Aug 19, 2018): That's very interesting. I'm on Debian sid/experimental, with firejail 0.9.55 (from git), nvidia 396.51-1, and Linux 4.17.8 (custom-built from linux-source-4.17). Both `firejail --noprofile glxgears` and `firejail --noprofile --noroot glxgears` give me the normal window (spinning gears).
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 23, 2018):

@kevinoid I'm curious to see if you run into the issue with a Debian stock kernel. Can you test and report back?

<!-- gh-comment-id:415430975 --> @chiraag-nataraj commented on GitHub (Aug 23, 2018): @kevinoid I'm curious to see if you run into the issue with a Debian stock kernel. Can you test and report back?
Author
Owner

@kevinoid commented on GitHub (Aug 23, 2018):

@chiraag-nataraj Sure. I can confirm that the same behavior occurs when running kernel 4.17.0-1-amd64 from the linux-image-4.17.0-1-amd64 package (version 4.17.8-1) with nVidia modules built using nvidia-kernel-dkms (version 390.77-1).

<!-- gh-comment-id:415444059 --> @kevinoid commented on GitHub (Aug 23, 2018): @chiraag-nataraj Sure. I can confirm that the same behavior occurs when running kernel 4.17.0-1-amd64 from the linux-image-4.17.0-1-amd64 package (version 4.17.8-1) with nVidia modules built using nvidia-kernel-dkms (version 390.77-1).
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 23, 2018):

Damn, that's weird. So I have a newer version of nvidia-driver, but I've never had this issue, so I suspect that the driver version doesn't really matter too much.

<!-- gh-comment-id:415444940 --> @chiraag-nataraj commented on GitHub (Aug 23, 2018): Damn, that's weird. So I have a newer version of `nvidia-driver`, but I've never had this issue, so I suspect that the driver version doesn't really matter too much.
Author
Owner

@SkewedZeppelin commented on GitHub (Aug 23, 2018):

Multiple monitors? Different outputs?

it has always been arbitrary when the driver calls its suid binary iirc

<!-- gh-comment-id:415447717 --> @SkewedZeppelin commented on GitHub (Aug 23, 2018): Multiple monitors? Different outputs? it has always been arbitrary when the driver calls its suid binary iirc
Author
Owner

@kevinoid commented on GitHub (Aug 23, 2018):

I agree. I don't think it is version-specific. I'm currently using the laptop screen. I can test the VGA output soon.

If you run firejail --noprofile --noroot strace -f -o glxgears.strace glxgears do you see any chmod("/dev/nvidiactl", 0666) calls in glxgears.strace? I'm curious whether it is making those calls and whether the call succeeds.

Also, for reference, my system has nVidia Optimus, so it has both an Intel graphics card and an nVidia card. The problem does not occur when using Mesa on the Intel card.

<!-- gh-comment-id:415449064 --> @kevinoid commented on GitHub (Aug 23, 2018): I agree. I don't think it is version-specific. I'm currently using the laptop screen. I can test the VGA output soon. If you run `firejail --noprofile --noroot strace -f -o glxgears.strace glxgears` do you see any `chmod("/dev/nvidiactl", 0666)` calls in `glxgears.strace`? I'm curious whether it is making those calls and whether the call succeeds. Also, for reference, my system has nVidia Optimus, so it has both an Intel graphics card and an nVidia card. The problem does not occur when using Mesa on the Intel card.
Author
Owner

@kevinoid commented on GitHub (Aug 23, 2018):

I can confirm the same behavior occurs when using the VGA output with LVDS (the laptop screen) disabled.

<!-- gh-comment-id:415452818 --> @kevinoid commented on GitHub (Aug 23, 2018): I can confirm the same behavior occurs when using the VGA output with LVDS (the laptop screen) disabled.
Author
Owner

@chiraag-nataraj commented on GitHub (Aug 23, 2018):

I agree. I don't think it is version-specific. I'm currently using the laptop screen. I can test the VGA output soon.

I doubt the output itself would matter, since the same driver would be driving whichever screen(s) you're using.

If you run firejail --noprofile --noroot strace -f -o glxgears.strace glxgears do you see any chmod("/dev/nvidiactl", 0666) calls in glxgears.strace? I'm curious whether it is making those calls and whether the call succeeds.

I actually do see those calls and they do fail with EPERM (Operation not permitted) and glxgears works just fine regardless.

Also, for reference, my system has nVidia Optimus, so it has both an Intel graphics card and an nVidia card. The problem does not occur when using Mesa on the Intel card.

Yup, I have Optimus as well.

<!-- gh-comment-id:415605437 --> @chiraag-nataraj commented on GitHub (Aug 23, 2018): > I agree. I don't think it is version-specific. I'm currently using the laptop screen. I can test the VGA output soon. I doubt the output itself would matter, since the same driver would be driving whichever screen(s) you're using. > If you run `firejail --noprofile --noroot strace -f -o glxgears.strace glxgears` do you see any `chmod("/dev/nvidiactl", 0666)` calls in `glxgears.strace`? I'm curious whether it is making those calls and whether the call succeeds. I actually _do_ see those calls and they _do_ fail with `EPERM (Operation not permitted)` and `glxgears` works just fine regardless. > Also, for reference, my system has nVidia Optimus, so it has both an Intel graphics card and an nVidia card. The problem does not occur when using Mesa on the Intel card. Yup, I have Optimus as well.
Author
Owner

@chiraag-nataraj commented on GitHub (May 20, 2019):

Is this still an issue?

<!-- gh-comment-id:494030342 --> @chiraag-nataraj commented on GitHub (May 20, 2019): Is this still an issue?
Author
Owner

@kevinoid commented on GitHub (May 20, 2019):

Thanks for checking in. I can confirm that this is still an issue for me on Debian with firejail built from the current master branch (feae44c4), nvidia 390.116-1, and Linux 5.1.2 (from kernel.org, without Debian patches). firejail --noprofile glxgears works fine, but firejail --noprofile --noroot glxgears shows a black window without the spinning gears.

<!-- gh-comment-id:494040926 --> @kevinoid commented on GitHub (May 20, 2019): Thanks for checking in. I can confirm that this is still an issue for me on Debian with firejail built from the current master branch (feae44c4), nvidia 390.116-1, and Linux 5.1.2 (from kernel.org, without Debian patches). `firejail --noprofile glxgears` works fine, but `firejail --noprofile --noroot glxgears` shows a black window without the spinning gears.
Author
Owner

@chiraag-nataraj commented on GitHub (May 20, 2019):

Hmm, I see. Is this an issue if you use the Debian-supplied kernel instead of the custom build?

<!-- gh-comment-id:494042327 --> @chiraag-nataraj commented on GitHub (May 20, 2019): Hmm, I see. Is this an issue if you use the Debian-supplied kernel instead of the custom build?
Author
Owner

@kevinoid commented on GitHub (May 20, 2019):

Yep. I can confirm that the same symptoms occur with firejail built from feae44c, nvidia 390.116-1, and Linux 4.19.0-5-amd64 (from the linux-image-4.19.0-5-amd64 Debian package version 4.19.37-3).

<!-- gh-comment-id:494046428 --> @kevinoid commented on GitHub (May 20, 2019): Yep. I can confirm that the same symptoms occur with firejail built from feae44c, nvidia 390.116-1, and Linux 4.19.0-5-amd64 (from the linux-image-4.19.0-5-amd64 Debian package version 4.19.37-3).
Author
Owner

@chiraag-nataraj commented on GitHub (May 20, 2019):

I'm wondering if it just has to do with something they changed on their end, since I'm on 418.74...

<!-- gh-comment-id:494048333 --> @chiraag-nataraj commented on GitHub (May 20, 2019): I'm wondering if it just has to do with something they changed on their end, since I'm on 418.74...
Author
Owner

@chiraag-nataraj commented on GitHub (May 20, 2019):

But looking back, that doesn't seem to matter...I'm stumped.

<!-- gh-comment-id:494048634 --> @chiraag-nataraj commented on GitHub (May 20, 2019): But looking back, that doesn't seem to matter...I'm stumped.
Author
Owner

@chiraag-nataraj commented on GitHub (May 20, 2019):

If you do firejail --noroot --noprofile glxinfo, what is the output?

<!-- gh-comment-id:494048779 --> @chiraag-nataraj commented on GitHub (May 20, 2019): If you do `firejail --noroot --noprofile glxinfo`, what is the output?
Author
Owner

@kevinoid commented on GitHub (May 20, 2019):

I added the output of firejail --noroot --noprofile glxinfo to the gist with the strace outputs: https://gist.github.com/kevinoid/cb1c4ed6c8f073d41b1c4e1039e04e99#file-glxinfo-noroot-txt

<!-- gh-comment-id:494051121 --> @kevinoid commented on GitHub (May 20, 2019): I added the output of `firejail --noroot --noprofile glxinfo` to the gist with the strace outputs: https://gist.github.com/kevinoid/cb1c4ed6c8f073d41b1c4e1039e04e99#file-glxinfo-noroot-txt
Author
Owner

@chiraag-nataraj commented on GitHub (May 20, 2019):

Hold on. Your glxinfo output is showing that glxinfo has no problem accessing your Nvidia card. Something's really screwy here, since you're reporting that glxgears has the problem, but your output shows that glxinfo does not.

<!-- gh-comment-id:494051956 --> @chiraag-nataraj commented on GitHub (May 20, 2019): Hold on. Your `glxinfo` output is showing that `glxinfo` has no problem accessing your Nvidia card. Something's really screwy here, since you're reporting that `glxgears` has the problem, but your output shows that `glxinfo` does not.
Author
Owner

@kevinoid commented on GitHub (May 20, 2019):

That is correct. On my system glxinfo appears to work fine with --noroot. glxgears does not work with --noroot.

<!-- gh-comment-id:494052962 --> @kevinoid commented on GitHub (May 20, 2019): That is correct. On my system `glxinfo` appears to work fine with `--noroot`. `glxgears` does not work with `--noroot`.
Author
Owner

@chiraag-nataraj commented on GitHub (May 21, 2019):

That's so odd...I would presume they'd both attempt to access the Nvidia driver the same way...

<!-- gh-comment-id:494424227 --> @chiraag-nataraj commented on GitHub (May 21, 2019): That's so odd...I would presume they'd both attempt to access the Nvidia driver the same way...
Author
Owner

@czka commented on GitHub (Mar 15, 2020):

For the record: similar thing with nvidia driver 390.132-32 on Arch Linux, trying to run Operation Flashpoint (aka Arma: Cold War Assult these days) on Steam 1.0.0.61-4 in Gnome 3.36.0, X11 mode.

With noroot disabled in /etc/firejail/steam.profile the game runs fine. When noroot is set (as per Firejail's default) game's video freezes as long as its full-screen "window" is focused. However, when I press alt+tab to switch windows, I can see the game's video unfreezed underneath the list of windows. And so forth - once I switch to game's window, the video gets stuck, and when I press alt+tab I can see the game actually runnig fine underneath the list of my active windows.

@netblue30 Maybe add a hint regarding noroot in steam.profile for people trying to run games on Linux+Steam+Nvidia? I took me a long moment to figure this out.

<!-- gh-comment-id:599203435 --> @czka commented on GitHub (Mar 15, 2020): For the record: similar thing with `nvidia` driver `390.132-32` on Arch Linux, trying to run Operation Flashpoint (aka Arma: Cold War Assult these days) on Steam `1.0.0.61-4` in Gnome `3.36.0`, `X11` mode. With `noroot` disabled in `/etc/firejail/steam.profile` the game runs fine. When `noroot` is set (as per Firejail's default) game's video freezes as long as its full-screen "window" is focused. However, when I press `alt`+`tab` to switch windows, I can see the game's video unfreezed underneath the list of windows. And so forth - once I switch to game's window, the video gets stuck, and when I press `alt`+`tab` I can see the game actually runnig fine underneath the list of my active windows. @netblue30 Maybe add a hint regarding `noroot` in `steam.profile` for people trying to run games on Linux+Steam+Nvidia? I took me a long moment to figure this out.
Author
Owner

@rusty-snake commented on GitHub (Mar 15, 2020):

@czka done.

<!-- gh-comment-id:599205130 --> @rusty-snake commented on GitHub (Mar 15, 2020): @czka done.
Author
Owner

@czka commented on GitHub (Mar 22, 2020):

@rusty-snake Kewl!

<!-- gh-comment-id:602169349 --> @czka commented on GitHub (Mar 22, 2020): @rusty-snake Kewl!
Author
Owner

@matu3ba commented on GitHub (Sep 8, 2020):

@rusty-snake Could you close due fixed and no feedback?

<!-- gh-comment-id:689197173 --> @matu3ba commented on GitHub (Sep 8, 2020): @rusty-snake Could you close due fixed and no feedback?
Author
Owner

@rusty-snake commented on GitHub (Sep 9, 2020):

Maybe we want to keep it open until we have a better fix then adding a note that nvidia-users should add ignore noroot to some profiles. I'm not sure.

<!-- gh-comment-id:689472937 --> @rusty-snake commented on GitHub (Sep 9, 2020): Maybe we want to keep it open until we have a better fix then adding a note that nvidia-users should add `ignore noroot` to some profiles. I'm not sure.
Author
Owner

@netblue30 commented on GitHub (Oct 2, 2020):

Temporary fix in for the next release: I disable nogroups if /dev/nvidiactl is detected in the system. If it is working we go with it in the next release and find a better way to do it later.

<!-- gh-comment-id:702858263 --> @netblue30 commented on GitHub (Oct 2, 2020): Temporary fix in for the next release: I disable nogroups if /dev/nvidiactl is detected in the system. If it is working we go with it in the next release and find a better way to do it later.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#573
No description provided.