Codex, figure out why nvidia-smi isn’t working
Sunday, 21 September 2025
Disclaimer: I am employed by the maker of ChatGPT, although I do not work on Codex.
One way to use ChatGPT Codex is via its CLI program, which is supposed to be for writing code. But more importantly, it can run commands (that you manually approve) on your actual machine! And that means it can be your personal tech support!
I need this because my personal computer is a desktop running Ubuntu. The OS install has been upgraded many times over the years and has accumulated a decent amount of customization and personal hacks. And my own risky meddling has caused a decent number of problems and weird behavior.
Since Codex can execute commands on your system, it can do things like see your kernel version, read config files, list your PCI devices, and whatever else you would normally try on the CLI. The first time I needed it, I had just done a big upgrade of all the packages on my system and GPU acceleration was no longer working. I did have the Nvidia driver installed, but nvidia-smi didn’t show me my GPUs and programs like Blender complained that I didn’t have any CUDA or OptiX-capable devices.
I simply told Codex, “Figure out why nvidia-smi is not showing my graphics card”, and it:
- ran
nvidia-smi
to confirm the problem - ran
lspci
to see what GPU was installed - ran
lsmod
to check which nvidia modules I had - checked
dkms status
- checked my kernel version
- saw that I was running the “gcp” version of the kernel (no idea how I got upgraded to this, honestly) which didn’t match the nvidia module
- thought that, “The presence of a discrete GPU suggests an accidental use of the gcp kernel for a desktop or perhaps using Ubuntu’s livepatch.”
- and a bunch of other diagnostic steps that you can read in the full transcript
All it took was a few minutes of me reading and approving the commands it wanted to run and Codex gave me the answer to what was going on. Somehow, after the last package update I was running the GCP kernel variant that I don’t remember ever explicitly installing. (It might have been some combination of meta-packages that depended on it and weird logic to select the newest kernel on boot?) I ended by asking it for what steps I needed to do next, since it couldn’t run commands as root.
(Note that I didn’t bother following the exact commands it gave me. I figured this was a good time to see if I had any other cruft installed, so instead I popped into aptitude and manually fiddled with my packages, deleting a bunch of ones I didn’t need.)
I’m not sure how long it would have taken me to figure this out on my own – prior to using Codex, I spent several minutes checking that I did have the nvidia driver installed and trying to figure out why it wasn’t loaded, but didn’t really know what to look for next.
Weak areas for Codex
Codex can’t run across reboots, but it’s very easy to just ask it to write either a summary or next steps (or both!) to a file . After the reboot, you can follow the next steps or ask Codex to read the files and pick up where it left off.
Codex can’t run sudo commands because typing into the sudo prompt doesn’t seem to work. In any case, it’s probably a good idea not to let Codex run sudo (or run as root either), but I’m more than happy to run these commands in another terminal!
No web search means that Codex can’t autonomously find late-breaking bugs and solutions online. One workaround that I’ve done for other use cases is to run Deep Research in ChatGPT and then save the result into my code repo. Then, Codex can be instructed to read that documentation when it does its work.
One strong point, though, is that since Codex runs on the CLI, it can run even when your graphical environment is FUBAR’d. In fact, with a high resolution configured, the virtual console in Linux is actually a pretty comfortable environment to use Codex in!
P.S. I assume other similar AI tools can do this as well, I just haven’t tried them yet! The potent combination here is good model + good tools, and in this case, “good tools” is simply the ability to run commands on your actual machine.