18 ms·
CUDA on Windows Subsystem for Linux 2
- FiReaNG3L 6y agoThis is BIG for machine learning adoption! 2 years ago it was a nightmare to setup everything on a Windows box, and wasn't working in any VMs (WSL or VirtualBox). Very excited about this.
- black_puppydog 6y agoThis feels like it's gonna be terrible for people already doing ML. Now, the following has more than a bit of elitism, I'm aware of that, so please don't comment to point that bit out... I'm afraid that searching for answers to specific ML questions will start feeling like trying to google some Windows problems (every few years when I make the mistake of trying to help someone out) where it's all "download this, then click here..." I hope I'm wrong and this will only be used by people willing to go the extra mile...
- Tenoke 6y agoDoubt it. Even though you can run e.g. anaconda or pandas on Windows if I google an issue, I have no provlem getting linux-relevant results.
- cma 6y agoHope we don't see things like: "Google announces today that to work around Windows' file path length limitations, Tensorflow's directory structure is being rewritten to use three characters or less per directory."
- avandvrnot 6y agoWhat sold me on NT 3.1 was the in-the-box Microsoft Transaction Server. MTS is the single largest reason why SQLServer_Linux was a shoehorn refit, not anything like the job that it could have been. Out of the box CICS interop was bigger than my memory of the first browsers for W/NT. Want to trade with the world and speak EDIFACT, or do X.500 real money movement? You had codes running before you could put the screws on your local IBM account rep to get out of bed for you. I last looked at HN just as Lockdown was announced in England. The last discussion I perused was showing a project that provided secure remote access to sensitive ports. Which I think is stable CICS fayre since about ‘85 on the cross platform side I would guess at least twenty years older for anything/360.
- washadjeffmad 6y agoI recently helped a friend with their museum's collection management software. The server and client were Windows based, and even with the proper dependencies and provisioning, the installs kept failing. Some of the paths were too long and the installer could only be executed after being unpacked to root. It's been a while since I more than casually gutted and used Windows as an app container, but I hadn't realized how much has remained the same after more than two decades.
- int_19h 6y agoWindows itself can deal with long paths for a long time now. The problem is the apps - they need to use newer APIs that don't e.g. deal with structs with wchar_t[MAX_PATH] fields in them. For apps written in higher-level languages, it's usually the standard library that needs to be updated - e.g. Node.js and Python already have such support. But if it's C++, then it depends on how much the app developer cares.
- speedgoose 6y agoDon't be too elitist and scared, machine learning developers using Cuda and WSL are far from the windows non technical average user. You can take a look at the Github issues for Microsoft's projects related to WSL if you don't believe me. They are normal developers like you and me.
- emsal 6y agoWhat's scary about Googling for specific ML questions beginning to look like googling some Windows problems? This kind of dichotomy already exists between people who interact with ML only through keras and those who use a more flexible library. If you fall into the latter category it's still easy enough to find the answers to ML questions that mostly pertain to the deeper stuff. Don't even get me started on the difference between people who do and don't know statistics theory. But the point is that all of these groups do ML and they coexist just fine. On another note. I don't think technical proficiency (or whatever your elitism-metric is) is very correlated with using Windows as the primary platform. You can Google stuff related to a Windows problem and through that learn how to work with the registry, and yes, some of the things you need to do require you to RTFM. So this elitism also suffers from being off the mark.
- curiousgal 6y agoOther than C# and other Microsoft specific stacks, I've found coding on Windows to be absolutely horrible compared to Linux.
- wvenable 6y agoAgreed. But with WSL you're no longer shoehorning Linux software into Windows, you're running Linux software on Linux within Windows.
- kyberias 6y agoCan you be more specific? What exactly is horrible on Windows when you've tried coding?
- deleuze 6y ago- Powershell sucks - Graphical installers / no package manager - No search results / docs for most languages - Weird bugs due to being second class for most languages - Have to use docker in VM - Bad env for writing scripts - We deploy on Linux
- Kipters 6y agoSome of these are fixed or there's progress being made: - IMHO PowerShell is not that bad, but the newer PowerShell Core works better and with WSL you can use your favorite linux shell (and mix and match Windows and Linux binaries) - WinGet is in preview - No search results: my experience is 50/50 on that - second class citizen: I wouldn't say most, definitely for Golang - Docker now runs on WSL2 (which is still a sort of VM, but in my experience it's night and day with the old VM and especially compared to the default Docker experience on macOS) - Why? You can use Python, and scripts are where Powershell really shines as a language - That's the entire point of WSL I guess
- FridgeSeal 6y agoPowerShell is horrible and confusing to use. Maybe I’m just dumb, but it was confusing to learn and super unintuitive. If I’m running everything in WSL/2 why not just run Linux? I don’t remember the last time I had to use something windows specific - and word is available online for the sporadic times that needs to be used.
- alerighi 6y agoI mean there are services like Amazon AWS, Azure, Google Cloud that will set up everyting for you. The money you pay them to me is worth the time you otherwise would have spent to do the setup yourself.
- AndrewKemendo 6y agoThis is pretty wild. The WSL2 upgrade really made the terminal way faster than the original WSL, so I'm curious how this runs. Looking forward to trying it!
- cchance 6y agoI'd imagine pretty close to what it is native
- blastonico 6y agoHow long to start seeing advertisement like "Linux, best viewed on Windows".
- benbristow 6y agoDoes kind of feel that way. Having a full Windows Desktop with good graphics drivers and software like Microsoft Office, Photoshop, commercial games etc. and Linux for the programming/server-software side of things. I have literally no reason to dual-boot with Ubuntu anymore. WSL2 and Visual Studio Code fulfils all my Linux coding requirements. Maybe (probably?) a bad thing but it's damn convenient.
- anonymousDan 6y agoYeah I just started using Windows 10/WSL yesterday and I have to say I'm impressed. Are there any downsides/painpoints I should be aware of?
- benbristow 6y agoHaven't really used it enough to say. I used it to work on a Ruby on Rails app that I used to dual boot exclusively for and it was seamless and fast.
- fartcannon 6y agoThe downsides are Windows telemetry and desktop monopoly.
- Stevvo 6y agoIn WSL 1.0, you would run into show stopping bugs or incompatibilities eventually. I haven't had any problems in 2.0
- FridgeSeal 6y agoI/O performance is pretty horrific.
- 6y ago
- vaidhy 6y agoMy biggest concern for not trying it out right now is that the insider preview for windows is asking for all kinds of data permissions :(
- zantana 6y agoIndeed. I'm not sure why WSL has consistently required some bleeding edge version of Windows to run. I remember trying to get on a managed desktop at work a couple of years ago and apparently the LTS version of Windows used in the enterprise is even farther behind.
- jacquesm 6y agoPity. CUDA was/is proof positive that Linux on the desktop is perfectly feasible and that you can use it to both do a UI and do meaningful computation on the same machine without getting tied down into all kinds of licensing schemes. Opening this further up to Windows gives fewer people a really good reason to try out Linux as their daily driver. I personally don't get why any developer would prefer Windows over Linux with its near infinite software repositories related to all things developers would like.
- etaioinshrdlu 6y agoWell, CUDA is about the opposite of open source. It needs special hardware and a closed source driver. CUDA on Windows was already a big deal in engineering. Scientists and academics preferred Linux (and python, and docker) and Windows is playing catch up there to become compatible with the tools that have grown in popularity over the last 5 years. Personally, as an open source advocate, I think competition (even from MS) is healthy. It drives everyone to build a better product.
- jacquesm 6y agoYes, but that doesn't really contradict what I said. As long as manufacturers are willing to support Linux for their products even those that require special hardware, and in spite of having a closed driver this is possible and will work very well, so well that an entire profession can be better supported on Linux than on Windows. And that's very interesting, especially given that CUDA is an outflow of gaming hardware which was better supported on Windows.
- alerighi 6y agoAlso Linux is becoming the new Windows, and is one of the reason I stopped using it. What is the point of using a system that on every release is more and more bloated and full of crap that it breaks? Docker for example, I hate it, it serves no purpose beside wasting disk space and slowing down your machine. BTRFS is a bugged imitation of ZFS. Wayland not only is bugged but even does less things than Xorg. Most scientists and academics then just don't know how to write software or administer operating systems, and if they program they write the worst crap of spaghetti code possible, no wonder they like Linux, Docker and python. I use macOS, at least I have a system that has a decent user interface, and for my server I started using whenever I can FreeBSD, much more stable, much more simple, good documentation, a good operating system.
- RcouF1uZ4gsC 6y agoThis is finally the year of the Linux desktop. However, it is running on Windows as WSL. With this support now for CUDA now, it can be argued that the best, most versatile developer experience is on Windows. You now have access to all the Windows specific tools (such as Visual Studio) as well as all the Linux tools in a very seamless environment.
- rvz 6y ago> This is finally the year of the Linux desktop. However, it is running on Windows as WSL. One more thing. Given that there's lots of distros, which Linux distro/desktop has won this year? Right, the winning Linux desktop is Windows, thanks to WSL2. How unexpected of Microsoft.
- shmerl 6y agoNext step, Nvidia will support only WSL and not normal Linux? Good riddance, we need less blobs.
- RcouF1uZ4gsC 6y agoActually, this might be a great price discriminator for NVidia. They have tried to differentiate their consumer and professional GPUs so they can charge different prices. I could see NVidia only providing WSL/Windows drivers for their consumer GPUs. If you want native Linux, then you would have to buy a professional GPU at higher cost. By great, I mean great for NVidia, not for us.
- shmerl 6y agoI'd say it's going to be great for Linux, since usage of Nvidia will drop and progress will accelerate, because no one will have to deal with blob idiosyncrasies caused by Nvidia refusing to upstream their driver. With Intel joining AMD on high end GPU scene with open drivers, it's Nvidia who will be the loser with their dinosaur blob approach.
- 6y ago
- anaisbetts 6y agoHaving set this up, this is going to be absolutely huge for ML. A lot of nonsense is getting cut down by this: 1. You don't have to install special CUDA-specific drivers that are behind the normal gaming drivers anymore. You'll soon be able to just use the Regular nVidia Drivers (and even now, all you need to do is install a Beta driver version). That's huge for someone just starting out, they don't have to have "the dedicated CUDA machine / OS" 2. At least in Arch, the Linux side of this is literally as simple as `yay -Sy python-tensorflow-cuda`, that's it. Can't get any easier. 3. VS Code's WSL integration means you can use a real editor, with real linting / auto-complete, but without the technical issues of Desktop Linux (aka the Wayland Nightmare and DPI issues everywhere)
- pantalaimon 6y ago> without the technical issues of Desktop Linux (aka the Wayland Nightmare) Nobody is forced to use Wayland. It’s still quite experimental, I think only Gnome enables it by default.
- cbhl 6y agoXming on Windows isn't exactly a walk in the park either -- I'd still rather use the native, proprietary build of VSCode on a proprietary OS with the SSH extension if I'm on a high-DPI screen.
- int_19h 6y agohttps://x410.dev/ https://x410.dev/ is trivial to set up, and once done, it "just works". But yeah, with VSCode WSL remoting, there's just no particular reason to do that anymore.
- apazzolini 6y agoWhat's the performance like on this? Does it feel native or does it feel more like a VM?
- syntaxing 6y agoIronically, I'm super excited about this because I run a Mac. I didn't feel like changing anything in the bootloader using ReIT so I use an old laptop for Linux stuff. Mac + Bootcamp Windows + WSL2 + eGPU sounds like my dream machine.
- shmerl 6y agoCUDA proliferation. Not interesting.
- withinrafael 6y agoThrowing out a random data point: Until now, NVIDIA has been very anti-virtualization (on the consumer side), going as far as to engineer its drivers to detect in-use virtualization (Hyper-V, Xen, QEMU, etc.) and fail on purpose [1]. I'm curious to see how they now handle this scenario (given WSLv2 runs in a virtual machine). Perhaps they just commented those checks out in their 'specialized' drivers, an interesting development for enterprising individuals looking to enable consumer GPU pass-through for general purpose virtual machines and containers. [1] https://github.com/riverar/Remove-HypervisorChecks https://github.com/riverar/Remove-HypervisorChecks
- deno 6y agoIt’s not GPU pass-through, it’s paravirtualization.
- bonzini 6y agoStill if they want they can allow only Quadro cards to expose the necessary interfaces on the host side.
- 0xFFC 6y agoCan you explain about paravirtualization?
- AaronFriel 6y agoYes, instead of using a virtual GPU driver that simulates the behavior of a real device, a paravirtualized driver is a shim that connects a device in the virtualized operating system to a real device on the host. In summary: * Full virtualization is a complete, in-software implementation of a device. Early virtualization technology was typically of this nature. * Paravirtualization typically requires cooperation between the host and the guest, with a special communication layer (in WSL2's case, provided by Hyper-V) between a guest device driver and a host driver. There are at least two more method of passing a host device through to a VM. * "GPU passthrough", "PCIe passthrough", or "VFIO passthrough" depending on the source, Microsoft bucks these all and calls this direct device assignment, or DDA. In this mode, the guest OS is given exclusive access to a device or a device hierarchy (defined by the layout of the motherboard itself). This uses the MMU and IOMMU of the host to allow a VM to run a native driver, e.g.: nvidia's CUDA driver, and it will see a real physical device. (Nvidia's driver has historically blocked this by detecting that other parts of the guest OS are virtualized, because from the driver's perspective the device is a real, authentic Nvidia device, but the rest of the OS devices are virtualized and there are ways to detect that.) * SR-IOV (https://en.wikipedia.org/wiki/Single-root_input/output_virtualization https://en.wikipedia.org/wiki/Single-root_input/output_virtu...) is a PCI-express native method of splitting a device into virtual functions which can be mapped into a guest. I think the first real use for this was network adapters, which allowed VMs to get 10-40GBps network adapters working at native speeds by passing through virtual functions so that hardware offloading worked. Nvidia supports this on some of their server platforms, with GPUs offering up to 7 or 8 "virtual functions" which allows a single GPU to be partitioned and assigned to separate VMs. Once split up in this fashion though, I think it can be tricky to present the full device as a unified GPU.
- cbhl 6y agoPrevious discussion from when Microsoft sent patches to Linux upstream to enable this: https://news.ycombinator.com/item?id=23241040 https://news.ycombinator.com/item?id=23241040 And related discussion on lkml with more context: https://lkml.org/lkml/2020/5/19/1139 https://lkml.org/lkml/2020/5/19/1139
- mook 6y agoAs usual, LWN has a great article on it that is much more approachable than raw LKML: https://lwn.net/Articles/821817/ https://lwn.net/Articles/821817/
- jpm48 6y agoThis is quite light on detail, have just installed, was thinking that nvcc would be installed to WSL2 as part of the process. It wasn't so did it via apt which worked fine. Built a sample (with some hacking of the SM versions which should be higher as I have an RTX) and when I run the basic Matrix mult demo get code=38(cudaErrorNoDevice) Anyone else had any luck?
- jpm48 6y agoJust done some more reading around and it seems most people are using docker in WSL to get things work! This seems overkill to me. I usually just write CUDA code in linux and use it. Am I missing something?
- 29athrowaway 6y agoWhen you mention Microsoft + EEE, you get downvoted. Well, they have so far: 1) embraced Linux. 2) extended it with proprietary functionality (Windows living outside WSL), and now what is next? How is this not the same? Of course, the MS employee will downvote me automatically, the VS code users will downvote me too, and I will lose 5 karma for saying the truth.
- Kipters 6y agoNext? They're trying to upstream it
- bonzini 6y agoWhy would it matter if it's upstream? Upstreaming something like this is not really useful to anyone but Microsoft; it is still something that is inextricably tied to Windows and WSL. The point is not "extinguishing" Linux per se, it's achieving enough lock-in that only Linux that Microsoft customers can use is WSL.
- cwyers 6y agoWSL is not a Linux. It is a Windows subsystem for running Linux userlands. (Almost as if the WSL name isn't totally nonsense!) The "default" is Ubuntu. But Debian is supported, OpenSUSE is supported, Kali is supported. Unsupported but available, you can get Alpine, CentOS, Fedora, Arch, lots of distros.
- bonzini 6y agoYou could say that WSL is not a GNU/Linux. But since WSL comes with its own kernel, part of it is definitely a Microsoft-extended flavor of the Linux kernel. Even if this driver went upstream, it wouldn't be any less tied to the WSL virtualization platform.
- Kipters 6y agoThat was WSL1, WSL2 is a micro-vm running the Linux kernel and whatever userland you want. Ubuntu is just the most advertised one, but all are equally unsupported by MSFT, support is provided by the distro "vendor"
- nbardy 6y agoI tried to set this up yesterday and spent 3 hours and still couldn't get it working.
- spullara 6y agoThis black screened my computer. I have been spending the last few hours trying to get it to boot up again. FIXED: safe mode, reinstall latest nvidia driver.
- g_airborne 6y agoThis looks very cool if it can deliver up to its promises! As a Mac user and ML developer I’m starting to look more and more jealous towards Windows - it is starting to make sense this way. But I’m also a bit afraid. Has anything related to CUDA ever been easy to install and setup? Anyone who tried this have some pointers on this? For example, I don’t know how many times I’ve googled the CUDA, cudnn, TF compatibility matrix but it must be close to 100. Is this helping fix that as well?
- deleted 6y ago[deleted]
- tsp 6y agoWow, this is huge for data scientists! Now Apple is even more behind with ML after NVIDIA decided to drop macOS driver support.
- yahyaheee 6y agoThis is particularly impactful since macOS won’t support CUDA drivers anymore.
- galkk 6y agoSeems like the one thing that I will miss from desktop Linux is i3
- ilyas121 6y agoCan someone explain to me the WSL acornym? Isn't WSL really a Linux subsystem for Windows? tiny pet peeve
- stephen_g 6y agoYeah, it's very confusing. I've heard it explained but I still think it doesn't really make sense. The core of the argument that I've heard is that Windows has multiple subsystems so they say it's a "Windows Subsystem", but the 'for' in "For Linux" still makes no sense. The arguments for not calling it something like "Linux Subsystem [for/on/in] Windows" don't seem to match up with the fact that there used to be a similar thing which was called "Microsoft POSIX Subsystem" also.
- mattkrause 6y agoWindows Subsystem for (running) Linux (programs).
- adolfojp 6y agoIt was a legal / trademark concern. Naming the thing Linux something something was deemed too risky so they went with Windows something something instead.
- ilyas121 6y agoAh makes sense
- int_19h 6y agoThe spiritual predecessor to WSL was something called (at different times) Windows Services for Unix, and Windows Subsystem for Unix-based Applications.
- IronWolve 6y agoToo bad you need wsl2, i hate running hyperv and the apps that dont play nice with it.
- jstarks 6y agoWhich apps are broken for you? We’ve been working with VMware and Google to ensure their apps well with Hyper-V, but I know there are still some gaps.
- psykotic 6y agoThe new release of VMware Workstation now works with Hyper-V as its hypervisor but a bunch of people (and I'm one of them) have experienced massive, unacceptable performance regressions for VM guests. I had to disable Hyper-V and hence stop using WSL2 until it's resolved. If the performance issues are intrinsic this will probably be a permanent showstopper for people who rely on VMware or Virtual Box. Hopefully this gets sorted out one way or another.
- mattip 6y agoI have the opposite setup: Linux is my primary os and I have windows on a separate ssd that I can either dual boot into or use in qemu from Linux. It gets used once a month or so. I don’t game, so maybe I am the wrong demographic, but I don’t miss anything from windows. All my document work (even right-to-left languages) works well on Linux, default Ubuntu gnome. I use two monitors, with different resolution. What am I missing? I spend my time in vim/cli, slack, github in Firefox, and email on thunderbird.
- chris11 6y agoFor work there's a bunch of random applications I need to use. Most documentation/IT support assumes you are using the standard macbook/windows machine. I'd rather not do the work of trying to use linux as my main OS. Plus I'm regularly writing code for mac/linux/windows hosts. Overall I like Windows as an OS, but I like using a linux command line for development. Windows with WSL2 meets most of my dev needs.
- jentist_retol 6y ago>Most documentation/IT support assumes you are using the standard macbook/windows machine. Frankly, learning and intuitively understanding how many software components work is a valuable skill. "do the work" is steep up front but yields dividends, imo. Personally, I use WSL2, as well.
- jentist_retol 6y agoLast time I tried it, I installed Ubuntu 18.04LTS, updated, installed the recommended graphics driver, and then the machine would not boot after that. I recently tried 20.04LTS on a laptop, with an external GPU over tb3 - it works! However, I really struggled to rectify the display density of my external 4k with the laptop's built in 1080p. I had other show stopper bugs, besides bad scaling, however. :( What you're missing is the ability to open a game for a quick session while keeping your work open in the background. What you're missing is that desktop linux is famously unpolished, and worse, brittle. There's a list of known(!) issues with desktop linux that some guy updates - currently it has over 100 entries. What you're missing is your system continuing to work after major updates (Windows 10's relatively recent and rare "big oops" bugs aside lol). Personally, I use w10 pro with deferred feature updates to mitigate this, which is kinda messed up but there you go. I simply can't afford an update to knock my desktop out, which has happened to me a few times with desktop linux. What you're missing is that "works for me" works for you, but not for me. In case you're wondering why I keep trying desktop linux, it's because what I'm missing is an open, free, libre, privacy-respecting desktop. These are values I take seriously enough that I pay yearly estimated license fees to the open source components I use in the form of donations.
- codezero 6y agoI'm getting the feeling that this is part of a longer term partnership where Microsoft acquires Nvidia, but for a weird reason: Azure cloud.
- alkonaut 6y agoWhat happens in Linux when the video driver crashes (restarts) in Windows?
- awadheshv 6y agowsl2 really is a game changer for people working on ml.
- husamia 6y agoDocker containers will work with the GPU?