<div dir="ltr"><div dir="ltr">Hi Guillaume, and Eric<div><br></div><div>Thanks for the tip. The temporary assignment of visiable GPU devices is exactly what I want to get. Though it looks like the recipe of using 'CUDA_VISIBLE_DEVICES=1' does not work at least on my ubuntu 20.04 with chimerax 1.0. I also tried Eric's suggestion just now. </div><div><br></div><div><font face="monospace">sf@sf-MS-7C35:~$ echo $CUDA_VISIBLE_DEVICES<br><br>sf@sf-MS-7C35:~$ export CUDA_VISIBLE_DEVICES=1<br>sf@sf-MS-7C35:~$ echo $CUDA_VISIBLE_DEVICES<br>1<br>sf@sf-MS-7C35:~$ chimerax &<br>[1] 673010<br>sf@sf-MS-7C35:~$ nvidia-smi<br>Tue Nov 24 12:09:28 2020 <br>+-----------------------------------------------------------------------------+<br>| NVIDIA-SMI 450.66 Driver Version: 450.66 CUDA Version: 11.0 |<br>|-------------------------------+----------------------+----------------------+<br>| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |<br>| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |<br>| | | MIG M. |<br>|===============================+======================+======================|<br>| 0 GeForce RTX 207... Off | 00000000:2D:00.0 On | N/A |<br>| 60% 74C P2 191W / 215W | 763MiB / 7974MiB | 99% Default |<br>| | | N/A |<br>+-------------------------------+----------------------+----------------------+<br>| 1 GeForce RTX 207... Off | 00000000:2E:00.0 Off | N/A |<br>| 0% 34C P8 14W / 215W | 14MiB / 7982MiB | 0% Default |<br>| | | N/A |<br>+-------------------------------+----------------------+----------------------+<br> <br>+-----------------------------------------------------------------------------+<br>| Processes: |<br>| GPU GI CI PID Type Process name GPU Memory |<br>| ID ID Usage |<br>|=============================================================================|<br>| 0 N/A N/A 1343 G /usr/lib/xorg/Xorg 35MiB |<br>| 0 N/A N/A 2338 G /usr/lib/xorg/Xorg 174MiB |<br>| 0 N/A N/A 2463 G /usr/bin/gnome-shell 233MiB |<br>| 0 N/A N/A 671633 G ...AAAAAAAAA= --shared-files 45MiB |<br>| 0 N/A N/A 672504 C /opt/conda/bin/python 229MiB |<br>| 0 N/A N/A 673010 G chimerax 33MiB |<br>| 1 N/A N/A 1343 G /usr/lib/xorg/Xorg 4MiB |<br>| 1 N/A N/A 2338 G /usr/lib/xorg/Xorg 4MiB |<br>+-----------------------------------------------------------------------------+</font><br></div><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">After setting the environment variable and running chimerax in the same session, it still runs on GPU 0. </font></div><div><font face="arial, sans-serif">I also tried a recipe that defines </font></div><div><font face="arial, sans-serif">"export NVIDIA_VISIBLE_DEVICES=1,</font></div><div><font face="arial, sans-serif">export CUDA_VISIBLE_DEVICES=0" shared here [</font><a href="https://stackoverflow.com/a/58445444">https://stackoverflow.com/a/58445444</a><span style="font-family:arial,sans-serif">]. </span><span style="font-family:arial,sans-serif">It does not work either. </span></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">To ChimeraX developers,</span></div><div><span style="font-family:arial,sans-serif">I wonder how ChimeraX is exposed to CUDA. I have basis in CUDA computing and using CUDA in Python. If you can give some clues, that would be great.</span></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">Best,</span></div><div><span style="font-family:arial,sans-serif">Shasha</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 24, 2020 at 12:18 PM Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu">pett@cgl.ucsf.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">To supplement Guilaume's very helpful answer, you could make an alias to reduce the typing involved, and you could put the alias in your shell startup file. For the bash shell, the syntax for making an alias named 'cx' for the command would be:<div><br></div><div><span style="white-space:pre-wrap"> </span>alias cx="CUDA_VISIBLE_DEVICES=1 chimerax"</div><div><br></div><div>Other shells have similar (but not necessarily identical) syntaxes.</div><div><br></div><div><div>--Eric</div><div><br></div><div><span style="white-space:pre-wrap"> </span>Eric Pettersen</div><div><span style="white-space:pre-wrap"> </span>UCSF Computer Graphics Lab</div><div><br></div><div><br><blockquote type="cite"><div>On Nov 24, 2020, at 12:09 AM, Guillaume Gaullier <<a href="mailto:guillaume@gaullier.org" target="_blank">guillaume@gaullier.org</a>> wrote:</div><br><div><div style="overflow-wrap: break-word;"><div>Hello,</div><div><br></div>You can restrict which of your GPUs ChimeraX will be able to detect by starting it from the shell like so:<div><br></div><div>CUDA_VISIBLE_DEVICES=1 chimerax</div><div><br></div><div>replace 1 with the device number you want, this is the same one as reported by nvidia-smi. This will work until you close ChimeraX, next time you run it you still need to add the environment variable before the "chimerax" command.</div><div><div><br></div><div>You can also make this environment variable stay around until you close the shell session like so:</div><div><br></div><div>export CUDA_VISIBLE_DEVICES=1</div><div><br></div><div>then you can open ChimeraX from the same shell session, close it, and reopen with only the "chimerax" command and it should still only see the GPU you indicated.</div><div><br></div><div>When you close and restart your shell, you will have to export the environment variable again. I don’t recommend adding the export to your ~/.bashrc or other shell initialization script, because then all your shell sessions will have this environment variable set, so all the commands you run will only see this GPU, which is probably not what you want. It is less likely to get in your way down the road if you only set this environment variable for the duration of a shell you opened specifically to run ChimeraX from.</div><div><br></div><div>I hope this helps,</div><div>
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="overflow-wrap: break-word;"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>Guillaume</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div></div></div></div></div></div></div></div></div></div>
</div>
<div><br><blockquote type="cite"><div>On 24 Nov 2020, at 01:51, Shasha Feng <<a href="mailto:shaalltime@gmail.com" target="_blank">shaalltime@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div dir="ltr">Hi Tom,<div><br></div><div>Sorry about not clarifying my operating system. I am using ubuntu 20.04 with two NVIDIA GPU cards. </div><div>Do I need to change OpenGL setting or reconfigure the nvidia setting? </div><div><br></div><div>Thanks,</div><div>Shasha</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 23, 2020 at 6:58 PM Tom Goddard <<a href="mailto:goddard@sonic.net" target="_blank">goddard@sonic.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>Hi Shasta,</div><div><br></div>ChimeraX has no way to select which GPU it uses. The operating system or opengl driver decides. You didn't mention which operating system you are using. Here is an example of how to set the default OpenGL GPU in Windows.<div><br></div><div><span style="white-space:pre-wrap"> </span><a href="https://www.techadvisor.co.uk/how-to/pc-components/how-set-default-graphics-card-3612668/" target="_blank">https://www.techadvisor.co.uk/how-to/pc-components/how-set-default-graphics-card-3612668/</a></div><div><br></div><div> Tom</div><div><br><div><br><blockquote type="cite"><div>On Nov 23, 2020, at 2:38 PM, Shasha Feng <<a href="mailto:shaalltime@gmail.com" target="_blank">shaalltime@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div>Hi,</div><div><br></div><div>Is there any way to specify which GPU device for ChimeraX to run on? Currently, it uses the default GPU 0, which can disturb the existing jobs. Thanks.</div><div><br></div><div>Best,</div><div>Shasha</div><div><br></div></div>
_______________________________________________<br>ChimeraX-users mailing list<br><a href="mailto:ChimeraX-users@cgl.ucsf.edu" target="_blank">ChimeraX-users@cgl.ucsf.edu</a><br>Manage subscription:<br><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" target="_blank">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br></div></blockquote></div><br></div></div></blockquote></div><div><br></div></div>
_______________________________________________<br>ChimeraX-users mailing list<br><a href="mailto:ChimeraX-users@cgl.ucsf.edu" target="_blank">ChimeraX-users@cgl.ucsf.edu</a><br>Manage subscription:<br><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" target="_blank">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>ChimeraX-users mailing list<br><a href="mailto:ChimeraX-users@cgl.ucsf.edu" target="_blank">ChimeraX-users@cgl.ucsf.edu</a><br>Manage subscription:<br><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" target="_blank">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br></div></blockquote></div><br></div></div></blockquote></div><div><br></div></div>