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

Use GPU for the Container Service #51

Open
p-j-smith opened this issue Jul 17, 2023 · 9 comments
Open

Use GPU for the Container Service #51

p-j-smith opened this issue Jul 17, 2023 · 9 comments

Comments

@p-j-smith
Copy link
Contributor

p-j-smith commented Jul 17, 2023

The workshop uses a container that runs some analysis with Fastsurfer. This requires a GPU to run, so we should change the ec2 instance type we're using for the Container Service

@p-j-smith p-j-smith self-assigned this Jul 17, 2023
@p-j-smith p-j-smith removed their assignment Aug 9, 2023
@p-j-smith
Copy link
Contributor Author

p-j-smith commented Aug 9, 2023

I think a GPU is not required, but the analysis will run significantly faster on GPU

@p-j-smith p-j-smith changed the title Workshop requires GPU to run containers Use GPU for the Container Service Aug 9, 2023
@p-j-smith
Copy link
Contributor Author

Pricing per month if we use CPU vs GPU, and have ec2 instance running continually vs using EKS to launch containers:

  • CPU: 8.48
  • GPU: 624.08
  • CPU + EKS: 74.06
  • GPU + EKS: 151.01

Prices are in $USD

This pricing assumes usage of 40 hours per week (8 hours a day times 5 days per week) when running directly on ec2, and 5 hours per week (1 hour per day time 5 days per week) when running via EKS. The cost of running EKS is $73.00 USD per month ($0.10 USD per hour).

So running the analysis on CPU only (without EKS) is the most cost effective (assuming the usage estimates are accurate). In #44 let's see how long the analysis takes to run on the CPU

xnat-aws-container-service-pricing.pdf

@milanmlft
Copy link
Collaborator

After some test runs for #44, seems that a GPU is indeed required to run FastSurfer. See also #67 (comment)

@p-j-smith
Copy link
Contributor Author

In #67 (comment) you said:

...now I'm getting a new one:

Could not create container from image healthbioscienceideas/fastsurfer:gpu

which command was that for? I just tried running Converts NIFTI to 256 conformed MGZ file on the output from Run dcm2niix on a Scan and got this error:

/fastsurfer/nii_to_mgz.sh: line 27: pydeface: command not found
Deface failed

@milanmlft
Copy link
Collaborator

I had it from that same command

@p-j-smith
Copy link
Contributor Author

I just ran the Defaces a T1 Nifti scan command on the same output from Run dcm2niix on a Scan and it ran okay - it took about 13 minutes.

Then I tried running the DEFACED DATA - Converts defaced NIFTI to 256 conformed MGZ file on the defaced output and got the same error:

/fastsurfer/nii_to_mgz.sh: line 27: pydeface: command not found
Deface failed

We could try using the healthbioscienceideas/pydeface:latest tag of the image rather than healthbioscienceideas/pydeface:minify - the minify version must not have pydeface installed

@milanmlft
Copy link
Collaborator

milanmlft commented Aug 15, 2023

Oh, so you got it to run without a GPU?

OK so I got the same error as you now. So it seems we don't need a GPU after all?
Not sure why it wasn't working before for me... I did destroy and re-deploy the architecture though, so that might have resolved the Could not create container from image healthbioscienceideas/fastsurfer:gpu problem.

@milanmlft
Copy link
Collaborator

Created another issue for this #70

@milanmlft
Copy link
Collaborator

Since it doesn't seem essential after all, maybe we could provide it as an option? In #72 I created separate commands to run FastSurfer on a GPU or CPU, so we could let users decide which one they want to use.

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