Hi Guillaume, and Eric
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.
sf@sf-MS-7C35:~$ echo $CUDA_VISIBLE_DEVICES
sf@sf-MS-7C35:~$ export CUDA_VISIBLE_DEVICES=1
sf@sf-MS-7C35:~$ echo $CUDA_VISIBLE_DEVICES
1
sf@sf-MS-7C35:~$ chimerax &
[1] 673010
sf@sf-MS-7C35:~$ nvidia-smi
Tue Nov 24 12:09:28 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.66 Driver Version: 450.66 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce RTX 207... Off | 00000000:2D:00.0 On | N/A |
| 60% 74C P2 191W / 215W | 763MiB / 7974MiB | 99% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 1 GeForce RTX 207... Off | 00000000:2E:00.0 Off | N/A |
| 0% 34C P8 14W / 215W | 14MiB / 7982MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1343 G /usr/lib/xorg/Xorg 35MiB |
| 0 N/A N/A 2338 G /usr/lib/xorg/Xorg 174MiB |
| 0 N/A N/A 2463 G /usr/bin/gnome-shell 233MiB |
| 0 N/A N/A 671633 G ...AAAAAAAAA= --shared-files 45MiB |
| 0 N/A N/A 672504 C /opt/conda/bin/python 229MiB |
| 0 N/A N/A 673010 G chimerax 33MiB |
| 1 N/A N/A 1343 G /usr/lib/xorg/Xorg 4MiB |
| 1 N/A N/A 2338 G /usr/lib/xorg/Xorg 4MiB |
+-----------------------------------------------------------------------------+
After setting the environment variable and running chimerax in the same session, it still runs on GPU 0.
I also tried a recipe that defines
"export NVIDIA_VISIBLE_DEVICES=1,
To ChimeraX developers,
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.
Best,
Shasha