Move driver and nvrtc cython and internal layers to new generator#1972
Move driver and nvrtc cython and internal layers to new generator#1972mdboom wants to merge 14 commits intoNVIDIA:mainfrom
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
1 similar comment
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
|
/ok to test |
|
/ok to test |
1 similar comment
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
| from libc.stdint cimport uintptr_t | ||
| from cpython cimport PyUnicode_AsWideCharString, PyMem_Free | ||
|
|
||
| # You must 'from .utils import NotSupportedError' before using this template |
There was a problem hiding this comment.
Note to self: check if this is from cybind template
| cdef int err, driver_ver = 0 | ||
|
|
||
| # Load driver to check version | ||
| handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) |
There was a problem hiding this comment.
Q: why don't we use pathfinder here?
| raise RuntimeError("Failed to get __cuGetProcAddress_v2") | ||
| _F_cuGetProcAddress_v2 = <__cuGetProcAddress_v2_T>__cuGetProcAddress_v2 | ||
|
|
||
| if os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0): |
There was a problem hiding this comment.
Wouldn't this evaluate to True for export CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM=0?
>>> if '0': print(123)
...
123| # Get latest __cuGetProcAddress_v2 | ||
| global __cuGetProcAddress_v2 | ||
| __cuGetProcAddress_v2 = dlsym(handle, 'cuGetProcAddress_v2') | ||
| if __cuGetProcAddress_v2 == NULL: | ||
| raise RuntimeError("Failed to get __cuGetProcAddress_v2") | ||
| _F_cuGetProcAddress_v2 = <__cuGetProcAddress_v2_T>__cuGetProcAddress_v2 |
There was a problem hiding this comment.
IIRC the old code has a path where we do dlsym to get unversioned symbols, is it no longer relevant?
| cdef int err, driver_ver = 0 | ||
|
|
||
| # Load driver to check version | ||
| handle = LoadLibraryExW("nvcuda.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32) |
This is a continuation of the work in #1900. Now adds
driverto the mix and bothnvrtcanddriverare generated from the "real" new generator.