aup-ai-tutorials icon indicating copy to clipboard operation
aup-ai-tutorials copied to clipboard

Broken ollama installation via `aup_setup()`, missing zstd package

Open degenerate-kun-69 opened this issue 4 months ago • 2 comments

Hi! I was trying to run ai-agents/01-chatbot.ipynb on AMD AI academy where cell 2, aup_setup() returns Command 'curl -fsSL https://ollama.com/install.sh | sh' returned non-zero exit status 1 after further investigating it via the terminal, it seems to require package zstd to extract, and attempting to install that package in the notebook environment got my account blocked, so i am unable to provide any logs. this seems more or so AMD cloud related, as the same notebook runs fine locally.

here are the errors I found:

added a try catch block to catch the exact error in cell 2

try:
    aup_setup()
except subprocess.CalledProcessError as e:
    print("Exit code:", e.returncode)
    print("STDOUT:")
    print(e.stdout)
    print("STDERR:")
    print(e.stderr)

resulting in output:

---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
Cell In[7], line 4
      2 try:
      3     aup_setup()
----> 4 except subprocess.CalledProcessError as e:
      5     print("Exit code:", e.returncode)

File [/workspace/aup_config.py:126](https://notebooks.amd.com/jupyter-user-260721114841-9871f5e2/lab/tree/aup_config.py#line=125), in aup_setup(zstd_install, vllm, graphviz_install)
    125 cmd = "curl -fsSL https://ollama.com/install.sh | sh"
--> 126 proc = run_capture(cmd, check=True, shell=True)
    127 logging.info("Ollama installed %s.", message_string(proc))

File [/workspace/aup_config.py:22](https://notebooks.amd.com/jupyter-user-260721114841-9871f5e2/lab/tree/aup_config.py#line=21), in run_capture(cmd, check, **kwargs)
     21 """Run subprocess while capturing stdout/stderr."""
---> 22 return subprocess.run(cmd, capture_output=True, text=True, check=check, **kwargs)

File [/usr/lib/python3.12/subprocess.py:571](https://notebooks.amd.com/usr/lib/python3.12/subprocess.py#line=570), in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    570     if check and retcode:
--> 571         raise CalledProcessError(retcode, process.args,
    572                                  output=stdout, stderr=stderr)
    573 return CompletedProcess(process.args, retcode, stdout, stderr)

CalledProcessError: Command 'curl -fsSL https://ollama.com/install.sh | sh' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

NameError                                 Traceback (most recent call last)
Cell In[7], line 4
      1 from aup_config import aup_setup
      2 try:
      3     aup_setup()
----> 4 except subprocess.CalledProcessError as e:
      5     print("Exit code:", e.returncode)
      6     print("STDOUT:")
      7     print(e.stdout)

NameError: name 'subprocess' is not defined

after importing subprocess module, the error changed to "missing package zstd required to install ollama", and attempting to install zstd in the notebook via sudo resulting in account block.

none of these errors happen locally, so I'm inclined to believe that the issue is related to the environment.

degenerate-kun-69 avatar Jul 21 '26 12:07 degenerate-kun-69

Hi @degenerate-kun-69,

This is fixed in PR #16. Please, use the Discord channel to request your account is unblocked. Next time you run the notebook it should work

mariodruiz avatar Jul 21 '26 12:07 mariodruiz

This was also happening in another notebook - ollama install was failing.

Appreciate the patch @mariodruiz - thanks for calling it out @degenerate-kun-69 !

BA-CalderonMorales avatar Jul 21 '26 13:07 BA-CalderonMorales