{"slug": "how-i-got-ollama-running-on-my-amd-radeon-rx-9060-xt-using-wsl-and-rocm", "title": "How I Got Ollama Running on My AMD Radeon RX 9060 XT Using WSL and ROCm", "summary": "A developer detailed how to run AI models locally on an AMD Radeon RX 9060 XT using Windows Subsystem for Linux (WSL) and ROCm. The setup involves installing Ollama with its ROCm backend, configuring it as a systemd service, and exposing the GPU via librocdxg. The guide highlights version-specific issues and provides step-by-step commands for a successful local AI environment.", "body_md": "I wanted to start experimenting with AI for a while.\n\nAt work, I didn't really have enough time to properly explore this new ecosystem and understand how these tools could be used. But I had another resource available: my personal hardware.\n\nI'm a gamer, so I have a reasonably powerful desktop PC. I'm also a developer, with a laptop running Ubuntu and a NAS.\n\nThat made me wonder:\n\nCan I use my gaming PC to run AI models locally?\n\nThe answer is **yes**.\n\nThis article is a small walkthrough of my experience setting up a local AI environment using an **AMD Radeon GPU**, **Windows**, **WSL**, **ROCm**, and **Ollama**.\n\nMy hardware is (yes, I'm Team Red):\n\nThe first step is to make sure that WSL is installed and up to date.\n\nThe general process is:\n\nFrom PowerShell:\n\n```\n# Check the current version of WSL\nwsl -v\n\n# Update WSL\nwsl --update\n\n# Install Ubuntu\nwsl --install -d Ubuntu\n\n# Start Ubuntu\nwsl -d Ubuntu\n\n# Stop Ubuntu\nwsl --terminate Ubuntu\n\n# Remove the Ubuntu distribution\nwsl --unregister Ubuntu\n```\n\nOnce Ubuntu is installed, update the system and install `zstd`\n\n.\n\nWe will need it later to extract Ollama.\n\n```\nsudo apt update\nsudo apt upgrade\nsudo apt autoclean\nsudo apt autoremove\n\nsudo apt install zstd\n```\n\nOllama is the foundation of this setup.\n\nIt allows us to download and run AI models locally while providing different compute backends, including CPU, CUDA, and ROCm.\n\nOne thing that wasn't immediately obvious to me was that Ollama provides a specific ROCm backend.\n\nThe installation is split into two parts:\n\n```\n# Install Ollama\ncurl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \\\n  | sudo tar --zstd -x -C /usr\n\n# Install the ROCm backend\ncurl -fsSL https://ollama.com/download/ollama-linux-amd64-rocm.tar.zst \\\n  | sudo tar --zstd -x -C /usr\n```\n\nThen create the Ollama user and add your current user to the Ollama group:\n\n```\n# Create the Ollama user and group\nsudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama\n\n# Add the current user to the Ollama group\nsudo usermod -a -G ollama $(whoami)\n```\n\nThe official documentation I used:\n\n[https://docs.ollama.com/linux#manual-install](https://docs.ollama.com/linux#manual-install)\n\n[https://docs.ollama.com/linux#amd-gpu-install](https://docs.ollama.com/linux#amd-gpu-install)\n\nI chose to run Ollama as a systemd service.\n\nCreate or edit the service configuration:\n\n```\nsudo nano /etc/systemd/system/ollama.service\n[Unit]\nDescription=Ollama Service\nAfter=network-online.target\n\n[Service]\nExecStart=/usr/local/bin/ollama serve\nUser=ollama\nGroup=ollama\nRestart=always\nRestartSec=3\nEnvironment=\"PATH=$PATH\"\n# Required to detect the GPU through DXG\nEnvironment=\"HSA_ENABLE_DXG_DETECTION=1\"\n# Optional: expose Ollama outside of WSL\nEnvironment=\"OLLAMA_HOST=0.0.0.0:11434\"\n\n[Install]\nWantedBy=default.target\n```\n\nThen reload systemd and start the service:\n\n```\nsudo systemctl daemon-reload\nsudo systemctl enable ollama\nsudo systemctl start ollama.service\n\nsudo systemctl status ollama.service\n```\n\nMore information about running Ollama as a service:\n\n[https://docs.ollama.com/linux#adding-ollama-as-a-startup-service-recommended](https://docs.ollama.com/linux#adding-ollama-as-a-startup-service-recommended)\n\nThe GPU needs to be exposed to the WSL environment.\n\nFor my setup, I used `librocdxg`\n\n.\n\nOne important detail: version **1.2.2** solved an issue I encountered with version **1.2.0**.\n\nSo, if you're having issues with GPU detection, the version may matter.\n\n```\nwget https://github.com/ROCm/librocdxg/releases/download/v1.2.2/rocdxg-roct_1.2.2_amd64.deb\n\nsudo apt install ./rocdxg-roct_1.2.2_amd64.deb\n```\n\nMore information about the project:\n\n[https://github.com/ROCm/librocdxg](https://github.com/ROCm/librocdxg)\n\nAt this point, everything should be configured.\n\nRestart Ollama:\n\n```\nsudo systemctl restart ollama.service\n```\n\nThen check the Ollama logs:\n\n```\nsudo journalctl -u ollama --no-pager -o cat | grep \"inference compute\"\n```\n\nYou should see something similar to:\n\n```\nlibrary=ROCm compute=gfxXXXX description=\"[NAME_OF_YOUR_GPU]\"\n```\n\nThe important part is:\n\n```\nlibrary=ROCm\n```\n\nYou don't want Ollama to silently fall back to CPU inference.\n\nIn my case, I get:\n\n```\ntime=2026-08-28T12:38:20.900+02:00 level=INFO source=types.go:32 msg=\"inference compute\" id=0 filter_id=0 library=ROCm compute=gfx1200 name=ROCm0 description=\"AMD Radeon RX 9060 XT\" libdirs=ollama,rocm_v7_2 driver=0.0 pci_id=0000:2b:00.0 type=discrete total=\"15.9 GiB\" available=\"14.2 GiB\"\n```\n\nAs you can see, Ollama detects:\n\n`gfx1200`\n\n.AMD provides a compatibility matrix to identify which `gfx`\n\nversion corresponds to your GPU:\n\nI also found references suggesting that it may be possible to enable support for some older `gfx`\n\nversions, but I didn't need to do this for my setup.\n\nTime for the interesting part.\n\nDownload and run a model:\n\n```\nollama run qwen3:8b\n```\n\nAsk the model something and let it generate a response.\n\nYou can exit the interactive session with:\n\n```\n/bye\n```\n\nYou can then check where the model is running:\n\n```\nollama ps\n```\n\nThe output should indicate that the model is running on the GPU.\n\n```\nNAME        ID              SIZE      PROCESSOR\nqwen3:8b    xxxxxxxxxxxx    5.2 GB    100% GPU\n```\n\nYou can also open the **Windows Task Manager** and monitor your GPU usage.\n\nOnce the model starts running, you should see:\n\nBy default, your Ollama instance is running inside WSL.\n\nIf you want to access it from other machines on your local network, you need to expose the port through Windows.\n\nOn the Windows host, open PowerShell as Administrator.\n\nFirst, create a firewall rule:\n\n```\nNew-NetFirewallRule `\n  -DisplayName \"Ollama WSL LAN\" `\n  -Direction Inbound `\n  -Protocol TCP `\n  -LocalPort 11434 `\n  -Action Allow `\n  -RemoteAddress [IP_BASE_TO_LISTEN]/24\n```\n\nThen forward the port between Windows and WSL:\n\n```\nnetsh interface portproxy add v4tov4 `\n  listenaddress=[IP_HOST_WSL] `\n  listenport=11434 `\n  connectaddress=[IP_UBUNTU_IMAGE] `\n  connectport=11434\n```\n\nFrom another computer on your local network, you can test the Ollama API with:\n\n```\ncurl.exe http://[IP_OF_OLLAMA_HOST]:11434/api/tags\n```\n\nIf everything is configured correctly, Ollama should respond with the list of installed models.\n\nBy default, WSL may stop after some time when no active terminal is connected.\n\nTo keep the WSL environment alive, create a `.wslconfig`\n\nfile in your Windows user profile directory.\n\nAdd:\n\n```\n[general]\ninstanceIdleTimeout=-1\n```\n\nAfter modifying the configuration, restart the WSL distribution so the configuration is taken into account\n\nNow once you started the image you will need to kill it manually.\n\n```\nwsl --terminate Ubuntu\n```\n\nI encountered one additional issue.\n\nAfter restarting my PC, I could start the WSL distribution, but Ollama was no longer accessible from the local network.\n\nIn my case, restarting the Windows `iphlpsvc`\n\nservice solved the problem.\n\nOpen PowerShell as Administrator:\n\n```\nRestart-Service iphlpsvc -Force\n```\n\nAfter that, Ollama became accessible again.\n\nThis setup allowed me to turn my gaming PC into a local AI machine without replacing Windows or dedicating the entire computer to Linux.\n\nThe combination of:\n\nprovides a relatively convenient environment for experimenting with local AI models.\n\nThe most important part of the setup, in my experience, was making sure that Ollama was actually using the ROCm backend and the GPU.\n\nOnce that was working, running a model such as `qwen3:8b`\n\nwas straightforward.\n\nHopefully, this will save some time for other AMD GPU users who want to experiment with local AI on Windows.", "url": "https://wpnews.pro/news/how-i-got-ollama-running-on-my-amd-radeon-rx-9060-xt-using-wsl-and-rocm", "canonical_source": "https://dev.to/gaetan_faverge_7350777e07/how-i-got-ollama-running-on-my-amd-radeon-rx-9060-xt-using-wsl-and-rocm-2ki5", "published_at": "2026-08-28 12:22:44+00:00", "updated_at": "2026-08-28 12:50:34.834920+00:00", "lang": "en", "topics": ["developer-tools", "ai-infrastructure"], "entities": ["Ollama", "AMD", "ROCm", "WSL", "Radeon RX 9060 XT", "librocdxg"], "alternates": {"html": "https://wpnews.pro/news/how-i-got-ollama-running-on-my-amd-radeon-rx-9060-xt-using-wsl-and-rocm", "markdown": "https://wpnews.pro/news/how-i-got-ollama-running-on-my-amd-radeon-rx-9060-xt-using-wsl-and-rocm.md", "text": "https://wpnews.pro/news/how-i-got-ollama-running-on-my-amd-radeon-rx-9060-xt-using-wsl-and-rocm.txt", "jsonld": "https://wpnews.pro/news/how-i-got-ollama-running-on-my-amd-radeon-rx-9060-xt-using-wsl-and-rocm.jsonld"}}