Browsed by
Category: Problem solutions

CUDA with WSL2+Docker on Windows for Kokoro

CUDA with WSL2+Docker on Windows for Kokoro

In order to get Kokoro text-to-speech to work with my 5090 GPU inside a Docker container on Windows, I had to get the CUDA setup inside WSL2 using Docker images on Windows. Here were the helpful links:

Setup the WSL image with CUDA and Docker support.

  1. Ensure you have WSL2 installed on your Windows desktop
  2. Install Docker for Windows
  3. Reboot
  4. Ensure you have the latest NVidia GPU driver installed on your Windows desktop
  5. Ensure you have the latest NVidia CUDA sdk installed on your Windows desktop
  6. A system reboot here is a good idea
  7. Ensure you have Microsoft Visual Studio installed for best results
    • The CUDA sdk requires you have Visual Studio 2019, 2022, or 2026 installed. I have found 2022 is a solid version and seems to work well, but haven’t tried 2019 or 2026 recently.
    • Note you need to use the ‘Visual Studio x64 Native tools for VS2022’ command prompt if you expect to run command line compiler operations.
  8. Now you need to install CUDA support inside WSL NVidia guide
    • First follow the instructions to ensure Docker support
    • Second follow the installation of CUDA Toolkit and CUDA Developer Tools inside WSL2 on an Ubuntu 24.04 (or later) WSL distro.
  9. Optional: install nvcc so y
    • sudo apt install nvidia-cuda-toolkit
    • nvcc –version
      • This prints out the version and ensures the nvcc sdk compiler is working inside your WSL image
  10. Ensure Docker Desktop for Windows is running on your desktop
  11. Turn on support for Docker in WSL
    • Settings -> From the General tab, enable Use WSL 2 based engine.
    • Reboot
  12. Ensure your WSL image inside WSL has Docker support enabled
    • Settings -> Resources -> WSL integration tab -> Find and enable the slider for the WSL image under ‘Enable integration with additional distros’
  13. I had to reboot my system at this point to get both the WSL and Windows Docker Desktop to see each other properly
  14. After reboot, ensure Windows Docker Desktop is running
  15. Set the user permissions in the WSL session to enable access (permission denied while trying to connect to the docker API at unix:///var/run/docker.sock)
    • sudo usermod -a -G docker <username>

Now run the Kokoro docker command inside your WSL2 image:

  • CPU only:
    • docker run –gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu:latest
  • NVidia gpu:
    • docker run –gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu:latest-cu128

Connect with the default web link:

Subsequent runs:

  1. Ensure the Docker Desktop is running
  2. Start the WSL -d <image> you set up in the first part that’s has all the CUDA stuff installed
  3. run the Kokoro docker command inside WSL
  4. Connect your web browser to the localhost address

Raw WSL history (commands in WSL)

You can’t follow this 100% directly. Note you have to stop and restart/reboot WSL and desktop as you do the other steps above.

# NVidia CUDA setup inside WSL2 Ubuntu 24.04 image
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/13.3.0/local_installers/cuda-repo-wsl-ubuntu-13-3-local_13.3.0-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-13-3-local_13.3.0-1_amd64.deb
sudo cp /var/cuda-repo-wsl-ubuntu-13-3-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-13-3
exit
sudo apt install nvidia-cuda-toolkit
nvcc --version
exit
sudo usermod -a -G docker matt
exit
docker run --gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu:latest-cu128

Untested but possibly interesting:

WordPress 7.0 messed up the internal editor’s font?

WordPress 7.0 messed up the internal editor’s font?

When I updated to WordPress 7, I noticed the font in the post editor/publisher was kind of messed up. Turns out, it’s a part of the theme you’re using. If your theme doesn’t have specific fonts specified, you can get some ugly fallbacks.

The fix?

In any Block Editor page, such as editing a post, 3 dot menu, Preferences, then Appearance, and then disable “Use theme styles.”

https://wordpress.org/support/topic/editor-font-is-wrong/
Forget your wifi password?

Forget your wifi password?

Did a friend come over and you need the wifi password – but forgot it? If you have a windows system that has ever connected to the wifi, you can extract it from your history. Simply open an admin-privledged command prompt and use this line to display the passwords in cleartext:

netsh wlan show profile * key=clear
Airpod/iPod cleaning that actually works

Airpod/iPod cleaning that actually works

I bet like a lot of folks, you have a set or two of airpods. I have an older set I use for running since the sound in them after a year or so was starting to get quieter and duller. Then, it got to the point I could barely even hear out of the right one.

Before I tossed them, I decided to see if cleaning them out would help. There wasn’t any obvious ear wax in them. So I looked online and sure enough Apple itself now has a video and procedure on how to do this.

I tried the method out. The first go seemed to improve things, but I wasn’t sure. The next day I tried it again, and the right airpod suddenly had a lot more volume. I tried it a 3rd time on the 3rd day, and low and behold – they were practically like new (well – except the battery life was still only good enough for a 60 minute run – but that’s another story).

I had tried this method before, but using isopropanol alcohol. It largely gave poor results. It seems the key is to use micellar water – usually for removing makeup and dirt on sensitive skin. I use Bioderma – Sensibio – H2O Micellar Water and it seems to be what they use in the video (it has a distinctive translucent red cap).

Can’t install Windows Sandbox on Windows 10

Can’t install Windows Sandbox on Windows 10

Windows Sandbox is a great little completely isolated environment in which to test out software you’re not sure is safe or for experiments that might corrupt your environment/installations. It pops up a virtual machine running Windows 10/11, is completely isolated, and then deletes everything when shut down.

However, it’s not always easy to get started. Even after installing the latest Windows 10 updates and turning all on virtualization features in bios, I still could not see the Windows Sandbox feature in the Turn Windows Features On and Off program.

It turns out you may need to do some extra setup, and the entire process is here in tenforums. They have a script (below) that helps, but there may even be other steps to follow and they’re all outlined on the post.

@echo off

echo Checking for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

echo Permission check result: %errorlevel%

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

echo Running created temporary "%temp%\getadmin.vbs"
timeout /T 2
"%temp%\getadmin.vbs"
exit /B

:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0" 

echo Batch was successfully started with admin privileges
echo .
cls
Title Sandbox Installer

pushd "%~dp0"

dir /b %SystemRoot%\servicing\Packages\*Containers*.mum >sandbox.txt

for /f %%i in ('findstr /i . sandbox.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"

del sandbox.txt

Dism /online /enable-feature /featurename:Containers-DisposableClientVM /LimitAccess /ALL

pause

adf

Self testing a Roland MT-32

Self testing a Roland MT-32

To self-test a Roland MT-32, turn the unit on while holding down the 3 button, Volume and turn on the unit to enter test mode. You can check all the keys and play some test tones. To test the midi, you need to have the midi cables plugged in. To play a demo song, just hold just Master Volume. The “MIDI Message” light should flicker if it receives data.

Here’s a great guide for setting up an MT-32

Replacing your Subaru mid 2010’s Crosstrek Headlights

Replacing your Subaru mid 2010’s Crosstrek Headlights

Once your car gets about 10 years old, one of the most annoying things is that headlights dim and yellow. This is due to a number of reasons – but primarily due to the degradation of the UV coating. You can buff it off, but it often quickly returns and you’re stuck with an annoying chore almost every year.

Another option is to buy replacement headlights. In the old days, you simply unscrewed the old bulbs and put in the new ones. Now you need to remove the assemblies – which often involves removing the bumper and surrounding shrouds – as is the case with mid 2010 Subarus.

The Crosstrek/Impreza’s in the 2015 era were actually not that bad to replace. TRQ does a great job showing you how to do the job yourself – including how to re-aim the headlights. It’s a great video.

Set up Windows 11 without an annoying Microsoft Account

Set up Windows 11 without an annoying Microsoft Account

Being required to connect to the internet while installing Windows 11 has been one, in a long line of reasons, why many users refuse to update to the new OS, even though it has been out for 4 years (since Nov 2021). After finally reaching an adoption rate of just over 50%, it has since dropped to 49.08%

The most popular bypass to having to log in with an internet connected Microsoft account was to use “oobe\bypassnro” which, when typed into the command prompt during the Windows 11 setup experience, would enable a button that let you skip connecting to the internet

Unfortunately, Microsoft is removing that trick, but user @witherornot1337 on X found that typing “start ms-cxh:localonly” into the command prompt during the Windows 11 setup experience will allow you to create a local account directly without needing to skip connecting to the internet first.

Or you could, you know, actually give customers what they want instead of the kind of backwards thinking that gave us the universally hated Windows 8.

Links: