From 1b596bd8940bbdfbfcf9f90960851da0dd19d46f Mon Sep 17 00:00:00 2001 From: rain Date: Mon, 22 Jun 2026 19:16:31 -0400 Subject: [PATCH] Add /opt/rocm/bin to PATH in zshrc when it exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ROCm installs to /opt/rocm (not /opt/rocm-X.Y versioning). The upstream /etc/profile.d/rocm.sh tries to add /opt/rocm/bin to PATH but uses 'append_path' which is a fish-shell function, not a bash/zsh built-in — so on a zsh login the export is a no-op and the rocm tools (amd-smi, rocm-smi, rocminfo, hipcc, etc.) are unreachable without explicit PATH setup. Add /opt/rocm/bin to the top of the path array in dot_zshrc.tmpl when the directory exists on the host. Use stat() with the not-(not-...) bool coercion (pitfall #35 in the chezmoi-bootstrap- runbook skill) to avoid rendering the stat map's string repr. Conditional on the directory existing so Pis (no ROCm) don't get a dead PATH entry. Verified on miche: PATH=/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/bin/site_perl: /usr/bin/vendor_perl:/usr/bin/core_perl:/opt/rocm/bin /opt/rocm/bin/amd-smi /opt/rocm/bin/rocm-smi /opt/rocm/bin/rocminfo amd-smi version: AMDSMI Tool: 26.4.0+3309c6114a | ROCm version: 7.13.0 --- dot_zshrc.tmpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index d5ae4bf..55b3ed8 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -90,6 +90,9 @@ export TMUX_PLUGIN_MANAGER_PATH=~/.tmux/plugins/tpm # --------------------------------------------------------------------------- typeset -U path path=( + {{- if not (not (stat "/opt/rocm/bin")) }} + /opt/rocm/bin # ROCm tools first (rocminfo, rocm-smi, amd-smi, hipcc, etc.) + {{- end }} $HOME/.local/bin $HOME/.bin $path