Every once in a while Dylan breaks rank here at Cape RADD, forgetting that this program is about marine biology and not computer science. But hear me out, this gets relevant.

WSL2? WTF2?

WTF is WSL?

Sometime during the haze of lockdown Microsoft announced that an upcoming Insider Preview of Windows 10 would include GPU compute for WSL2! For the uninitiated, WSL2 is a Linux container that allows Windows 10 users to run a Linux operating system like Ubuntu, natively from within Windows without the need for a fully fledged virtual machine. But you should know this. I’ve written about it before

As you can imagine, I spent the ‘next few months’ with bated breath, obsessively checking Windows Update for any hint of a taste. Eventually a mid June release was announced and as with this entire lockdown, days blended into weeks and that day arrived!

So? What so special about GPU compute?

Good question. Let’s roll things back a bit and talk about what it allows us to do. In fact, maybe it’s easier to just show you…

Object detection on Baited Remote Underwater Video! Or should I say black magic! This demonstration is using YOLOv5 (You Only Look Once) with a model I trained this morning to detect 9 species of fish and shark, run on a section of this old BRUV video of ours.

A GPU is like the CPU, the processor that performs all the logic to run your computer, but designed for rendering high quality graphics. This means they are designed to perform many many more calculations at once than your CPU. A typical CPU will have up to 16 high-speed cores, where a GPU will have thousands of cores, albeit slower ones. This makes them perfect for tasks like machine learning.

It’s not prefect. YOLOv5 is built for speed first, and accuracy second. And I only trained this model on a few hundred images.

We’ll definitely be training this further for use in our research projects and outreach, including BRUV and our Citizen Science surveys! Automated species recognition! How cool is this! What’s next…pattern matching and individual recognition? 😉

But you could already do this…

OK, OK, you’re right, this was entirely possible without WSL. In fact, I only used WSL here for the detection and I could have just done that in Windows. The training was all done in the cloud. It would have taken way too long to train this on my measly laptop. But WSL with GPU access makes it so much easier to develop these kinds of tools locally, and deploy them in the cloud for production.

OK, can I play too?

Those of you with the required hardware that want to try for yourself can find guides on getting set up from Microsoft and NVIDIA. The gist of it is you need to be on the Windows Insider Fast Ring to get the latest Windows Display Driver Model, and a member of the NVIDIA Developer Program to get their preview driver. You’ll then need to install the CUDA Toolkit (only the toolkit! not the driver!) in WSL using one of the Linux .run files, you’ll also need cuDNN. I had some GPU activation issues with an early version of the driver, so there may be hiccups, but things are moving quickly!


Dylan Irion

Dylan is a marine scientist and Save Our Seas Foundation project leader, working towards a PhD that aims to unravel the drivers of white shark population dynamics in South Africa. He is a passionate freediver and SCUBA diver, and volunteers as a Sea Rescue crew member.

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.