While working with Ollama on WSL, I noticed something interesting—and not in a good way. My CPU usage was spiking to nearly 95%, while my RTX 3050 GPU was just chilling at around 15%. Clearly, I wasn’t making the best use of my hardware.

Here’s what I learned about getting my GPU more involved:

Identifying the Issue with nvidia-smi

To investigate, I used the nvidia-smi command, which shows GPU usage and driver information. This revealed that I was running a beta version of the NVIDIA drivers, a few versions ahead of the stable one available for my Linux environment in WSL. No wonder things were out of whack!

Purging and Installing the Correct NVIDIA Drivers

To fix the problem, I purged all the existing NVIDIA drivers in my Linux environment with this command:

`sudo apt-get purge 'nvidia-*'`

Then, I installed the latest stable driver available for Linux, which was nvidia-driver-560 at the time:

`sudo apt install nvidia-driver-560`

Reboot and Test

After installing the correct driver, I restarted everything and launched a fresh session with Ollama. This time, I ran a LLaMA 3:8b model, asking it for a business plan for a startup tech company. As the model worked, I monitored my resource usage—and what a difference! My CPU usage dropped significantly, while my GPU was finally being utilized.

Now that my GPU was finally working as it should, I couldn’t help but wonder—what if I could find a way to efficiently balance the workload between the CPU and GPU? It could lead to even better performance, utilizing both hardware components to their fullest potential.

One key takeaway from this experience is the importance of ensuring that you’re running the most up-to-date drivers for your hardware, especially when dealing with resource-intensive tasks like running LLMs or AI models. Having outdated or incompatible drivers can seriously impact performance—just like my CPU bottleneck while my GPU was idle. By making sure your drivers are aligned with the packages and tasks you’re running, you can dramatically improve efficiency and get the most out of your system.