Using Photon Sharing with Multiple GPUs

28 views
Skip to first unread message

Rooaa Shanshal

unread,
Mar 5, 2025, 2:55:30 PMMar 5
to mcx-users

Dear Dr. Fang,

I’m currently working on generating SFDI reflectance images using the photon-sharing setting in MCX. I’ve noticed an issue where the reflectance image scales appear to be inversely related to the number of GPUs utilized, despite using the same random seed for all runs, which ensures that my randomized values remain consistent.

Specifically, when I increase the number of GPUs, the scale of the reflectance images seems to decrease roughly by a factor equal to the number of GPUs used. I thought this was interesting to note because I would expect that the total number of photons used, and subsequently the image scale, to remain constant across the different GPU settings.

For some context, I’m running MCX through MathWorks Cloud Centre which allows me to use machines on AWS with MATLAB installed that can have varying numbers of GPUs accessible.

Here’s a brief overview of my settings:

GPU Options:

I compare reflectance results by setting cfg.gpuid = 1, ‘1100’, ‘1110’, ‘1111’

Simulation Parameters:

Scattering coefficient (tumour & background) = 1.25

Tumour absorption coefficient = 0.0031 – 0.0287 mm-1

Background absorption coefficient = 0.0015 – 0.0060 mm-1

Reflectance results using photon sharing (cfg.srctype = ‘pattern’):

A group of images of numbers and symbols

AI-generated content may be incorrect.

e.g., the max value appears to be ~11 w/ 1 GPU and ~11/[2,3,4] with 2,3,4 GPUs.

Reflectance results without photon sharing (cfg.srctype = ‘fourier’):

A screenshot of a test results

AI-generated content may be incorrect.

e.g., max value stays consistent at ~11.

I’m wondering whether there might be an underlying issue with how photons are accumulated across multiple GPUs when using this setting or if there is a step I might be overlooking.

I also tried running the photon sharing demo (demo_photon_sharing.m) with varying GPU settings, and the scale of the histogram of the pixel index of the photon launch positions seems to also scale down with the number GPUs used.

A group of blue and black bars

AI-generated content may be incorrect.

Could you provide any insights on why this issue is occurring and any recommendations on how I can correct for it? Any advice on how I can have consistent output across different configurations would be very appreciated.

Thanks for your help!

Best,

Rooaa Shanshal

Princess Margaret Cancer Centre, Toronto

 

 

Qianqian Fang

unread,
Sep 7, 2025, 4:34:26 PMSep 7
to mcx-...@googlegroups.com, Rooaa Shanshal

hi Rooaa,

unfortunately I am not able to reproduce this, see

https://github.com/fangq/mcx/issues/240

when testing the demo_photon_sharing.m script with a single or multiple GPUs, the output are consistent and the speeds are linearly accelerated when using multiple GPUs.

Qianqian


On 3/4/25 16:32, Rooaa Shanshal wrote:

You don't often get email from shansh...@gmail.com. Learn why this is important

--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/6f7c071d-abf5-4533-9434-9408bf289df7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages