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

How to run YOLOv8x across multiple GPUs? #1356

Open
1 task done
onefanwu opened this issue Nov 14, 2023 · 5 comments
Open
1 task done

How to run YOLOv8x across multiple GPUs? #1356

onefanwu opened this issue Nov 14, 2023 · 5 comments

Comments

@onefanwu
Copy link

Search before asking

  • I have searched the EvaDB issues and found no similar questions.

Question

When I set ray to True and gpu_ids to '[0,1,2,3,4,5,6,7]', YOLOv8x is only running on cuda:0 and not using other GPUs. Did I set it up wrong?

I use the EvaDB v0.3.8, and the used queries are as follows:

SET ray=True;
SET gpu_ids='[0,1,2,3,4,5,6,7]';
SET batch_mem_size=300000;

DROP TABLE IF EXISTS NightStreet;

LOAD VIDEO 'benchmark/datasets/video/night-street.mp4'
INTO NightStreet;

DROP TABLE IF EXISTS Yolo;

CREATE FUNCTION IF NOT EXISTS Yolo
TYPE  ultralytics
MODEL 'benchmark/models/yolov8x.pt';

SELECT id, Yolo(data).labels
FROM NightStreet
WHERE ['person', 'car'] <@ Yolo(data).labels;
@onefanwu
Copy link
Author

onefanwu commented Nov 14, 2023

When I modified execution_context.py, the parsing of gpu_ids became normal. I don't know if this is the case.

    def _populate_gpu_from_config(self) -> List:
        available_gpus = [i for i in range(get_gpu_count())]
        user_gpus = []
        if isinstance(self._user_provided_gpu_conf, str):
            user_gpus = json.loads(self._user_provided_gpu_conf)
        return list(set(available_gpus) & set(user_gpus))

But still only cuda:0 is used, is there a way to get 8 GPUs to compute YOLO.

@xzdandy
Copy link
Collaborator

xzdandy commented Nov 14, 2023

You need ray to run it across multiple GPUs. Is the issue you mentioned in #1357 fixed?

@onefanwu
Copy link
Author

Hi @xzdandy ,
Is there a tutorial on getting Ray to run on multiple GPUs in EvaDB?
I have fixed this issue ,#1357 .

@onefanwu onefanwu reopened this Nov 15, 2023
@onefanwu
Copy link
Author

When I set CUDA_VISIBLE_DEVICES, Ray seems to work fine.

@xzdandy
Copy link
Collaborator

xzdandy commented Nov 16, 2023

Add instructions about seting CUDA_VISIBLE_DEVICES in https://evadb.readthedocs.io/en/stable/source/overview/faq.html

@xzdandy xzdandy reopened this Nov 16, 2023
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

2 participants