I am trying to do this step: https://degauss.org/troubleshooting.html#Parallel_Computing_on_Windows and I am completely new to docker and linux subsystem on windows (using Ubuntu 22.04.1) which requires changing the cpus and ram used in Docker. However as noted in the troubleshooting guide and on the Docker advanced suboption in resources (in settings) I need to change the .wslconfig file. I followed the microsoft tutorial (https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig) but when accesing my user profile, there is no file or folder with .wslconfig. Any advice on how to fix this?
Asked
Active
Viewed 2.2k times
2
ineedhelp
- 23
- 1
- 1
- 3
-
Since it’s missing you can create it, if the contents are invalid, it will be ignored. *If the file is missing or malformed (improper markup formatting), WSL will continue to launch as normal without the configuration settings applied.* which is from the link you provided – Ramhound Jan 28 '23 at 03:27
-
@Ramhound, so if I create the folder, would I then be able to change the CPU and RAM used so I can proceed with the parallel computing step from the first link? Is there anything I should put in the folder? Docker does not let me change the CPU or RAM usage unless I change `.wslconfig` – ineedhelp Jan 28 '23 at 04:30
-
@Ramhound apologies for the follow up comment, at the bottom of the microsoft link there is an example, what type of file should I save it as and for an Ubuntu subsystem would the CPU I want it to use = 1? – ineedhelp Jan 28 '23 at 04:33
-
The filename is [`.wslconfig`](https://github.com/MicrosoftDocs/wsl/blob/main/WSL/wsl-config.md) – Ramhound Jan 28 '23 at 05:30
-
@Ramhound and the file type is a text document? processors = CPU? – ineedhelp Jan 28 '23 at 05:34
-
The contents of the file, which has a filename of exactly `.wslconfig` does indeed contain text. Why are you not using `wsl.conf` instead of `.wslconfig`? `.wslconfig` overrides the `wsl.conf`. It seems you have some research to do, you are asking me questions, and I have linked you to the documentation on the file in question. The answer to your question about limiting ALL WSL2 distributions to a single processor would be `processors=1` – Ramhound Jan 28 '23 at 05:35
-
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/142404/discussion-between-ramhound-and-ineedhelp). – Ramhound Jan 28 '23 at 05:44
1 Answers
5
Any advice on how to fix this?
Create a file called: .wslconfig in the %UserProfile% directory.
The tutorial you are following suggests creating a file called .wslconfig contained within `%UserProfile% with the following contents:
[wsl2]
memory=4GB # Limits VM memory in WSL 2 to 4 GB
processors=2 # Makes the WSL 2 VM use two virtual processors
Since you are unlikely compiling and creating your own WSL2 Linux kernel, I have removed the line that set the custom kernel that ALL WSL2 distributions would use.
The documentation on wsl.conf and .wslconfig can be located here.
Ramhound
- 41,734
- 35
- 103
- 130