Skip to content

Instantly share code, notes, and snippets.

@ckandoth
Last active May 8, 2025 07:02
Show Gist options
  • Save ckandoth/cd4247755073cc3156b909dd31c15447 to your computer and use it in GitHub Desktop.
Save ckandoth/cd4247755073cc3156b909dd31c15447 to your computer and use it in GitHub Desktop.
Run SpliceAI with tensorflow-gpu on WSL2

WSL2 is a Windows feature that allows near-native execution of ELF binaries like Unix bash and Gnome apps. Recent versions of Windows support GPU acceleration and mounting ext4 disks, which turns a powerful gaming PC into a powerful Linux workstation without needing to dual-boot two operating systems. The guide below helps you set up WSL2, install TensorFlow with GPU acceleration, and then test SpliceAI on a VCF.

  1. Make sure you have the latest version of Windows 10 or 11 and administrative rights.
  2. Hit the Windows key, type cmd, right-click on Command Prompt, Run as Administrator, and click Yes if prompted by User Account Control.
  3. Follow these instructions to install WSL2. It should be as simple as wsl --install -d Ubuntu and reboot. But older Windows 10 may need more tinkering, like wsl --update to update the Linux kernel.
  4. Hit the Windows key, type "Ubuntu", and hit enter. Type "nvidia-smi -L" and make sure you can see your GPU listed.
  5. Install mamba (fast conda replacement that uses conda-forge as default channel):
curl -L https://github.com/conda-forge/miniforge/releases/download/22.11.1-4/Mambaforge-Linux-x86_64.sh -o /tmp/mambaforge.sh
sh /tmp/mambaforge.sh -bfp $HOME/mambaforge && rm -f /tmp/mambaforge.sh
  1. Add the following lines to your bashrc so you can use mamba/conda to create development environments:
# Add mamba and code to PATH if found
if [ -f "$HOME/mambaforge/etc/profile.d/conda.sh" ]; then
    . $HOME/mambaforge/etc/profile.d/conda.sh
fi
  1. Exit the terminal and start it up again so your ~/.bashrc gets loaded again.
  2. Use mamba to create an environment with tensorflow-gpu installed, activate it, and test it out:
mamba create -y -n gpu tensorflow-gpu
conda activate gpu
python -c 'import tensorflow as tf; print(tf.config.list_physical_devices("GPU"))' 2>/dev/null
  1. Install SpliceAI and the third-party wrapper that let's you cache results:
mamba install -yc bioconda spliceai==1.3.1 spliceai-wrapper==0.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment