gpu4pyscf icon indicating copy to clipboard operation
gpu4pyscf copied to clipboard

num_threads

Open sehun1618 opened this issue 1 year ago • 3 comments

Hi. Thanks for developing useful program.

I have some issue about lib.num_threads on gpu4pyscf.

No matter what calculation I do (DFT, HF, CCSD...) no matter what value of num_threads I enter, it only actually uses one.

Is there anything you can tell me about this issue?

sehun1618 avatar Mar 13 '24 15:03 sehun1618

@sehun1618 It sounds expected. For better performance, the CPU workload in GPU4PySCF is significantly minimized. Most OpenMP tasks (usually heavy) in PySCF have been offloaded to GPU. Although OpenMP is used in some tasks, the execution time is probably unnoticeable.

wxj6000 avatar Mar 13 '24 17:03 wxj6000

Thanks.

I have another question.

If i got more than 2 GPU units, how can i allocate specific GPU unit for computation?

sehun1618 avatar Mar 20 '24 04:03 sehun1618

@sehun1618 In a multi-GPU environment, the safest way is to run it with docker. https://docs.docker.com/config/containers/resource_constraints/#gpu

Alternatively, you can try to specify the device with CuPy api. We haven't tested it globally. If you find any issues, please let us know. https://docs.cupy.dev/en/stable/user_guide/basic.html#current-device

wxj6000 avatar Mar 20 '24 17:03 wxj6000