Megvii-BaseDetection / Megvii-BaseDetection/YOLOX

How to specify the cuda device in multiple GPU machine?

Open
#438 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

My machine has two GPU cards. I want to train the model with only the cuda:1.

I have set the CUDA_VISIBLE_DEVICES=1. But the occupy_mem function still calculate the mem of device cuda:0.
https://github.com/Megvii-BaseDetection/YOLOX/blob/3bfac8f843791f007cb9cc7733e6e831f753e7d7/yolox/core/trainer.py#L161-L162

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read yolox/core/trainer.py around lines 161-162 first, then inspect how the selected CUDA device is represented when CUDA_VISIBLE_DEVICES is set. Reproduce the two-GPU case and verify that occupy_mem reports the intended device without affecting training.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.