top of page

Installing Linux for Local AI on a MINISFORUM MS-S1 AI Ryzen Max+ 395 with 128 GB Memory

5 days ago
14 min read

Why I chose MS-S1 Max Ryzen over the DGX Spark

The Minisforum MS-S1 Max Ryzen AI Max+ 395 with 128 GB of shared memory came in at roughly half the price of the DGX Spark I was looking at. Both had the memory capacity I wanted. The Spark has a fair edge for CUDA work, and model speed depends on whats run and how it runs.


For the tasks I've planned, the Ryzen made more sense. It runs Linux and Windows, and I can turn it into a Windows Hyper-V host later if I need one. Can't do that with the DGX.


It came down to cost, flexibility and what I felt I was getting for the money. £6,299 for a DGX Spark? I don’t think so.


My Planned Projects

I wanted a local AI box for development, documentation and security research, without paying per token. My Jetson Nano runs the Security Monitoring station, somewhere in the region of 11 million processed and assessed events and a project that one day may hit GitHub. But it struggles with researching the basic task it's set, Windows Events and severity, too slow, not enough RAM.


I’d also like to give the local LLM access to my collection of working PowerShell scripts, so it can follow my style and reuse existing functions. Anything that saves me writing the same thing again is welcome.


Beyond that, scripts, APIs and Home Assistant open up Windows and Linux checks, camera image analysis, heating controls and other smart devices. Plenty to play with once the basics are working.


Finally, I want AI controlled drones to patrol my home at night armed with "lasers", now who doesn't want that.


How much memory does a model need?

An 8B model has roughly eight billion parameters. For a quick estimate of the weight size, multiply the parameter count by the bits per weight and divide by eight, (parameters × bits per weight ÷ 8) That gives you bytes. The table uses decimal GB.

Model

FP16

8-bit

Nominal 4-bit

8B

16 GB

8 GB

4 GB

32B

64 GB

32 GB

16 GB

70B

140 GB

70 GB

35 GB

120B

240 GB

120 GB

60 GB

These figures cover the weights alone. A Q4_K_M file can average around 4.8 bits per weight, roughly 20% above the nominal 4-bit figure. That puts a 70B model around 42 GB and a 120B model around 72 GB. Check the actual download size for the model you’re looking at.


The Q4_K_M figures: 70B × 4.8 ÷ 8 = 42 GB, and 120B × 4.8 ÷ 8 = 72 GB


The runner also needs working buffers and a KV cache that grows with context. A model that runs fine with a short prompt can still run out of room when I feed it a large PowerShell repository. I’ll start with 4-bit and try higher precision if the results warrant it.


Mixture of experts models change the speed calculation. If I want the whole model resident on the GPU, I still have to fit all its weights. Each token uses only a subset of the experts, so generation can be faster than with a dense model of the same total size.


What 128 GB of shared memory gives me

The CPU and Radeon GPU draw from the same 128 GB pool. I’m targeting a 96 GiB limit for dynamic GPU allocations through Linux’s ttm.pages_limit. That’s about 103 GB in the units used in the table.


The limit is a ceiling. Ubuntu can use the memory while the GPU leaves it free. If a model and its cache push GPU usage close to 96 GiB, I’ve got roughly 32 GiB left for Ubuntu and everything else, before firmware and system overhead. The BIOS UMA carve-out is a separate, fixed reservation. I’ll check the effective GPU limit after reboot and leave some headroom when sizing models.


So a 120B model at 72 GB fits comfortably under the 96 GiB limit with room for KV cache.


Install Ubuntu on the Minisforum Ryzen AI Max+ 395

You’ll need a 16 GB or larger USB stick. You need to know which USB to buy based on pure speed, check out this blog.


1. Download Ubuntu and Rufus

  • Download the latest Ubuntu Desktop x64, at the time of writing its 26.10, I favour the LTS with 5 years of support. I'll be using Ubuntu 26.04 LTS.

  • Make a note of the release name, in my case its 'Resolute Raccoon', this will be required for ROCm later on.

  • Download Rufus and open it in Windows.


2. Make the bootable USB

  • The MS-S1 Max comes with Windows 11 Pro, so all the prep will be completed on the system.

  • Plug in the USB stick.

  • After downloading and installing Rufus, select the drop down under Device.

  • Click SELECT and open the Ubuntu .iso you downloaded.

  • Set Partition scheme to GPT and Target system to UEFI.

  • Leave the other settings at their defaults.

  • Click START. If Rufus asks which write mode to use, choose ISO Image mode. Confirm the erase and wait for READY.


3. Boot from the USB

  • Leave the USB plugged in and restart the MS-S1 Max.

  • Restart and repeatedly press 'Del' to enter the Setup menu.

  • Select Boot, set Boot Option #1 the USB Device: UEFI: entry for the USB stick.

  • Save and Exit, MS-S1 Max will reboot and launch the Ubuntu GNR GRUB menu.

  • Select Try or Install Ubuntu.

  • When the installer opens, select Install Ubuntu.


4. Replace Windows with Ubuntu

  • Choose your language, keyboard layout and network. Use Ethernet if it’s plugged in.

  • Choose Interactive installation, then Default selection.

  • At Disk setup, choose Erase disk and install Ubuntu.

  • Create your username and password, choose your time zone and let the installation finish.

  • Click Restart Now. Remove the USB stick when prompted and press Enter.


5. Update Ubuntu

Log in, open Terminal with Ctrl+Alt+T, and run:

sudo apt update && sudo apt upgrade -y
sudo reboot

Once it boots back to the Ubuntu desktop from the internal drive, the Linux installation is done. Ubuntu already includes the AMD graphics driver. ROCm and model setup come afterwards.


Follow the minimum-reservation route here.


Remote SSH Access

For ease of use remote ssh will be enabled.

sudo apt install -y openssh-server
sudo systemctl enable --now ssh

Check the status

sudo systemctl status ssh

Check the firewall, but this shouldn't be neccessary, if it is, then lock it down to the client or server that will launch the remote shell from.

sudo ufw status
sudo ufw allow from 192.168.45.100 to any port 22 proto tcp

Update Ubuntu

Update packages and install the basic tools:

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget git nano pciutils linux-firmware pipx

Check the running kernel and graphics driver:

uname -r
lspci -k
free -h

The Radeon device should use amdgpu.

lspci -k | grep Radeon

Install ROCm

ROCm is AMD’s software platform for GPU computing, broadly serving the same role as NVIDIA’s CUDA.


It lets compatible AI software use your Radeon 8060S GPU to run models. Ubuntu’s AMD graphics driver handles access to the hardware, while ROCm provides the compute libraries and tools the AI software needs.


Install AMD’s versioned installer and ROCm userspace stack:

wget https://repo.radeon.com/amdgpu-install/latest/ubuntu/resolute/amdgpu-install_31.60.316000-1_all.deb
sudo apt install ./amdgpu-install_31.60.316000-1_all.deb
sudo amdgpu-install -y --usecase=rocm --no-dkms
sudo usermod -aG render,video "$USER"
sudo reboot

Verify GPU discovery:

/opt/rocm/bin/rocminfo

Look for a GPU agent identifying gfx1151.

Name:                    gfx1151
  Uuid:                    GPU-XX
  Marketing Name:          AMD Radeon 8060S Graphics
  Vendor Name:             AMD
  Feature:                 KERNEL_DISPATCH
  Profile:                 BASE_PROFILE
  Float Round Mode:        NEAR
  Max Queue Number:        128(0x80)
  Queue Min Size:          64(0x40)
  Queue Max Size:          131072(0x20000)
  Queue Type:              MULTI
  Node:                    1
  Device Type:             GPU
  Cache Info:
    L1:                      32(0x20) KB
    L2:                      2048(0x800) KB
    L3:                      32768(0x8000) KB

Enable 96 GiB for AI

Install AMD’s memory configuration helper:

pipx ensurepath
pipx install amd-debug-tools

Query the current limit, then set 96 GiB:

"$HOME/.local/bin/amd-ttm"
"$HOME/.local/bin/amd-ttm" --set 96

Complete any privilege prompt and then reboot at the prompt.


After the reboot verify the effective setting:

"$HOME/.local/bin/amd-ttm"

💻 Current TTM pages limit: 25165824 pages (96.00 GB)
💻 Total system memory: 121.21 GB

cat /sys/module/ttm/parameters/pages_limit
getconf PAGESIZE

With 4096-byte pages, 96 GiB corresponds to 25,165,824 pages.


The helper labels its binary memory units “GB”.


To restore the kernel default later:

"$HOME/.local/bin/amd-ttm" --clear

Reboot after clearing the setting.


These ROCm and memory steps follow AMD’s Ryzen installation guide.


Install Ollama

Download and inspect the installer, then run it:

curl -fsSL https://ollama.com/install.sh -o /tmp/ollama-install.sh

sh /tmp/ollama-install.sh
sudo usermod -aG render,video ollama

Create a service override:

sudo systemctl edit ollama

Add these settings:

[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
Environment="OLLAMA_NUM_PARALLEL=1"
Environment="OLLAMA_MAX_LOADED_MODELS=1"

Environment="OLLAMA_HOST=0.0.0.0:11434"- makes Ollama available to other hosts.

Environment="OLLAMA_HOST=127.0.0.1:11434"- accessible to the local host only.

For a later post, Nginx will be used to provide network access over HTTPS. For now, lets keep it simple.


OLLAMA_NUM_PARALLEL=1, processes one request at a time per loaded model.

2 or 4 allows concurrent requests, increasing memory use and sharing compute capacity.


OLLAMA_MAX_LOADED_MODELS=1, keeps at most one model loaded at a time, leaving more memory for that model.

2 allows two models to remain loaded if memory permits, reducing reloads when switching.


Start the service and check it:

sudo systemctl daemon-reload
sudo systemctl enable --now ollama
sudo systemctl restart ollama
systemctl status ollama --no-pager
ollama --version
curl http://127.0.0.1:11434/api/tags

Open a browser and connect to:

{"models":[]}

Ollama is running


If the firewall is enabled add the following rule.

sudo ufw allow from 192.168.0.0/16 to any port 11434 proto tcp

Choosing models

Models can be downloaded from Ollama’s model library or Hugging Face.


Ollama offers ready-to-run packages, while Hugging Face has a wider selection of models and quantisations. Compatible Hugging Face GGUF models can also run directly through Ollama using ollama run hf.co/<user>/<repo>.


Choose by the job, coding, general questions, reasoning or image generation, then check compatibility with your runner and available RAM or VRAM.


Quantisation reduces memory use, while Mixture-of-Experts (MoE) models process fewer parameters per token but still need room for all the weights when fully loaded. Leave space for context and working memory, then compare a few models on your own tasks.


Coding and PowerShell

I’ve download these coding models to compare how they handle PowerShell, the results will be covered later in this article.

Model

Ollama model name

Approx. download

Suggested use

Qwen3 Coder 30B

qwen3-coder:30b

19 GB

Routine PowerShell development and function generation.

Qwen3-Coder-Next 80B

qwen3-coder-next:q4_K_M

52 GB

Larger coding specialist for working across a script collection.

Qwen3-Coder-Next 80B, Q8

qwen3-coder-next:q8_0

85 GB

Higher precision to compare against the 52 GB version.

Devstral 2 123B

devstral-2:123b

75 GB

Changes spanning multiple files, slower but useful as a quality reference.

Qwen3.6 35B-A3B

qwen3.6:35b

23–24 GB

Coding, script reviews and general technical work.

GPT-OSS 120B

gpt-oss:120b

65 GB

Larger reasoning model for script reviews and security analysis.

Nemotron 3 Super 120B

nemotron-3-super:120b

87 GB

Larger reasoning comparison for complex technical questions.

Qwen3 30B-A3B Instruct 2507

qwen3:30b-a3b-instruct-2507-q4_K_M

19 GB

General questions, documentation and technical explanations.

Gemma 4 26B-A4B

gemma4:26b-a4b-it-q4_K_M

18 GB

Alternative model family for general work and image interpretation.

Qwen3.5 122B-A10B

qwen3.5:122b

81 GB

Larger general-purpose model for reasoning and technical research.

GLM-4.7-Flash

glm-4.7-flash:q4_K_M

19 GB

Compact alternative for coding and script reviews.

To download all models, run this, grab a coffee, its gonna take awhile.

ollama pull qwen3-coder:30b
ollama pull qwen3-coder-next:q4_K_M
ollama pull qwen3-coder-next:q8_0
ollama pull devstral-2:123b
ollama pull qwen3.6:35b
ollama pull gpt-oss:120b
ollama pull nemotron-3-super:120b
ollama pull qwen3:30b-a3b-instruct-2507-q4_K_M
ollama pull gemma4:26b-a4b-it-q4_K_M
ollama pull qwen3.5:122b
ollama pull glm-4.7-flash:q4_K_M

General-purpose, documentation and research

These models also cover everyday questions, writing and document summaries. Some appear in the PowerShell tests below, but I haven’t compared their general purpose answers here.

Model

Ollama model name

Approx. download

Suggested use

GPT-OSS 20B

gpt-oss:20b

14 GB

Everyday questions, writing emails, explaining topics and planning activities.

Qwen3.8 27B

qwen3.8:27b

18 GB

General chat, rewriting text, summarising documents and explaining pictures.

Gemma 4 26B-A4B

gemma4:26b-a4b-it-q4_K_M

18 GB

Creative writing, brainstorming, learning and asking questions about images.

GPT-OSS 120B

gpt-oss:120b

65 GB

More demanding questions, detailed explanations and comparing complicated choices.

Qwen3.5 122B

qwen3.5:122b

81 GB

Longer documents, detailed discussions and questions involving text and images.

Nemotron 3.5 Super 120B

nemotron-3.5-super:120b-a12b-q4_K_M

90 GB

An optional larger model for detailed answers and understanding documents or pictures.

Download the initial models:

ollama pull qwen3-coder:30b

Start the coding model:

ollama run qwen3-coder:30b

Perform a quick test and write a generic prompt.


To exit the prompt:

/bye

Access Ollama via a Browser

Ollama runs the model, but a separate browser will be required, install Open WebUI.


1. Install Docker:

sudo apt update
sudo apt install -y docker.io
sudo systemctl enable --now docker

2. Start Open WebUI:

  • “Unable to find image locally” is normal on the first run. Docker will download it.

sudo docker run -d \
    --network=host \
    -e OLLAMA_BASE_URL=http://127.0.0.1:11434 \
    -v open-webui:/app/backend/data \
    --name open-webui \
    --restart unless-stopped \
    ghcr.io/open-webui/open-webui:main

This configuration connects to your existing Ollama service and provides the browser interface on port 8080.


3. Allow browser access through UFW:

sudo ufw allow from 192.168.0.0/16 to any port 8080 proto tcp

4. Open your browser:

http://<IP>:8080

Create an account, the first account becomes the administrator, then select the downloaded model from the model menu.


The first startup can take a few minutes. Check progress with:

sudo docker logs --tail 50 -f open-webui

Press Ctrl+C to stop viewing logs.


While it is loaded, check GPU use from another terminal:

ollama ps
sudo journalctl -u ollama -n 100 --no-pager

PowerShell, First Results

My first attempt via the WebUI using the smallest model, Qwen3 Coder 30B to produce a PowerShell script, was.... sub-optimal to say the least. Apparently, line breaks and indentation are paid extras, every comment, command and function presented as one magnificent blob of text, easier to write the script myself.



The 2nd model tested, again via the WebUI was Devstral 2 123B, produced a correctly formatted PowerShell script from the same straightforward request, we'll cover the performance in a moment:

Create a PowerShell script that audits Windows host, CPU, memory and disk information, then samples current performance counters for 20 seconds.


Apparently, Qwen3 Coder 30B needed something closer to a written specification:

Write a complete Windows audit script for Windows PowerShell 5.1, running in PowerShell ISE.

Return ONLY one fenced PowerShell code block. Preserve actual line breaks and indentation. Do not create a document, call tools, return JSON or execute anything.

Requirements:

  • Display Windows version, build, manufacturer, model and BIOS serial number.

  • Display CPU name, physical core count and logical processor count.

  • Display total and available physical memory in GB.

  • Display each local fixed disk’s capacity, free space and free percentage.

  • Collect performance counters using one Get-Counter invocation with -SampleInterval 2 -MaxSamples 10, approximately 20 seconds.

  • Collect CPU utilisation, available memory and disk read/write latency.

  • Display timestamped samples and a final average summary.

  • Handle counter collection failures without falsely reporting success.

  • Treat zero as a valid measurement.

  • Account for computer-prefixed, case-insensitive counter paths.

  • Put comments on separate lines.

  • Use ${variable} when a variable is immediately followed by a colon.


You can put the recurring instructions into an Ollama model profile, including your preferred formatting, PowerShell version and generation parameters.


Saveing repeating the same requirements in every request and should help produce more consistent results, although my testing showed it was, hit and miss.


Testing System Performance

Finding out whether the GPU is doing the work, how much memory is being used and how long the answer takes is rather more useful. A model producing three tokens a second might be brilliant, Devstral, but I’d quite like the answer before retirement.


Check CPU and memory usage

htop provides a live view of CPU activity, memory, swap and running processes. Install it on Ubuntu:

sudo apt install -y htop

Then run:

htop

Watch CPU activity, available memory and swap use while generating a response. High memory usage alone isn’t a problem, loading a large model is supposed to use memory. Sustained swapping alongside poor responsiveness may require further investigation.


htop doesn’t show AMD GPU utilisation, so that needs a separate check. Press Q to exit htop.

Check GPU utilisation


In another terminal or SSH session, run:

amd-smi monitor -u -w 1

If the command isn’t on your PATH, try:

/opt/rocm/bin/amd-smi monitor -u

This displays GPU utilisation and clock speed. Some readings may be unavailable on the Ryzen’s integrated GPU. Press Ctrl+C to stop monitoring.


Also check where Ollama has loaded the model:

watch -n 1 ollama ps

The PROCESSOR column shows whether it is using the CPU, GPU or a mixture. 100% GPU means the model is fully offloaded to the GPU.


Testing Model Performance

Now the fun stuff, I don't get out much, and this is as much fun as I'm allowed by the "MANAGEMENT".


Before each test, I checked ollama ps and unloaded any models with ollama stop <model-name>. This freed the memory and prevented a model gaining an advantage by already being loaded.

ollama ps
ollama stop qwen3-coder:30b

Run the model with --verbose.


The command and prompt

This command runs the selected model, the prompt and the finally outputs the token performance.

ollama run qwen3-coder:30b --verbose \
    "Create a Windows PowerShell 5.1 script that displays host, CPU, memory and disk information."
ollama run qwen3-coder-next:q4_K_M --verbose \    "Create a Windows PowerShell 5.1 script that displays host, CPU, memory and disk information."


The Results

Each model received the same prompt once. ChatGPT reviewed the final scripts and scored them out of 10 for correctness, completeness, PowerShell 5.1 compatibility, error handling and readability.

Rank

Model

Quality

Total time

Load time

Input tokens

Output tokens

Generation tokens/s

1=

Gemma 4 26B-A4B Q4_K_M

8

58.44 s

7.96 s

36

2,589

51.42

1=

GPT-OSS 120B

8

97.14 s

19.52 s

88

2,704

35.01

3=

Qwen3-Coder-Next 80B Q4_K_M

7

75.63 s

42.64 s

28

1,655

50.55

3=

Qwen3.5 122B

7

98.56 s

24.01 s

30

2,063

27.78

5=

Qwen3-Coder-Next 80B Q8_0

6

98.75 s

53.25 s

28

1,696

37.44

5=

Devstral 2 123B

6

553.77 s

78.57 s

528

1,404

2.99

7

Qwen3.6 35B

5

77.68 s

10.98 s

30

5,336

80.39

8=

Qwen3 30B-A3B Instruct 2507 Q4_K_M

4

35.59 s

7.69 s

28

2,013

72.46

8=

Qwen3-Coder 30B

4

38.27 s

12.49 s

28

1,708

66.61

8=

Nemotron 3 Super 120B

4

125.56 s

24.29 s

37

2,237

22.19

11

GLM-4.7-Flash Q4_K_M

2

80.92 s

7.18 s

25

3,913

53.15

Why they received those scores

Model

Main findings

Gemma 4

Correct core queries, RAM conversions and readable output. Disk bar shows free space but is labelled usage. Incomplete error handling and no zero-capacity protection.

GPT-OSS 120B

Correct main calculations and good organisation. Reports the user’s domain rather than necessarily the computer’s domain, selects only one CPU, and incorrectly advertises structured export from already formatted output.

Coder-Next Q4

Good coverage, correct uptime and useful disk details. RAM usage incorrectly reads free memory from the computer-system class, producing 100% usage. Suppresses query errors.

Qwen3.5 122B

Correct main queries, uptime and multi-CPU handling. Invents misleading memory-pressure thresholds and calls disk-capacity status “health”. Mandatory keypress limits automation and ISE use.

Coder-Next Q8

Useful hardware and memory-module details. Labels physical cores as logical cores, suppresses errors and unnecessarily retrieves the Windows product key.

Devstral 2

Correct RAM percentage and reasonable coverage. Incorrect WMI date handling, boot time labelled uptime, and memory values labelled MB when they represent GiB.

Qwen3.6

Correct main RAM conversions, but broken uptime syntax, incorrect cache units, faulty memory-type lookup and an invalid logged-on-user property.

Qwen3 Instruct 2507

Good hardware coverage, but "Drive $driveLetter:" introduces a blocking parsing error. Also mishandles WMI dates and number formatting.

Qwen3-Coder 30B

Readable, but incorrect host properties, memory units, RAM percentage, virtual-memory source and uptime handling.

Nemotron 3 Super

Correct main memory conversions, but an unquoted property name containing % causes a parsing error. Wrong objects supply OS name and boot time.

GLM-4.7-Flash

Extensive incorrect properties mean CPU and RAM results cannot be trusted. Also contains an invalid multi-pair -replace expression and reports only C:.

What the performance figures show

Gemma was the most useful result for this particular task. It matched GPT-OSS’s quality score while finishing 38.70 seconds sooner.


Qwen3.6 had the highest generation rate, but generated 5,336 tokens, including extensive thinking. It still took 77.68 seconds and delivered a faulty script. Tokens per second measures output speed, not useful work completed.


Coder-Next Q8 did not justify its extra cost here. Compared with Q4, generation was approximately 26% slower, loading took longer, and its script scored lower. One response does not establish that Q8 is generally worse.


Devstral was the clear performance outlier. Its response took 9 minutes 14 seconds, without a corresponding quality advantage. GPT-OSS generated tokens approximately 11.7 times faster.


Whats Next....

Next, more model testing, then loading my PowerShell and Bash scripts. Yes, I do write the odd Bash script for Linux, Nmap and Metasploit. I’m not just a Windows monkey, I like to do real work once in a while. I’ll add some documentation for reference too. Hopefully, I can then ask the LLM to use my existing functions and build around what already works, rather than invent another way of writing a log file.


Useful Commands Reference

Download a model:

ollama pull qwen3-coder:30b

Start model:

ollama run qwen3-coder:30b

To delete a downloaded model from disk, use its exact name:

ollama rm qwen3-coder:30b

To unload it from memory while keeping the download:

ollama stop qwen3-coder:30b

List all downloaded models:

ollama list

Which models are loaded in memory

ollama ps

Show model details, including architecture and quantisation:

ollama show qwen3-coder:30b

Show the model’s configured parameters:

ollama show qwen3-coder:30b --parameters

Run a prompt and show token counts, generation speed and timings:

ollama run qwen3-coder:30b --verbose "Create a Windows PowerShell 5.1 script that displays host, CPU, memory and disk inform

Save the answer and performance statistics to a text file:

ollama run qwen3-coder:30b --verbose "Explain what this model is designed for." > model-test.txt 2>&1

Read a saved prompt and save the results:

ollama run qwen3-coder:30b --verbose < prompt.txt > model-test.txt 2>&1

Continuously display loaded models and CPU/GPU allocation:

watch -n 1 ollama ps

Monitor AMD GPU utilisation every second, in a separate terminal:

amd-smi monitor -u -w 1

Include GPU memory, power and temperature where supported:

amd-smi monitor -u -m -p -t -w 1

Monitor CPU, RAM and running processes:

htop

If it is not installed:

sudo apt install htop

Display system memory and swap usage:

free -h

Check for swapping during a test:

vmstat 1



 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page