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 acceleration #159

Open
mrba59 opened this issue Feb 4, 2025 · 1 comment
Open

GPU acceleration #159

mrba59 opened this issue Feb 4, 2025 · 1 comment

Comments

@mrba59
Copy link

mrba59 commented Feb 4, 2025

Hello i still don't know if the models available use GPU acceleration or full cpu. My problem is that when i am running inference on a remote server, the cpu load explode and make all process killed. Even for my collegues ...

I tried this code

t1 = ants.image_read("1_OFSEP_defaced.nii.gz")
flair = ants.image_read("1_flair_to_t1_registered.nii.gz")
wmh = antspynet.sysu_media_wmh_segmentation(flair, t1, verbose=True)

and i get this message from tensorflow

2025-02-04 15:17:57.006333: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1960] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...

I have installed tf == 2.13.1 with cuda 11.8. Is it normal that the model is not using GPU ?

Thanks

@ntustison
Copy link
Member

ntustison commented Feb 4, 2025

Do you explicitly set the number of threads?

import tensorflow as tf

# Set the number of threads for intra-op parallelism (within an operation)
tf.config.threading.set_intra_op_parallelism_threads(4)

# Set the number of threads for inter-op parallelism (between operations)
tf.config.threading.set_inter_op_parallelism_threads(2)

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