Contents tagged with Windows
-
Setup and use CUDA and TensorFlow in Windows Subsystem for Linux 2
Table of contents
- Install Windows preview
- Install WSL 2 preview
- Install Nvidia driver preview and CUDA toolkit
- Run CUDA sample application
- Install Docker and Nvidia container toolkit
- Run CUDA containers
- Troubleshoot
- Run WSL + CUDA + Docker + Jupyter + TensorFlow
- Encoding and decoding video with GPU in WSL?
GPU support is the most requested feature in Windows Subsystem for Linux (WSL). It is available in WSL 2.0 through Windows Insiders program. And Nvidia CUDA is supported. The following diagram shows the WDDM model supporting CUDA user mode driver running inside Linux guest:
So the popular Linux AI frameworks like TensorFlow, PyTorch, etc. can work with WSL with CUDA acceleration:
This article walks through the installation of Windows, WSL, CUDA in WSL, and Docker in WSL.
Install Windows preview
First, you must enable “Optional diagnostic data”, otherwise Windows cannot join Windows Insiders.
Then, join Windows Insiders program with Microsoft account (an account can be created if you don’t have one: https://insider.windows.com/). The channel must be Dev:
Then run Windows Update. It will download the pre=release installer. Windows will restart and reinstall.
Install WSL 2 preview
In Windows, make sure the following Windows features are enabled:
- WSL:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart - Virtual machine platform:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Now restart Windows, then Windows will have WSL and the wsl command line tool. Run Windows Update again to get the latest WSL 2. When this is done, in the update history, it must show 4.19.121 or later:
Then manually install this patch: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi. And then run the following command as administrator to update the kernel to the latest version:
C:\WINDOWS\system32>wsl --update
Checking for updates...
Downloading updates...
Installing updates...
This change will take effect on the next full restart of WSL. To force a restart, please run 'wsl --shutdown'.
Kernel version: 5.4.72 -
Run Hyper-V and VMware virtual machines on Windows 10
I use Windows’ Hyper-V to run virtual machines for long time. Recently I need to run a VMware virtual machine to test something. I installed VMware Player, which is free for non-commercial usage. However, the virtual machine cannot started, with an error:
-
Build custom Windows 10 PE
Windows PE (WinPE) is a small version of Windows, which can be used to boot up computers from CD or USB disk drive. It is very useful to deploy or repair the desktop or server edition of Windows. For many years I have tried many options to build a WinPE image and create a bootable media, including the Microsoft official approach. The easiest way I found, is to use a third party tool called “Win10PE SE project”. I am sharing this tool with a post, because it is not easy to be found when searching WinPE related keywords.
-
Remote desktop connection authentication error due to CredSSP encryption oracle remediation
Recently, when connecting to another Windows machine with RD, I got the following RDP authentication error due to CredSSP encryption oracle remediation:
-
Shrink Virtual Hard Disk Image (VHD and VHDX) Files
Virtual hard disk image files (VHD and VHDX files) grow bigger during the usage. For instance, this is a 20G virtual disk file for a Windows XP virtual machine:
-
Query Operating System Processes in C#
.NET framework provides some process APIs in System.Diagnostics.Process class. Only some basic information of process can be queried with these APIs. .NET does not have APIS for other information, for example, a process’s parent process/child processes. There are some options to query process informations, like performance counter, P/Invoke, etc. Querying Win32_Process class of WMI could be an easier way.
-
DiskPart Problem: Cannot Select Partition
When working with USB drive, the DiskPart command cannot select the partition of the USB disk:
-
Recover Outlook 2010 from crash
Today my Outlook 2010 crashed while I am writing an email. When I restart I got this error:
-
Ellipses (…) In UI Command Text
Some times, command text is followed by ellipsis (…) or not:
For years, many developers told me that ellipses mean a new window or dialog will pop up. For example, here:
- Clicking New / Save / Exit will not pop up new window or dialog;
- Clicking Open… / Save As… / Page Setup… / Print… will pop up new window or dialog.
But this is not correct. Take a look at About Notepad.
-
Blog Code Font Change: From Courier New to Consolas
Courier New is an excellent monospaced (non-proportional) typeface introduced with Windows 3.1. As a UI designer, I cannot tell how many year I have worked with Courier New. As the release of Visual Studio 2010 and the new MSDN, Consolas becomes the default font of code.
-
Playing with the CPU Usage Curve
In the book “The Beauty Of Programming”, which talks about Microsoft interview questions, there is a interesting section: Control the CPU curve of Windows Task Manager.
-
The Volume In Windows Media Center
I developed a tool for Windows Media Center in 2008 in Redmond, and I got a very cool Windows Media Center remote controller. Since then I became a fun of it. Windows Media Center + remote controller makes my Alienware M17x into a powerful home theatre.
-
Resolving The nvlddmkm.sys Blue Screen Issue
I started to use ATI discrete graphic cards since 2002. At the end of 2009, I got my first pair of NVIDIA cards, GTX260M SLI , and recently I after I upgraded the driver to the latest 195 release, I encountered the blue screen failure on my laptop with Windows 7.
-
Mac OSX Turns Dual Core Laptop into Solo Core
This is blogged because it is surprising. Some months ago my friend and me were investigating Mac OSX for my WebOS, so we installed the latest version on a machine, SAMSUNG R25 XE04 with a T2330 Dual Core CPU. After that, Windows 7 was installed back. However, Windows recognized his laptop as a Solo Core CPU.
-
A UI bug of Windows Server 2008 R2 RTM
Today when playing with Windows Server 2008 R2 RTM at home, I noticed a small UI bug from the start menu.
-
Understanding The Internet File Blocking and Unblocking
On Windows XP SP2 + IE 7 and later Windows, files from Internet are marked. Sometimes this feature causes problems.
-
Confirmed by Microsoft: Cannot Install HD Audio Driver On Windows Server 2003 SP2 / R2
On Winodws Server 2003 SP2 / R2, HD (High Definition) audio driver cannot be installed. This happens for both 32 bit and 64 bit versions of Windows.