Skip to content
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

cudatoolkit 10.1 #18

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions condarecipe10.1/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"%PYTHON%" build.py
if errorlevel 1 exit 1

:: copy nvvm and libdevice into the DLLs folder so numba can use them
mkdir "%PREFIX%\DLLs"
xcopy /s /y "%PREFIX%\Library\bin\nvvm*" "%PREFIX%\DLLs\"
if errorlevel 1 exit 1
xcopy /s /y "%PREFIX%\Library\bin\libdevice*" "%PREFIX%\DLLs\"
if errorlevel 1 exit 1
2 changes: 2 additions & 0 deletions condarecipe10.1/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
python build.py
24 changes: 24 additions & 0 deletions condarecipe10.1/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package:
name: cudatoolkit
# match the package version to the libcudart.so version
version: 10.1.168

build:
number: 0
script_env:
- NVTOOLSEXT_INSTALL_PATH

requirements:
build:
- python >=3
- requests
- 7za # [win]
- conda
- pyyaml

source:
path: ../scripts/

test:
requires:
- numba
28 changes: 28 additions & 0 deletions condarecipe10.1/run_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import sys
import os
from numba.cuda.cudadrv.libs import test, get_cudalib
from numba.cuda.cudadrv.nvvm import NVVM


def run_test():
# on windows only nvvm is available to numba
if sys.platform.startswith('win'):
nvvm = NVVM()
print("NVVM version", nvvm.get_version())
return nvvm.get_version() is not None
if not test():
return False
nvvm = NVVM()
print("NVVM version", nvvm.get_version())
# check pkg version matches lib pulled in
gotlib = get_cudalib('cublas')
# check cufft b/c cublas has an incorrect version in 10.1 update 1
gotlib = get_cudalib('cufft')
lookfor = os.environ['PKG_VERSION']
if sys.platform.startswith('win'):
# windows libs have no dot
lookfor = lookfor.replace('.', '')
return lookfor in gotlib


sys.exit(0 if run_test() else 1)
93 changes: 88 additions & 5 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from conda.exports import download, hashsum_file

config = {}
versions = ['7.5', '8.0', '9.0', '9.1', '9.2', '10.0']
versions = ['7.5', '8.0', '9.0', '9.1', '9.2', '10.0', '10.1']

for v in versions:
config[v] = {'linux': {}, 'windows': {}, 'osx': {}}
Expand Down Expand Up @@ -404,6 +404,78 @@
}


#######################
### CUDA 10.1 setup ###
#######################

cu_101 = config['10.1']
cu_101['base_url'] = "https://developer.nvidia.com/compute/cuda/10.1/Prod/"
cu_101['installers_url_ext'] = 'local_installers/'
cu_101['patch_url_ext'] = ''
cu_101['md5_url'] = "https://developer.download.nvidia.com/compute/cuda/10.1/Prod/docs2/sidebar/md5sum.txt"
cu_101['cuda_libraries'] = [
'cublas',
'cublasLt',
'cudart',
'cufft',
'cufftw',
'curand',
'cusolver',
'cusparse',
'nppc',
'nppial',
'nppicc',
'nppicom',
'nppidei',
'nppif',
'nppig',
'nppim',
'nppist',
'nppisu',
'nppitc',
'npps',
'nvToolsExt',
'nvblas',
'nvgraph',
'nvrtc',
'nvrtc-builtins',
]
# nvjpeg is only available on linux
if sys.platform.startswith('linux'):
cu_101['cuda_libraries'].append('nvjpeg')
cu_101['libdevice_versions'] = ['10']

cu_101['linux'] = {
'blob': 'cuda_10.1.168_418.67_rhel6.run',
'embedded_blob': 'cuda-linux.10.1.168-26218862.run',
'patches': [],
# need globs to handle symlinks
'cuda_lib_fmt': 'lib{0}.so*',
'nvtoolsext_fmt': 'lib{0}.so*',
'nvvm_lib_fmt': 'lib{0}.so*',
'libdevice_lib_fmt': 'libdevice.{0}.bc'
}

cu_101['windows'] = {'blob': 'cuda_10.1.168_425.25_windows.exe',
'patches': [],
'cuda_lib_fmt': '{0}64_10*.dll',
'nvtoolsext_fmt': '{0}64_1.dll',
'nvvm_lib_fmt': '{0}64_33_0.dll',
'libdevice_lib_fmt': 'libdevice.{0}.bc',
'NvToolsExtPath' :
os.path.join('c:' + os.sep, 'Program Files',
'NVIDIA Corporation', 'NVToolsExt', 'bin')
}

cu_101['osx'] = {'blob': 'cuda_10.1.168_mac',
'patches': [],
'cuda_lib_fmt': 'lib{0}.10.1.dylib',
'nvtoolsext_fmt': 'lib{0}.1.dylib',
'nvvm_lib_fmt': 'lib{0}.3.3.0.dylib',
'libdevice_lib_fmt': 'libdevice.{0}.bc'
}


class Extractor(object):
"""Extractor base class, platform specific extractors should inherit
from this class.
Expand All @@ -428,6 +500,7 @@ def __init__(self, version, ver_config, plt_config):
self.cuda_libraries = ver_config['cuda_libraries']
self.libdevice_versions = ver_config['libdevice_versions']
self.cu_blob = plt_config['blob']
self.embedded_blob = plt_config.get('embedded_blob', None)
self.cuda_lib_fmt = plt_config['cuda_lib_fmt']
self.nvtoolsext_fmt = plt_config.get('nvtoolsext_fmt')
self.nvvm_lib_fmt = plt_config['nvvm_lib_fmt']
Expand Down Expand Up @@ -613,7 +686,7 @@ def extract(self):
store = os.path.join(tmpd, store_name)
os.mkdir(store)
for path, dirs, files in os.walk(extractdir):
if 'jre' not in path: # don't get jre dlls
if 'jre' not in path and 'GFExperience' not in path: # don't get jre or GFExperience dlls
for filename in fnmatch.filter(files, "*.dll"):
if not Path(os.path.join(
store, filename)).is_file():
Expand Down Expand Up @@ -659,9 +732,19 @@ def extract(self):
patches = self.patches
os.chmod(runfile, 0o777)
with tempdir() as tmpd:
cmd = [os.path.join(self.src_dir, runfile),
'--toolkitpath', tmpd, '--toolkit', '--silent']
check_call(cmd)
if self.embedded_blob is not None:
with tempdir() as tmpd2:
cmd = [os.path.join(self.src_dir, runfile),
'--extract=%s' % (tmpd2, ), '--nox11', '--silent']
check_call(cmd)
# extract the embedded blob
cmd = [os.path.join(tmpd2, self.embedded_blob),
'-prefix', tmpd, '-noprompt', '--nox11']
check_call(cmd)
else:
cmd = [os.path.join(self.src_dir, runfile),
'--toolkitpath', tmpd, '--toolkit', '--silent']
check_call(cmd)
for p in patches:
os.chmod(p, 0o777)
cmd = [os.path.join(self.src_dir, p),
Expand Down