make dynamic_loader more safe and enhance error message on windows #28117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
Others
Describe
修改了Windows下动态库加载CUDA10.1/10.2的bug,同时增强鲁棒性与报错信息;
由于Nvidia官方对CUDA的动态库命名方法多变,例如:
curand64_100.dll
curand64_10.dll
当前Windows使用了装饰的
LoadLibrary
函数来加载动态库,鲁棒性较低,这里进行了修复,使之更安全:;
来指定多个可能的动态库名字,例如curand64_102.dll;curand64_10.dll
,会逐个加载,直到全部没有才失败;