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

Cuda not working in docker container #2

Closed
javilinos opened this issue May 14, 2023 · 6 comments
Closed

Cuda not working in docker container #2

javilinos opened this issue May 14, 2023 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@javilinos
Copy link
Owner

Hi @omichel, I am trying to load a model composed by a CNN->LSTM->Policy trained using PPO. However, even If I set the parameter device=th.device('cpu'), it is not working as it seems that the feature extractor (cnn) constructor is ignoring this parameter in the SB3 implementation. I tried to install cuda in the container by installing pytorch which installs cuda as a dependency. Any tips on how I can configure the dockerfile so that the container succesfully configure cuda for this purpose if this is possible would be very appretiated. I will try to debug the issue meanwhile. Thanks.

@javilinos javilinos added the help wanted Extra attention is needed label May 14, 2023
@javilinos
Copy link
Owner Author

Solved. Now I have SB3 bug which I'll solve myself. Sorry for the actions mess, new to Docker.

@omichel
Copy link
Collaborator

omichel commented May 15, 2023

Nice to read. 😃

@omichel
Copy link
Collaborator

omichel commented May 15, 2023

It seems your Dockerfile could be made faster by building it FROM cyberbotics/webots.cloud:R2023a-ubuntu20.04-numpy which is actually defined here, and inherits from the main webots Dockerfile which in turn is created FROM nvidia/cuda:11.8.0-base-ubuntu22.04 base image. But maybe you actually need version 12 instead of version 11.8.0?

@javilinos
Copy link
Owner Author

javilinos commented May 15, 2023

Thanks for the tip, for now it is cached but when I change my Dockerfiile (which I will because I'm installing different versions of SB3 and SB3-contriib in the container than my system) I will change the image too. I became a little crazy trying to get it to work but at the end I was just missing these sentences:

  • ENV NVIDIA_VISIBLE_DEVICES all
  • ENV NVIDIA_DRIVER_CAPABILITIES compute,utility

Thanks!

@omichel
Copy link
Collaborator

omichel commented May 15, 2023

If you don't mind we will add this to the main Webots Dockerfile, so that you won't have to bother any more about this problem in the future. See my PR here.

@javilinos
Copy link
Owner Author

Of course, go ahead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants