Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-mini-2025-04-14· OpenAIAi2 WildChat-4.8M (AI2)

C:\Users\DjZaN>wsl Anbernic-Win600:/mnt/host/c/Users/DjZaN# wget…

  1. User

    C:\Users\DjZaN>wsl Anbernic-Win600:/mnt/host/c/Users/DjZaN# wget https://developer.download.nvidia.com/compute/cuda/12.9.0/local_installers /cuda_12.9.0_575.51.03_linux.run Connecting to developer.download.nvidia.com (23.219.89.241:443) saving to 'cuda_12.9.0_575.51.03_linux.run' cuda_12.9.0_575.51.0 100% |************************************************************************| 5569M 0:00:00 ETA 'cuda_12.9.0_575.51.03_linux.run' saved Anbernic-Win600:/mnt/host/c/Users/DjZaN# sudo sh cuda_12.9.0_575.51.03_linux.run -sh: sudo: not found Anbernic-Win600:/mnt/host/c/Users/DjZaN#

  2. Assistant

    The error -sh: sudo: not found means that sudo is not installed or not available in your WSL environment.

    What to do:

    1. Check your WSL distribution

    You might be using a minimal or custom WSL distribution that doesn’t have sudo installed.

    2. Try running the installer as root

    If your current user is privileged, you could try switching to the root user directly:

    su -
    

    Then run:

    sh cuda_12.9.0_575.51.03_linux.run
    

    If you can't switch user because su is also not available, try:

    / 
    

    or

    • Exit and restart WSL with root privileges if your distribution allows.

    3. Install sudo

    If you have apt package manager available, install sudo:

    apt update
    apt install sudo
    

    If apt is not available, your distribution might be very minimal, and you may want to switch to a full-featured WSL distro like Ubuntu.


    Additional notes:

    • Normally, WSL Ubuntu comes with sudo installed.
    • Running CUDA installers inside WSL is a bit unusual unless you are using WSL 2 with GPU support.
    • If you want to install CUDA on Windows, better use Windows native installers unless you plan to use CUDA inside WSL 2 with GPU support.

    Summary:

    Since sudo is missing, first check if your WSL distro can install packages or upgrade. If you just want to run the install script, try running it as root or use a full WSL distro with sudo available.

  3. User

    C:\Users\DjZaN>bash <3>WSL (23 - Relay) ERROR: CreateProcessCommon:640: execvpe(/bin/bash) failed: No such file or directory

  4. Assistant

    The error message:

    WSL (23 - Relay) ERROR: CreateProcessCommon:640: execvpe(/bin/bash) failed: No such file or directory
    

    indicates that WSL is unable to find or launch the bash shell (/bin/bash). This usually means one of the following:

    • Your installed WSL Linux distribution is corrupted or uninstalled.
    • The default WSL distro is not properly configured or missing necessary binaries.
    • WSL itself has some internal issues after an update or misconfiguration.

    Steps to troubleshoot and fix this:

    1. Check installed WSL distributions

    Run this command in Windows PowerShell or Command Prompt:

    wsl -l -v
    

    This will list the installed WSL distros and show their status/version.

    • Are there any distros listed?
    • Is the default distro properly installed or showing errors?

    Example output:

      NAME      STATE           VERSION
    * Ubuntu    Running         2
    

    If you see no distros or the listed distros show errors or stopped, that’s likely the problem.


    2. Try launching a specific distro explicitly

    If you see a distro named (for example) Ubuntu-20.04, try:

    wsl -d Ubuntu-20.04
    

    If it fails with similar error, the distro might be corrupted.


    3. Reinstall or reset your WSL distribution

    • Open Windows Settings > Apps > Apps & features
    • Find your Linux distro (e.g., Ubuntu)
    • Click Advanced options
    • Then click Repair (try this first)
    • If Repair does not fix it, you may need to Reset (this deletes all data in that distro)

    If you want to preserve data, back up any important files first by accessing the distro filesystem directly from Windows via:

    \\wsl$\Ubuntu\home\yourusername
    

    4. Reinstall WSL itself (if necessary)

    If no distros are installed or WSL is broken, you can try:

    Open PowerShell as Administrator and run:

    wsl --unregister <DistroName>  # Unregister broken distros
    

    Then reinstall a distro from the Microsoft Store (e.g., Ubuntu).

    If WSL itself is broken, try resetting it:

    • Disable and re-enable WSL in Windows Features:
      • Go to Turn Windows features on or off
      • Uncheck Windows Subsystem for Linux
      • Restart your PC
      • Re-enable it again
      • Restart again

    5. Check if WSL and distro files exist

    Make sure the Linux root filesystem exists on disk.

    For WSL 2, distros are stored in:

    %USERPROFILE%\AppData\Local\Packages\<Distro_Package_Name>\LocalState\
    

    Check if the ext4.vhdx file exists and is not corrupted.


    Summary:

    • execvpe(/bin/bash) failed means WSL cannot find the /bin/bash executable.
    • The Linux distribution might be damaged or missing.
    • Use wsl -l -v to check installed distros.
    • Repair/reset or reinstall the Linux distro.
    • Reinstall or reset WSL features if needed.

    If you want, post the output of:

    wsl -l -v
    

    and any installed distros list, I can help you further.

  5. User

    C:\Users\DjZaN>wsl -l -v NAME STATE VERSION

    • docker-desktop Stopped 2 Ubuntu Stopped 2
  6. Assistant

    Your output:

      NAME              STATE           VERSION
    * docker-desktop    Stopped         2
      Ubuntu            Stopped         2
    

    shows you have two WSL distributions installed: docker-desktop and Ubuntu. Both are stopped, which is normal if no WSL session is running.


    Your problem: When you run bash or wsl you get:

    WSL (23 - Relay) ERROR: CreateProcessCommon:640: execvpe(/bin/bash) failed: No such file or directory
    

    This means the Ubuntu installation probably is corrupted or missing /bin/bash.


    Next steps to fix:

    1. Try launching Ubuntu explicitly to get a better error message:

    Open Command Prompt or PowerShell and run:

    wsl -d Ubuntu
    

    What exactly does it say? If it fails with the same error, the root filesystem or bash is missing/corrupted.


    2. Check Ubuntu filesystem inside WSL filesystem folder

    Check if the Ubuntu distribution's filesystem is present:

    Go to:

    %LOCALAPPDATA%\Packages\
    

    Look for a folder like:

    CanonicalGroupLimited.UbuntuonWindows_<randomstring>
    

    Inside that folder:

    LocalState\rootfs\bin\
    

    Is there a bash executable inside bin?

    If not, this confirms your Ubuntu installation is corrupted.


    3. Repair or reinstall Ubuntu distro

    If your installation is corrupted, you likely need to reinstall Ubuntu:

    • Back up your files first!

    Access this folder in Windows Explorer:

    \\wsl$\Ubuntu\home\<your-username>\
    

    If accessible, copy your important files elsewhere.

    Alternatively, check the Ubuntu home folder (or any data you saved inside WSL).

    If not accessible due to corruption, you may have no backup option.


    4. Reinstall Ubuntu

    Run in PowerShell:

    wsl --unregister Ubuntu
    

    This will remove the broken Ubuntu installation (losing all files inside it).

    Then reinstall Ubuntu from the Microsoft Store:

    • Go to Microsoft Store → search for Ubuntu → Install it

    or install via command line:

    wsl --install -d Ubuntu
    

    5. After reinstall, run:

    wsl -d Ubuntu
    

    and see if it works.


    Summary:

    • Your Ubuntu WSL installation is broken (missing /bin/bash).
    • Back up data if possible.
    • Unregister and reinstall Ubuntu distribution.
    • This should restore a working bash shell.

    If you want help with backing up your files, let me know!

  7. User

    meow@Anbernic-Win600:~sudoshcuda12.9.0575.51.03linux.run[sudo]passwordformeow:Failedtoverifygccversion.Seelogat/var/log/cuda−installer.logfordetails.meow@Anbernic−Win600:  sudo sh cuda_12.9.0_575.51.03_linux.run [sudo] password for meow: Failed to verify gcc version. See log at /var/log/cuda-installer.log for details. meow@Anbernic-Win600:~

  8. Assistant

    The message:

    Failed to verify gcc version. See log at /var/log/cuda-installer.log for details.
    

    indicates the CUDA installer is checking your GCC compiler version, and it failed to validate it. This is a common issue because CUDA requires specific GCC versions or compatible versions.


    Steps to troubleshoot and fix the gcc version issue:


    1. Check your current gcc version

    Run inside your WSL terminal:

    gcc --version
    

    CUDA often requires a supported GCC version — usually GCC 9 or earlier for recent CUDA releases, but CUDA 12.9 might support newer ones; check NVIDIA's CUDA documentation for exact version requirements.


    2. Check the installer log for details

    Inspect the log to see the exact error:

    cat /var/log/cuda-installer.log
    

    Look for lines mentioning "gcc" or "version" errors.


    3. Install a compatible gcc version

    If your gcc is too new or missing, install a supported gcc version.

    For example, to install GCC 9 (replace with version required by CUDA), on Ubuntu:

    sudo apt update
    sudo apt install gcc-9 g++-9
    

    Then to use gcc-9 and g++-9 as default temporarily:

    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
    sudo update-alternatives --config gcc
    

    Follow prompts to select gcc-9.


    4. Verify gcc is now correct version

    gcc --version
    

    Make sure it prints the version you expect (gcc-9 or whichever you installed).


    5. Retry CUDA installer

    Now try again:

    sudo sh cuda_12.9.0_575.51.03_linux.run
    

    6. Additional suggestions

    • Note WSL GPU support: CUDA in WSL 2 requires Windows 11 with GPU compute support (WSLg). Also, make sure your Windows NVIDIA drivers support WSL (WSL2 GPU drivers).
    • Make sure you have the right CUDA installer for Linux on WSL 2 — sometimes, the standard Linux installer expects a standard Linux environment with hardware access, which might have limitations in WSL.
    • Alternatively, consider installing CUDA Toolkit via the Ubuntu repository or Nvidia’s WSL instructions.

    Summary:

    • Check and install a gcc version compatible with CUDA.
    • Set it as default via update-alternatives.
    • Review /var/log/cuda-installer.log if problems persist.
    • Make sure your WSL and Windows GPU drivers support CUDA workloads.

    If you want, paste the full output of gcc --version and the relevant excerpt from /var/log/cuda-installer.log here, I can help interpret.