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

Permit usage of GPUs in docker script #1985

Merged
merged 6 commits into from
Dec 14, 2022
Merged

Permit usage of GPUs in docker script #1985

merged 6 commits into from
Dec 14, 2022

Conversation

xrd
Copy link
Contributor

@xrd xrd commented Dec 14, 2022

This permits you to use GPUs by running the docker script like:

GPU_FLAGS="--gpus all" ./docker-build/run.sh

If you don't set the GPU_FLAGS it is ignored, and therefore does not affect running docker on the CPU for hosts without a GPU.

@mauwii
Copy link
Contributor

mauwii commented Dec 14, 2022

This does unfortunatelly not work on Apple Silicon:

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

but since the script still works when this flag is not set it should be fine.

Copy link
Contributor

@mauwii mauwii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add this flag to the docs, with a short description when to use

docker-build/run.sh Outdated Show resolved Hide resolved
@xrd
Copy link
Contributor Author

xrd commented Dec 14, 2022

This does unfortunatelly not work on Apple Silicon:

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

but since the script still works when this flag is not set it should be fine.

I wonder if you can use something like --gpus mps and get it to work on Apple Silicon. I can try tomorrow on my M1.

Copy link
Contributor

@mauwii mauwii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thx for contributing!

@mauwii mauwii enabled auto-merge (squash) December 14, 2022 04:37
@mauwii
Copy link
Contributor

mauwii commented Dec 14, 2022

This does unfortunatelly not work on Apple Silicon:
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
but since the script still works when this flag is not set it should be fine.

I wonder if you can use something like --gpus mps and get it to work on Apple Silicon. I can try tomorrow on my M1.

good Idea, but unfortunatelly not:
invalid argument "mps" for "--gpus" flag: count must be an integer: strconv.Atoi: parsing "mps": invalid syntax

@mauwii mauwii merged commit 5d20f47 into invoke-ai:main Dec 14, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants