Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubleshoot Guide: Run with WSL (Windows) #148

Closed
ronnypollak opened this issue May 31, 2024 · 6 comments
Closed

Troubleshoot Guide: Run with WSL (Windows) #148

ronnypollak opened this issue May 31, 2024 · 6 comments

Comments

@ronnypollak
Copy link

As I faced some problems to make the demo run with WSL on Windows I want to present the steps I have followed to make it work in case anyone else is facing the same issues:

I prepared the repo locally on my Windows (clone the project, copy the weights and the demo data), then switch to the WSL and mount the direction of the project.

My steps in WSL were as follows:

  1. Initialize WSL with Ubuntu 24.04
  2. Install the Docker Engine: https://docs.docker.com/engine/install/ubuntu/
  3. Pull the docker image
  4. You can then try to run the run_container.sh, if it works congrats if not you could have one of these issues:

Mount Error:

Fehler: access control disabled, clients can connect from any host docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: mount error: file creation failed: /var/lib/docker/overlay2/cbf69331937d06db8d5e99606517e3e05d95d5fca454e5551271dd1a924c6caa/merged/usr/lib/x86_64-linux-gnu/[libnvidia-ml.so](http://libnvidia-ml.so/).1: file exists: unknown 

--> NVIDIA/nvidia-container-toolkit#289 (comment)
--> What I did here was:

  1. Create a new dockerfile, foundationpose-modified:
FROM foundationpose

RUN rm -rf /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 /usr/lib/x86_64-linux-gnu/libcuda.so.1
  1. Create or modify: run_container-modified:
#!/bin/bash

# Remove any existing container named foundationpose
docker rm -f foundationpose

# Set the current directory
DIR=$(pwd)/../

# Allow connections to the X server
xhost +

# Run the Docker container using the modified image
docker run --gpus all --env NVIDIA_DISABLE_REQUIRE=1 -it --network=host --name foundationpose \
  --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
  -v $DIR:$DIR -v /home:/home -v /mnt:/mnt -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp:/tmp \
  --ipc=host -e DISPLAY=${DISPLAY} -e GIT_INDEX_FILE \
  foundationpose-modified bash -c "cd $DIR && bash"
  1. build it: build -t foundationpose-modified .
  2. Then run the modified run_container-modified.sh
  3. run the build_all.sh
  4. run the demo

Thank you to @wenbowen123 for this project and for pointing to resources in other, related issues.

@ronnypollak
Copy link
Author

ronnypollak commented May 31, 2024

@wenbowen123 Should I move this issue to closed or delete it and post it elsewhere?

@bblumberg
Copy link

For what it is worth, other than dealing with the 4080/4090 issue, I had no issues getting it to run on wsl2. That said, I followed these instructions to set up gpu acceleration in wsl2: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gpu-compute. Most notably I followed the instructions for using docker desktop.

Just as a heads up, you may need to rebuild the wsl2 kernel if you want to use a camera with wsl2.

@ronnypollak
Copy link
Author

@bblumberg Thank you for the info. I will definitely check out the instructions. Have you already rebuilt your wsl2 kernel and tried it out with a camera?

@bblumberg
Copy link

Yup to use cameras with wsl2, you will typically need to rebuild the wsl2 kernel as the default version of Ubuntu 22.04 does not include video drivers. This sounds more complicated than it actually is in practice if you have a clear set of directions. Here are the instructions that I followed and they worked fine for me. (https://medium.com/software-dev-explore/wsl2-webcam-23c1dc9408ae )

@wenbowen123
Copy link
Collaborator

@ronnypollak thanks a lot for contributing this! Will link to this in readme.

@ahiyantra
Copy link

ahiyantra commented Aug 14, 2024

@ronnypollak @bblumberg

Would it be possible for y'all to assist me with my issue? (note: it's all resolved now; please check the reporting thread linked below for the details)

my reporting thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants