Comments (2)
We decided to do leave this to the user's control via
void galario_use_gpu(int device_id);
from galario.
The issue is still closed, but I 'd like to post this for reference.
I see a funny behaviour on my desktop regarding GPU pinning. The GPU ID at runtime appears different from that read in nvidia-smi
. The reason boils down to the fact that:
nvidia-smi
enumerates in PCI order while, by default, the CUDA driver and runtime APIs do not.
This is the output of nvidia-smi:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.66 Driver Version: 375.66 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GT 730 Off | 0000:01:00.0 N/A | N/A |
| N/A 46C P0 N/A / N/A | 86MiB / 2000MiB | N/A Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce GTX 1060 Off | 0000:02:00.0 Off | N/A |
| 0% 55C P0 25W / 140W | 1MiB / 6072MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
where it seems that gpu 1 is GTX 1060, i.e. the GPGPU-dedicated one, and gpu 0 is GT 730, i.e. the default system graphics card where I don't want to run the CUDA code.
The issue is that ngpus = g_double.ngpus()
sets ngpus=2, which is correct, but g_double.use_gpu(max(0, ngpus-1))=use_gpu(max(0, 1))=use_gpu(1)
makes the script use GT 730 instead of GTX 1060.
The reason of the discrepancy is stated above in quotes. nvidia-smi docs suggest:
"It is recommended that users desiring consistencyuse either UUDI or PCI bus ID, since device enumeration ordering is not guaranteed to be consistent"
This behaviour can be overridden by setting CUDA environment variables, as described here:
http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars
I would leave this just as reference in the case we need to improve the GPU pinning implementation. At the moment, the user can quickly check which GPU is using with
watch -n0.1 nvidia-smi
from galario.
Related Issues (20)
- Add link to paper citations HOT 2
- Coordinate mesh grid
- Update Copyright statement for 2020
- AttributeError: 'function' object has no attribute 'called' HOT 5
- Initial guess for the parameters HOT 1
- galario.c still in source
- travis tests are not reported anymore... HOT 1
- Docs deploy is broken HOT 3
- Perform tests for Python 3.8
- Move to GitHub Actions HOT 2
- Fix numpy warnings
- Move docs to readthedocs
- Update 2020->2021 in Copyright notices
- Trouble building galario for GPU use HOT 7
- Test building GPU version on CUDA 11
- Scaling with CUDA cores and changing GPUs
- Move uvtable.txt to a permanent repository HOT 4
- dxy returned by get_image_size is radians - Fix typo in docs HOT 1
- origin at chi2Image HOT 1
- unrecognized argument when running ctest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from galario.