You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 4 gpus. I wanna use the memory of one of them for firefox.
firejail still allows access to GPUs I've blacklisted
Steps to Reproduce
fill up your pc with gpus
run xorg
run any X11 desktop
run firejail --blacklist=/sys/module/amdgpu/ --blacklist=/dev/nvidia0 firefox
Expected behavior
amdgpu and the nvidia0 card is not visible to firefox
Actual behavior
firefox sees all 4 of my gpus and chooses the amdgpu, thats running Xorg
Behavior without a profile
nothing changed
Additional context
the list of GPUs firefox discovers is PCI candidate
since firefox's code is still in the era of "no one needs more than 1 gpu", there is no way to set the gpu
it also ignores any combination of these env vars:
[not sure] The issues is caused by firejail (i.e. running the program by path (e.g. /usr/bin/vlc) "fixes" it).
I can reproduce the issue without custom modifications (e.g. globals.local).
The program has a profile. (If not, request one in https://github.com/netblue30/firejail/issues/1139)
The profile (and redirect profile if exists) hasn't already been fixed upstream.
I have performed a short search for similar issues (to avoid opening a duplicate).
I'm aware of browser-allow-drm yes/browser-disable-u2f no in firejail.config to allow DRM/U2F in browsers.
I used --profile=PROFILENAME to set the right profile. (Only relevant for AppImages)
Log
log
2024-01-07 04:14:26 allan@S5:~$ firejail --blacklist=/sys/module/amdgpu/ --blacklist=/dev/nvidia0 firefoxReading profile /etc/firejail/firefox.profileReading profile /etc/firejail/whitelist-usr-share-common.incReading profile /etc/firejail/firefox-common.profileReading profile /etc/firejail/disable-common.incReading profile /etc/firejail/disable-devel.incReading profile /etc/firejail/disable-exec.incReading profile /etc/firejail/disable-interpreters.incReading profile /etc/firejail/disable-proc.incReading profile /etc/firejail/disable-programs.incReading profile /etc/firejail/whitelist-common.incReading profile /etc/firejail/whitelist-run-common.incReading profile /etc/firejail/whitelist-runuser-common.incReading profile /etc/firejail/whitelist-var-common.incWarning: networking feature is disabled in Firejail configuration fileSeccomp list in: !chroot, check list: @default-keep, prelist: unknown,Parent pid 3003657, child pid 3003661Warning: not remounting /var/lib/docker/overlay2/355faacadd130ed0ef2ff243bd8cf3c23abcac7d61abc8d85a4c43b219e36366/mergedWarning: not remounting /var/lib/docker/overlay2/355faacadd130ed0ef2ff243bd8cf3c23abcac7d61abc8d85a4c43b219e36366/mergedWarning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.Warning: NVIDIA card detected, nogroups command ignoredWarning: NVIDIA card detected, nogroups command ignoredWarning: NVIDIA card detected, nogroups command ignoredWarning: NVIDIA card detected, nogroups command ignoredSeccomp list in: !chroot, check list: @default-keep, prelist: unknown,Warning: NVIDIA card detected, nogroups command ignoredWarning: NVIDIA card detected, nogroups command ignoredWarning: Replacing profile instead of stacking it. It is a legacy behavior that can result in relaxation of the protection. It is here as a temporary measure to unbreak the software that has been broken by switching to the stacking behavior.Child process initialized in 786.96 ms** (process:3003658): WARNING **: 04:20:37.839: Error writing credentials to socket: Error sending message: Broken pipe[GFX1-]: glxtest: ManageChildProcess failed[GFX1-]: glxtest: libEGL initialize failed[GFX1-]: glxtest: X error, error_code=2, request_code=152, minor_code=3[GFX1-]: More than 1 GPU vendor detected via PCI, cannot deduce vendor[GFX1-]: PCI candidate 0x10de/0x2182[GFX1-]: PCI candidate 0x10de/0x2204[GFX1-]: PCI candidate 0x1002/0x67df[GFX1-]: PCI candidate 0x1a03/0x2000
The text was updated successfully, but these errors were encountered:
kmk3
changed the title
FIX gpu is not blacklisted
Cannot blacklist all but one gpu
Jan 9, 2024
Programs usually do not access kernel modules directly (and firejail already
blacklists /sys/module by default anyway), so the first blacklist is unlikely
to do anything.
I don't know about nvidia, but AMD cards are usually in /dev/dri.
Description
I have 4 gpus. I wanna use the memory of one of them for firefox.
firejail still allows access to GPUs I've blacklisted
Steps to Reproduce
firejail --blacklist=/sys/module/amdgpu/ --blacklist=/dev/nvidia0 firefox
Expected behavior
amdgpu and the nvidia0 card is not visible to firefox
Actual behavior
firefox sees all 4 of my gpus and chooses the amdgpu, thats running Xorg
Behavior without a profile
nothing changed
Additional context
the list of GPUs firefox discovers is PCI candidate
since firefox's code is still in the era of "no one needs more than 1 gpu", there is no way to set the gpu
it also ignores any combination of these env vars:
CUDA_VISIBLE_DEVICES=1 __VK_LAYER_NV_optimus=NVIDIA_only __NV_PRIME_RENDER_OFFLOAD=1 __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G1 __GLX_VENDOR_LIBRARY_NAME=nvidia DRI_PRIME="pci-0000_61_00_0!" PrefersNonDefaultGPU=true MOZ_WAYLAND_DRM_DEVICE=/dev/dri/by-path/pci-0000:61:00.0-render PRIMUS_VERBOSE=2 firejail --blacklist=/sys/module/amdgpu/ --blacklist=/dev/nvidia0 --noprofile firefox
gpu processing offloading works fine
Environment
Checklist
/usr/bin/vlc
) "fixes" it).https://github.com/netblue30/firejail/issues/1139
)browser-allow-drm yes
/browser-disable-u2f no
infirejail.config
to allow DRM/U2F in browsers.--profile=PROFILENAME
to set the right profile. (Only relevant for AppImages)Log
log
The text was updated successfully, but these errors were encountered: