[GH-ISSUE #13558] Install script fails to install GPU module on WSL2 #8929

Open
opened 2026-04-12 21:44:48 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @andy-b-84 on GitHub (Dec 24, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/13558

What is the issue?

I've been trying to run the script you provide on the READLE.md file, which I had to run line by line since I'm behind a company VPN, now I have the frontend and ollama's service running on my WSL2 machine.

So far so good.

Now I would like to use the RTX 500 Ada GPU on my machine : to do that I guess I need the NVidia driver.

So the script tries to install the linux-headers package : sadly, this one isn't available for an Ubuntu WSL2 OS : I need to compile it by hand (which I'm doing right now).
Could this part, or some workaround, be coded in the install script?

I'm following this Stack Overflow post to do so : https://stackoverflow.com/questions/79295182/how-to-get-wsl2-kernel-headers :

sudo apt install build-essential flex bc libelf-dev pahole;
git clone 'https://github.com/microsoft/WSL2-Linux-Kernel.git' --single-branch --depth 1 --recurse-submodules;
cd WSL2-Linux-Kernel;
make KCONFIG_CONFIG=Microsoft/config-wsl -j$(nproc);
sudo make modules_install;
sudo make install;
sudo cp /boot/vmlinuz-6.6.36.6-microsoft-standard-WSL2+ /mnt/c/Users/<YourUsername>/vmlinuz-6.6.36.6-microsoft-standard-WSL2+;
printf '[wsl2]\nkernel=C:\\\\Users\\\\<YourUsername>\\\\vmlinuz-6.6.36.6-microsoft-standard-WSL2+\n' | sudo tee --append /mnt/c/Users/<YourUsername>/.wslconfig
sudo reboot now;

(the git clone part I had to run from a Powershell window since my VPN rewrites SSL certificates)

Relevant log output

$ sudo apt install linux-headers-$KERNEL_RELEASE

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-headers-5.15.146.1-microsoft-standard-WSL2
E: Couldn't find any package by glob 'linux-headers-5.15.146.1-microsoft-standard-WSL2'

OS

WSL2

GPU

Nvidia

CPU

Intel

Ollama version

0.13.5

Originally created by @andy-b-84 on GitHub (Dec 24, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/13558 ### What is the issue? I've been trying to run the script you provide on the `READLE.md` file, which I had to run line by line since I'm behind a company VPN, now I have the frontend and ollama's service running on my WSL2 machine. So far so good. Now I would like to use the RTX 500 Ada GPU on my machine : to do that I guess I need the NVidia driver. So the script tries to install the linux-headers package : sadly, this one isn't available for an Ubuntu WSL2 OS : I need to compile it by hand (which I'm doing right now). Could this part, or some workaround, be coded in the install script? I'm following this Stack Overflow post to do so : https://stackoverflow.com/questions/79295182/how-to-get-wsl2-kernel-headers : ``` sudo apt install build-essential flex bc libelf-dev pahole; git clone 'https://github.com/microsoft/WSL2-Linux-Kernel.git' --single-branch --depth 1 --recurse-submodules; cd WSL2-Linux-Kernel; make KCONFIG_CONFIG=Microsoft/config-wsl -j$(nproc); sudo make modules_install; sudo make install; sudo cp /boot/vmlinuz-6.6.36.6-microsoft-standard-WSL2+ /mnt/c/Users/<YourUsername>/vmlinuz-6.6.36.6-microsoft-standard-WSL2+; printf '[wsl2]\nkernel=C:\\\\Users\\\\<YourUsername>\\\\vmlinuz-6.6.36.6-microsoft-standard-WSL2+\n' | sudo tee --append /mnt/c/Users/<YourUsername>/.wslconfig sudo reboot now; ``` (the git clone part I had to run from a Powershell window since my VPN rewrites SSL certificates) ### Relevant log output ```shell $ sudo apt install linux-headers-$KERNEL_RELEASE Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package linux-headers-5.15.146.1-microsoft-standard-WSL2 E: Couldn't find any package by glob 'linux-headers-5.15.146.1-microsoft-standard-WSL2' ``` ### OS WSL2 ### GPU Nvidia ### CPU Intel ### Ollama version 0.13.5
GiteaMirror added the bug label 2026-04-12 21:44:48 -05:00
Author
Owner

@rick-github commented on GitHub (Dec 24, 2025):

Why not run windows native ollama?

<!-- gh-comment-id:3689837398 --> @rick-github commented on GitHub (Dec 24, 2025): Why not run windows native ollama?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#8929