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
There should be a way to allow Codex to use GPUs without completely disabling the sandbox. I want it to be able to run tests for my ML projects. Or it should be allowed by default maybe. But that's a lot of attack surface.
Are you interested in implementing this feature?
No
Additional information
No response
Reacted by le-horizon, MartinPernus, 황반석, Sebastian, Yushi Yang, London Lowmanstone, Glenn Matlin, Mikhail Maltsev, Junqing Chen, JOO and 55 more
Similar issue on Windows and WSL using the VSCode extension. I'm not a security expert so it's not clear to me why it can't access GPU resources without being in "full access" mode. I still want to limit its access to files on my computer, as I have sensitive data, but I want it to be able to autonomously run ML experiments using my local GPU.
(One especially confusing aspect is the fact that in non-full-access mode, it can successfully run nvidia-smi and see that the GPU device exists, but torch.cuda.is_available() == False.)
For me "/dev" workaround was fine for one project, but in another torch didn't see the card.
The fix for me was upgrading the nvidia drivers, giving codex write permission to the uv cache dir and then having codex run code through uv, in addition to the "/dev" workaround.
Still an issue on the latest versions. I will see if there is a way to patch this and then submit a PR, as it seems silly to me that hardware pass-through should require dangerously escalating permissions elsewhere.
Reacted by Xynonners, Jordan Rossen and London Lowmanstone
This works, and I feel better about it than allowing all of /dev. It seems to me that it might be impossible to scope the sandbox hole any smaller than this:
Any safe solutions if you are working on a hpc cluster? I don't think i should be giving codex writable permissions to the /dev dir (it probably would get denied)
The inability to allow GPU access within the sandbox is a very strange state of affairs. Does anyone have an explanation other than Ernestine's response to customers: "We don't care. We don't have to. We're The Phone Company."?
Reacted by idev2580, Matthew E. Kieren, sealclubber and Weihong Xu
I found another layer to this with the network proxy enabled: with the NVIDIA devices exposed, CUDA still needed abstract Unix sockets during initialization. Enabling dangerously_allow_all_unix_sockets in the GPU profile got a small CUDA allocation/copy test working. Details: #16910 (comment)
Activity
L1aoXingyu commentedon Sep 11, 2025
met the same issue
davidstap commentedon Sep 17, 2025
I'm also interested in this.
nallana commentedon Sep 22, 2025
+1
L1aoXingyu commentedon Sep 23, 2025
i found when i pass
--dangerously-bypass-approvals-and-sandbox, it can use GPU in docker.ShangAlex commentedon Sep 30, 2025
+1
annawoodard commentedon Oct 13, 2025
same issue for me but
--dangerously-bypass-approvals-and-sandbox(thanks @L1aoXingyu) works on campus HPC clusterHemistone commentedon Oct 15, 2025
+1
devjj commentedon Oct 24, 2025
+1
CedricHwong commentedon Nov 8, 2025
@L1aoXingyu Thanks!
Jadiker commentedon Nov 11, 2025
Similar issue on Windows and WSL using the VSCode extension. I'm not a security expert so it's not clear to me why it can't access GPU resources without being in "full access" mode. I still want to limit its access to files on my computer, as I have sensitive data, but I want it to be able to autonomously run ML experiments using my local GPU.
(One especially confusing aspect is the fact that in non-full-access mode, it can successfully run
nvidia-smiand see that the GPU device exists, buttorch.cuda.is_available() == False.)glennmatlin commentedon Nov 12, 2025
Dangerous bypass should not be required for GPU access -- ideally a flag should be used when calling just like how websearch has one.
haimat commentedon Nov 14, 2025
I hit the same issue and agree - it should be possible to allow GPU access while still restrict other access.
HenryQUQ commentedon Nov 14, 2025
Totally agree. Should have a command maybe called "enable_GPUs"
Infinity12306 commentedon Nov 17, 2025
really need this feature!!!!
16 remaining items
Initial commit: moor v0.1.0
Allow GPU access inside of landlock sandbox
johnnoren commentedon Mar 1, 2026
For me "/dev" workaround was fine for one project, but in another torch didn't see the card.
The fix for me was upgrading the nvidia drivers, giving codex write permission to the uv cache dir and then having codex run code through uv, in addition to the "/dev" workaround.
milianks commentedon Mar 17, 2026
TheReaperJay commentedon Mar 31, 2026
Still an issue on the latest versions. I will see if there is a way to patch this and then submit a PR, as it seems silly to me that hardware pass-through should require dangerously escalating permissions elsewhere.
WillerZ commentedon Apr 13, 2026
This works, and I feel better about it than allowing all of
/dev. It seems to me that it might be impossible to scope the sandbox hole any smaller than this:milianks commentedon Apr 13, 2026
johnolusetire commentedon Apr 25, 2026
Any safe solutions if you are working on a hpc cluster? I don't think i should be giving codex writable permissions to the /dev dir (it probably would get denied)
WillerZ commentedon May 1, 2026
After the latest update it causes a sandbox error to have the config I proposed earlier:
Shercoolcool commentedon May 7, 2026
really need this feature
jabowery commentedon Jun 10, 2026
The inability to allow GPU access within the sandbox is a very strange state of affairs. Does anyone have an explanation other than Ernestine's response to customers: "We don't care. We don't have to. We're The Phone Company."?
mysteryx93 commentedon Sep 24, 2026
Just so you know, Grok Code has no issue working with the GPU.
TheReaperJay commentedon Sep 24, 2026
@mysteryx93 but did they fix the bug where they were uploading your entire project folder to their servers, inclusive of secrets and .env?
mysteryx93 commentedon Sep 25, 2026
They turned the feature off
diogovalada commentedon Sep 27, 2026
I found another layer to this with the network proxy enabled: with the NVIDIA devices exposed, CUDA still needed abstract Unix sockets during initialization. Enabling
dangerously_allow_all_unix_socketsin the GPU profile got a small CUDA allocation/copy test working. Details: #16910 (comment)