pyscf / gpu4pyscf

A plugin to use Nvidia GPU in PySCF package
GNU General Public License v3.0
114 stars 21 forks source link

num_threads #122

Open sehun1618 opened 5 months ago

sehun1618 commented 5 months ago

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?

wxj6000 commented 5 months ago

@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.

sehun1618 commented 5 months ago

Thanks.

I have another question.

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

wxj6000 commented 5 months ago

@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