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

GPU device setting #118

Open
giorgionicola opened this issue Dec 23, 2020 · 3 comments
Open

GPU device setting #118

giorgionicola opened this issue Dec 23, 2020 · 3 comments

Comments

@giorgionicola
Copy link

I am working on a PC with multiple GPU how can I set which device is used by GPU-Voxels?

@cjue
Copy link
Contributor

cjue commented Dec 23, 2020

The GPU selection happens here:
https://github.com/fzi-forschungszentrum-informatik/gpu-voxels/blob/master/packages/gpu_voxels/src/gpu_voxels/helpers/cuda_handling.cu#L102

Default behavior is to select the first device according to Nvidia's sorting, which usually selects the highest performance one, if there are different models.

If you want to modify the behavior, this is the place to do it.

In the upcoming release there will also be a slight improvement for this function, but the general operation stays the same.

GPU-Voxels is designed to use only one GPU, even if there are many available. What is your plan?

@giorgionicola
Copy link
Author

I am simply using a pc shared with other people in the lab that use the GPUs so i would like to determine which gpu to use since some might be already occupied.

I have found just to define the environment variable GPU_VISIBLE_DEVICE on the desired gpu i want to use

@cjue
Copy link
Contributor

cjue commented Jan 11, 2021

Tanks for your input, I didn't know about the CUDA_VISIBLE_DEVICES environment variable.

It allows the restriction of visible GPUs for any CUDA application. please Let me know if you encounter any issues with this.
To monitor the mapping of processes to GPUs you can check the output of nvidia-smi.

For others interested in this feature, NVIDIA describes it here: https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda_visible_devices/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants