فهرست منبع

Fail fast on WSL1 while allowing on WSL2

This prevents users from accidentally installing on WSL1 with instructions
guiding how to upgrade their WSL instance to version 2.  Once running WSL2
if you have an NVIDIA card, you can follow their instructions to set up
GPU passthrough and run models on the GPU.  This is not possible on WSL1.
Daniel Hiltgen 1 سال پیش
والد
کامیت
2fcd41ef81
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      scripts/install.sh

+ 8 - 0
scripts/install.sh

@@ -33,6 +33,14 @@ case "$ARCH" in
     *) error "Unsupported architecture: $ARCH" ;;
     *) error "Unsupported architecture: $ARCH" ;;
 esac
 esac
 
 
+KERN=$(uname -r)
+case "$KERN" in
+    *icrosoft*WSL2 | *icrosoft*wsl2) ;;
+    *icrosoft) error "Microsoft WSL1 is not currently supported. Please upgrade to WSL2 with 'wsl --set-version <distro> 2'" ;;
+    *) ;;
+esac
+
+
 SUDO=
 SUDO=
 if [ "$(id -u)" -ne 0 ]; then
 if [ "$(id -u)" -ne 0 ]; then
     # Running as root, no need for sudo
     # Running as root, no need for sudo