Pros and cons of CUDA on Linux vs Windows?
I'm using both operating systems (Fedora 13 and Windows 7) for different purposes, but I'm going into GPU computing using CUDA C/C++. I've read about the Parallel Nsight plugin for Visual Studio and it seems like an amazing environment to develop in. Ho开发者_StackOverflowwever, Linux has always had a greater range of of tools and GPU supercomputers usually do use Linux. Anyway, I'd like to know the pros and cons from anyone whose used either or both of the platforms. In case anyone is wondering, it's a dual-boot system and I'm going to install a GTX 470 for GPU debugging into my extra PCI express slot. Please no flame wars...
The NVidia tools on windows are nice.
The reason supercomputers use Linux is that the windows client license on 10,000 nodes gets pricey! There are also tradiationally a bunch of better tools to manage Linux clusters.
There is a general performance hit on windows just because there is lots of gui stuff you can't turn off. We measured 10-15% lower performance for a CPU bound task vs Linux running a command line.
The actual performance inside the Cuda task on the GPU 'should' be the same.
If you are going to be using cuda code for production software, you might as well do it in the environment you are most friendly with.
But if you are looking at a performance point of view, and the time taken for a build, it would be best to use Linux (if you are comfortable with Make).
Ease of use will certainly depend on your experience. But assuming you have equal experience on Windows and Linux, please find pros/cons below.
In summary, Linux will probably have less friction and fewer limitations. However, if you are on a Windows OS and don't want to dual-boot Linux, it may be worth it to use Windows or to compromise with WSL2. I've got CUDA development up and running on Linux multiple times (sometimes with a little heartache) but abandoned a Windows setup due to issues below. I will dual-boot Linux instead.
Linux
- Most developers seem to use it so there will be better support in the NVIDIA forums, more examples for set up with VSCode etc.
- Building programs e.g. the CUDA samples have a very explicit make file which gets a lot of use, plenty of video and other references to using it.
- Supports all CUDA features
- Matches the target production system in most cases, most production workloads will be on Linux
Windows
- The toolkit installation is fairly straight-forward
- The toolkit includes NSight productivity tools but you need to have Visual Studio (rather than VS Code) installed for them all to auto-install
- Using Visual Studio is quite intuitive to build and run the solutions
- Encountered one bug during the solution build for the CUDA samples, missing files fixed by https://dominoc925.blogspot.com/2021/03/cuda112props-not-found-in-visual-studio.html
- However, cannot get the CUDA runtime 11.8 template to load in Visual Studio to do actual dev. I tried instructions here for 11.6 but no dice. https://forums.developer.nvidia.com/t/cuda-11-6-missing-project-templates-in-visual-studio-2022/200594/3
- Ultimately most content out there is targetted to Linux which makes a Windows environment a lonely and difficult setup!
WSL2
- Maybe it's a decent compromise as you can avail of most of Linux functionality and content out there
- But, the installation is a little trickier. As per https://docs.nvidia.com/cuda/wsl-user-guide/index.html, you need to install the CUDA toolkit within WSL2 but be careful not to install the one with the driver.
- There are some limitations as per above link, e.g. profiling is not supported
精彩评论