-
Notifications
You must be signed in to change notification settings - Fork 314
enhance CUDA support in CP2K easyblock (WIP) #2349
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
base: develop
Are you sure you want to change the base?
Changes from 1 commit
b2b9dc6
9b53c58
f71f992
664d91b
68e15c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,12 +228,30 @@ def configure_step(self): | |
| else: | ||
| options['DFLAGS'] += ' -D__ELPA3' | ||
|
|
||
| # CUDA | ||
| # CUDA support | ||
| # see https://github.com/cp2k/cp2k/blob/master/INSTALL.md#2j-cuda-optional-improved-performance-on-gpu-systems | ||
| cuda = get_software_root('CUDA') | ||
| if cuda: | ||
| options['DFLAGS'] += ' -D__ACC -D__DBCSR_ACC' | ||
| options['LIBS'] += ' -lcudart -lcublas -lcufft -lrt' | ||
| options['NVCC'] = ' nvcc' | ||
| # check GPU architecture(s) to build for | ||
| cuda_cc_sm_vals = self.cfg.template_values.get('cuda_sm_comma_sep') | ||
| if cuda_cc_sm_vals: | ||
| gpu_targets = '--gpu-code=%s' % cuda_cc_sm_vals | ||
| else: | ||
| gpu_targets = '' | ||
|
|
||
| options['DFLAGS'] += ' -D__ACC -D__DBCSR_ACC -D__PW_CUDA -D__GRID_CUDA' | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need easyconfig parameters to opt-out of using |
||
| options['LIBS'] += ' -lcudart -lnvrtc -lcuda -lcublas -lcufft -lrt' | ||
| options['NVCC'] = 'nvcc' | ||
| options['NVFLAGS'] = ' '.join([ | ||
| options['DFLAGS'], | ||
| '-O3', | ||
| '--std=c++11', | ||
| gpu_targets, | ||
| # control host compilers + options | ||
| '-ccbin="%s"' % os.getenv('CXX'), | ||
| '-Xcompiler="%s"' % os.getenv('CXXFLAGS'), | ||
| ]) | ||
| options['GPUVER'] = 'V100' | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is obviously hardcoded, should we auto-detect what the correct value should be for this? Not sure what the significance of this is, actually...
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the point where you said in the call that only a single GPU arch is supported? I just searched the source of CP2K and didn't find any place where this is actually used: https://github.com/cp2k/cp2k/search?q=GPUVER I'd say only the NVFLAGS are required
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this is really required, I tried without it. It's used by the DBCSR component. I have an updated version of this, which I apparently haven't pushed yet, doing that right now (see 68e15c5) |
||
|
|
||
| # avoid group nesting | ||
| options['LIBS'] = options['LIBS'].replace('-Wl,--start-group', '').replace('-Wl,--end-group', '') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a better default, and/or a warning if no CUDA compute capabilities were specified?