Skip to content

Conversation

@rwgk
Copy link
Collaborator

@rwgk rwgk commented Apr 11, 2025

Description

WIP

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Apr 11, 2025

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.

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 11, 2025

/ok to test

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Apr 11, 2025

/ok to test

@rwgk, there was an error processing your request: E1

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 11, 2025

/ok to test 7be2b78

@github-actions
Copy link

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 15, 2025

/ok to test

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 15, 2025

/ok to test

rwgk added 2 commits April 15, 2025 19:50
…cal`, no `sub-packages`."

This reverts commit d499806.

Problem observed:

```
/usr/bin/docker exec  1b42cd4ea3149ac3f2448eae830190ee62289b7304a73f8001e90cead5005102 sh -c "cat /etc/*release | grep ^ID"
Warning: Failed to restore: Cache service responded with 422
/usr/bin/tar --posix -cf cache.tgz --exclude cache.tgz -P -C /__w/cuda-python/cuda-python --files-from manifest.txt -z
Failed to save: Unable to reserve cache with key cuda_installer-linux-5.15.0-135-generic-x64-12.8.0, another job may be creating this cache. More details: This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP. For more information: https://gh.io/gha-cache-sunset
Warning: Error during installation: Error: Unable to locate executable file: sudo. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
Error: Error: Unable to locate executable file: sudo. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
```
…ws, and report exceptions as failures, except for cudart
@rwgk
Copy link
Collaborator Author

rwgk commented Apr 16, 2025

/ok to test

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 16, 2025

/ok to test

…e, cublas (experiment to see if that resolves the only Windows failure)

Test (win-64, Python 3.12, CUDA 12.8.0, Runner default, CTK wheels) / test

```
================================== FAILURES ===================================
________________________ test_find_and_load[cusolver] _________________________

libname = 'cusolver'

    @pytest.mark.parametrize("libname", path_finder.SUPPORTED_LIBNAMES)
    def test_find_and_load(libname):
        if sys.platform == "win32" and libname == "cufile":
            pytest.skip(f'test_find_and_load("{libname}") not supported on this platform')
        print(f'\ntest_find_and_load("{libname}")')
        failures = []
        for algo, func in (
            ("find", path_finder.find_nvidia_dynamic_library),
            ("load", path_finder.load_nvidia_dynamic_library),
        ):
            try:
                out = func(libname)
            except Exception as e:
                out = f"EXCEPTION: {type(e)} {str(e)}"
                failures.append(algo)
            print(out)
        print()
>       assert not failures
E       AssertionError: assert not ['load']

tests\test_path_finder.py:29: AssertionError
```
@rwgk
Copy link
Collaborator Author

rwgk commented Apr 17, 2025

/ok to test

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 17, 2025

/ok to test

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 17, 2025

/ok to test

@leofang leofang self-requested a review April 18, 2025 02:15
@leofang leofang added the P0 High priority - Must do! label Apr 18, 2025
@rwgk
Copy link
Collaborator Author

rwgk commented Apr 23, 2025

The toolshed/build_path_finder_sonames.py script added with commit ec89acc produced the list below (in addition to the key/values for SUPPORTED_LINUX_SONAMES in _path_finder/supported_libs.py):

SONAMEs out of scope

libAgentAPI.so
libAnalysis.so
libAnalysisContainersData.so
libAnalysisData.so
libAnalysisProto.so
libAppLib.so
libAppLibInterfaces.so
libArmServerPlatformPlugin.so
libAssert.so
libCommonNsysServer.so
libCommonProtoServices.so
libCommonProtoStreamSections.so
libCore.so
libCorePlugin.so
libCudaDrvApiWrapper.so
libDeviceProperty.so
libDevicePropertyProto.so
libEventSource.so
libEventsView.so
libExternalIntegrationPlugin.so
libGenericHierarchy.so
libGpuInfo.so
libGpuTraits.so
libHostCommon.so
libInjectionCommunicator.so
libInterceptorInjectionTarget.so
libInterfaceData.so
libInterfaceShared.so
libInterfaceSharedBase.so
libInterfaceSharedCore.so
libInterfaceSharedLoggers.so
libLauncher64.so
libLinuxKeyboardInterceptorProxy.so
libLinuxPPCPlatformPlugin.so
libLinuxPerf.so
libLinuxPlatformPlugin.so
libNetworkInfo.so
libNsysServerProto.so
libNvQtGui.so
libNvSwCounterApi.so
libNvmlWrapper.so
libNvtxExtData.so
libNvtxwBackend.so
libOpenCL.so.1
libPreRunProcessInjector.so
libProcessLauncher.so
libProtobufComm.so
libProtobufCommClient.so
libProtobufCommProto.so
libQt5Charts.so.5
libQt5Concurrent.so.5
libQt5Core.so.5
libQt5DBus.so.5
libQt5Designer.so.5
libQt5DesignerComponents.so.5
libQt5Gui.so.5
libQt5Help.so.5
libQt5Multimedia.so.5
libQt5MultimediaQuick.so.5
libQt5MultimediaWidgets.so.5
libQt5Network.so.5
libQt5OpenGL.so.5
libQt5Positioning.so.5
libQt5PrintSupport.so.5
libQt5Qml.so.5
libQt5QmlModels.so.5
libQt5Quick.so.5
libQt5QuickParticles.so.5
libQt5QuickTest.so.5
libQt5QuickWidgets.so.5
libQt5Script.so.5
libQt5ScriptTools.so.5
libQt5Sensors.so.5
libQt5Sql.so.5
libQt5Svg.so.5
libQt5Test.so.5
libQt5WaylandClient.so.5
libQt5WaylandCompositor.so.5
libQt5WebChannel.so.5
libQt5WebEngine.so.5
libQt5WebEngineCore.so.5
libQt5WebEngineWidgets.so.5
libQt5Widgets.so.5
libQt5X11Extras.so.5
libQt5XcbQpa.so.5
libQt5Xml.so.5
libQt5XmlPatterns.so.5
libQt6Charts.so.6
libQt6Concurrent.so.6
libQt6Core.so.6
libQt6DBus.so.6
libQt6Designer.so.6
libQt6DesignerComponents.so.6
libQt6Gui.so.6
libQt6Help.so.6
libQt6Multimedia.so.6
libQt6MultimediaQuick.so.6
libQt6MultimediaWidgets.so.6
libQt6Network.so.6
libQt6OpenGL.so.6
libQt6OpenGLWidgets.so.6
libQt6Positioning.so.6
libQt6PrintSupport.so.6
libQt6Qml.so.6
libQt6QmlModels.so.6
libQt6Quick.so.6
libQt6QuickParticles.so.6
libQt6QuickTest.so.6
libQt6QuickWidgets.so.6
libQt6Sensors.so.6
libQt6Sql.so.6
libQt6StateMachine.so.6
libQt6Svg.so.6
libQt6SvgWidgets.so.6
libQt6Test.so.6
libQt6UiTools.so.6
libQt6WaylandClient.so.6
libQt6WaylandCompositor.so.6
libQt6WaylandEglClientHwIntegration.so.6
libQt6WaylandEglCompositorHwIntegration.so.6
libQt6WebChannel.so.6
libQt6WebEngineCore.so.6
libQt6WebEngineWidgets.so.6
libQt6Widgets.so.6
libQt6XcbQpa.so.6
libQt6Xml.so.6
libQtPropertyBrowser.so
libQuadDPlugin.so
libQuiverContainers.so
libQuiverEvents.so
libRebelPlugin.so
libSassDebuggerPlugin.so
libSshClient.so
libStreamSections.so
libSymbolAnalyzerLight.so
libSymbolDemangler.so
libTPSConnectionPlugin.so
libTPSSystemServerPlugin.so
libTelemetryQuadDClient.so
libTimelineAssert.so
libTimelineCommon.so
libTimelineInterfaces.so
libTimelinePlugin.so
libTimelineUIUtils.so
libTimelineUtils.so
libTimelineWidget.so
libToolsInjection64.so
libToolsInjectionCuBLAS64_10.so
libToolsInjectionCuBLAS64_10_0.so
libToolsInjectionCuBLAS64_10_1.so
libToolsInjectionCuBLAS64_10_2.so
libToolsInjectionCuBLAS64_11.so
libToolsInjectionCuBLAS64_11_0.so
libToolsInjectionCuBLAS64_9.so
libToolsInjectionCuBLAS64_9_0.so
libToolsInjectionCuBLAS64_9_1.so
libToolsInjectionCuBLAS64_9_2.so
libToolsInjectionCuDNN64_7.so
libToolsInjectionCuDNN64_7_0.so
libToolsInjectionCuDNN64_7_1.so
libToolsInjectionCuDNN64_7_2.so
libToolsInjectionCuDNN64_7_3.so
libToolsInjectionCuDNN64_7_4.so
libToolsInjectionCuDNN64_7_5.so
libToolsInjectionCuDNN64_7_6.so
libToolsInjectionCuDNN64_8.so
libToolsInjectionCuDNN64_8_0.so
libToolsInjectionCuda64.so
libToolsInjectionCudaInt64_9_0.so
libToolsInjectionCudaInt64_9_1.so
libToolsInjectionCudaInt64_9_2.so
libToolsInjectionCudaInt64_shared.so
libToolsInjectionMPICH64.so
libToolsInjectionMemoryAllocator.so
libToolsInjectionNvMedia64.so
libToolsInjectionOpenMPI64.so
libToolsInjectionOpenSHMEM64.so
libToolsInjectionProxy64.so
libToolsInjectionPythonBacktrace64.so
libToolsInjectionPythonGilTracing64.so
libToolsInjectionPythonNvtxAnnotations64.so
libToolsInjectionUCP64.so
libTreeLauncherPlaceholder.so
libTreeLauncherTargetInjection.so
libTreeLauncherTargetUpdatePreloadInjection.so
libWindowsPlatformPlugin.so
lib_ncu_report.so
libaccinj64.so.11.0
libaccinj64.so.11.1
libaccinj64.so.11.2
libaccinj64.so.11.3
libaccinj64.so.11.4
libaccinj64.so.11.5
libaccinj64.so.11.6
libaccinj64.so.11.7
libaccinj64.so.11.8
libaccinj64.so.12.0
libaccinj64.so.12.1
libaccinj64.so.12.2
libaccinj64.so.12.3
libaccinj64.so.12.4
libaccinj64.so.12.5
libaccinj64.so.12.6
libaccinj64.so.12.8
libarrow.so.1700
libarrow.so.500
libboost_atomic.so.1.70.0
libboost_atomic.so.1.78.0
libboost_chrono.so.1.70.0
libboost_chrono.so.1.78.0
libboost_container.so.1.70.0
libboost_container.so.1.78.0
libboost_date_time.so.1.70.0
libboost_date_time.so.1.78.0
libboost_filesystem.so.1.70.0
libboost_filesystem.so.1.78.0
libboost_iostreams.so.1.70.0
libboost_iostreams.so.1.78.0
libboost_program_options.so.1.70.0
libboost_program_options.so.1.78.0
libboost_python310.so.1.78.0
libboost_python35.so.1.70.0
libboost_python35.so.1.78.0
libboost_regex.so.1.70.0
libboost_regex.so.1.78.0
libboost_serialization.so.1.70.0
libboost_serialization.so.1.78.0
libboost_system.so.1.70.0
libboost_system.so.1.78.0
libboost_thread.so.1.70.0
libboost_thread.so.1.78.0
libboost_timer.so.1.70.0
libboost_timer.so.1.78.0
libbpf.so.1
libcheckpoint.so
libclx_api.so
libclx_api.so.1
libcrypto.so.1.1
libcrypto.so.10
libcrypto.so.3
libcuda-injection.so
libcuda.so.1
libcuinj64.so.11.0
libcuinj64.so.11.1
libcuinj64.so.11.2
libcuinj64.so.11.3
libcuinj64.so.11.4
libcuinj64.so.11.5
libcuinj64.so.11.6
libcuinj64.so.11.7
libcuinj64.so.11.8
libcuinj64.so.12.0
libcuinj64.so.12.1
libcuinj64.so.12.2
libcuinj64.so.12.3
libcuinj64.so.12.4
libcuinj64.so.12.5
libcuinj64.so.12.6
libcuinj64.so.12.8
libcupti.so.10.0
libcupti.so.10.1
libcupti.so.10.2
libcupti.so.11.0
libcupti.so.11.1
libcupti.so.11.2
libcupti.so.11.3
libcupti.so.11.4
libcupti.so.11.5
libcupti.so.11.6
libcupti.so.11.7
libcupti.so.11.8
libcupti.so.12
libelf.so.1
libevents_ngauge_high_freq_provider.so
libevents_switch_provider.so
libexporter.so
libfreetype.so.6
libicudata.so.56
libicudata.so.70
libicudata.so.71
libicui18n.so.56
libicui18n.so.70
libicui18n.so.71
libicuuc.so.56
libicuuc.so.70
libicuuc.so.71
libjpeg.so.8
libmsgpackc.so.2
libnvToolsExt.so.1
libnvidia-ml.so.1
libnvlog.so
libnvperf_grfx_host.so.2023.1.0
libnvperf_grfx_host.so.2023.4.0
libnvperf_grfx_host.so.2023.5.0
libnvperf_grfx_host.so.2024.1.0
libnvperf_grfx_host.so.2024.2.0
libnvperf_grfx_host.so.2024.5.0
libnvperf_host.so
libnvperf_target.so
libnvperfapi64.so
libnvrtc-builtins.alt.so.12.8
libnvrtc-builtins.so.11.0
libnvrtc-builtins.so.11.1
libnvrtc-builtins.so.11.2
libnvrtc-builtins.so.11.3
libnvrtc-builtins.so.11.4
libnvrtc-builtins.so.11.5
libnvrtc-builtins.so.11.6
libnvrtc-builtins.so.11.7
libnvrtc-builtins.so.11.8
libnvrtc-builtins.so.12.0
libnvrtc-builtins.so.12.1
libnvrtc-builtins.so.12.2
libnvrtc-builtins.so.12.3
libnvrtc-builtins.so.12.4
libnvrtc-builtins.so.12.5
libnvrtc-builtins.so.12.6
libnvrtc-builtins.so.12.8
libnvrtc.alt.so.12
libpapi.so.5
libparquet.so.1700
libparquet.so.500
libpcsamplingutil.so
libpfm.so.4
libprotobuf-shared.so
libprotobuf319-shared.so
libsanitizer-collection.so
libsanitizer-public.so
libsqlite3-shared.so
libsqlite3.so.0
libssh.so
libssl.so.1.1
libssl.so.10
libssl.so.3
libstdc++.so.6
libsysfs_provider.so
libucm.so.0
libucp.so.0
libucs.so.0
libuct.so.0
libz.so.1
libzstd.so.1

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 24, 2025

The toolshed/build_path_finder_dlls.py script added with commit 38a1d6c produced the list below (in addition to the key/values for SUPPORTED_WINDOWS_DLLS in _path_finder/supported_libs.py):

DLLs out of scope

7z.dll
APEX_BasicFSCHECKED_x86.dll
APEX_BasicIOSCHECKED_x86.dll
APEX_FieldSamplerCHECKED_x86.dll
APEX_IOFXCHECKED_x86.dll
APEX_ParticlesCHECKED_x86.dll
APEX_Particles_x64.dll
APEX_Particles_x86.dll
APEX_TurbulenceFSCHECKED_x86.dll
APEX_TurbulenceFS_x64.dll
APEX_TurbulenceFS_x86.dll
AccountPairPlugin.dll
AccountsHandlerPlugin.dll
AggregatorContainerPlugin_x64.dll
AppControlAggregator.dll
AppController.dll
AppDiscovery.dll
AppListAggregator.dll
BackgroundProcess.dll
CUDASamplesExt.dll
CUDAToolkitExt.dll
CUDAVisualProfilerExt.dll
CUDAVisualStudioIntegrationExt.dll
ConnectionTester.dll
CrimsonUtil.dll
DSETUP.dll
DesktopNotification.dll
Diagnostics.dll
DisplayDriverExt.dll
DisplayDriverRAS.dll
DisplayUpdateExt.dll
DocExt.dll
Downloader.dll
DriverInstall.dll
DriverUpdateRecommendation.dll
FrameViewSdkExt.dll
FreeImage.dll
FvSDK_x64.dll
FvSDK_x86.dll
GFExperienceExt.dll
GRB_1_x86.dll
Gallery.dll
GfeSessionControl.dll
GfeXCode.dll
GfeXCode64.dll
GfnProductPlugin.dll
GraphicsSetting.dll
GsNvBackend.dll
GsProxyPlugin.dll
GsTelemetry.dll
HDAudioExt.dll
IdentityPlugin.dll
InstallerExtension.dll
InterceptorInjectionTarget.dll
Interop.dll
LocalGames.dll
LoginId.dll
MSVCRTExt.dll
MessageBus.dll
MessageBusRouter.dll
MonitorTelemetry.dll
NGXCoreExt.dll
NVDeviceUtility32.dll
NVDeviceUtility64.dll
NVFTVRDLL64.dll
NVI2.dll
NVI2UI.dll
NVNetworkServiceAPI.dll
NVPrxy32.dll
NVPrxy64.dll
NVWMIExt.dll
NViewExt.dll
NetworkCaptureControl.dll
NetworkTester.dll
NvAccount.dll
NvAppApi.dll
NvAppExt.dll
NvBackend64.dll
NvBackendAPI32.dll
NvBackendAPI64.dll
NvBackendExt.dll
NvBatteryBoostCheck64.dll
NvCamera.dll
NvCamera32.dll
NvCamera64.dll
NvCameraAllowlisting32.dll
NvCameraAllowlisting64.dll
NvCameraWhitelisting32.dll
NvCameraWhitelisting64.dll
NvConfigGenerator.dll
NvContainerTelemetryApi.dll
NvCplDisplayPlugin.dll
NvCplPlugin.dll
NvDisplayControl.dll
NvDriverDiagnostics.dll
NvDriverUpdateCheck64.dll
NvFBCPlugin.dll
NvFBCPlugin64.dll
NvGameShare.dll
NvGfeServiceBridge.dll
NvIGOUtil.dll
NvInstallerUtil.dll
NvLocalizedConfig.dll
NvMdnsPlugin.dll
NvMessageBus.dll
NvMessageBusBroadcast.dll
NvNodeExt.dll
NvOc.dll
NvPerfMon.dll
NvPinPairUi.dll
NvPluginAbHub64.dll
NvPluginAbHubClient32.dll
NvPluginAbHubClient64.dll
NvPluginNvapiMonitor.dll
NvPluginWatchdog.dll
NvPortForwardPlugin.dll
NvProfileUpdaterPlugin.dll
NvRemux.dll
NvRemux64.dll
NvRtmpStreamer64.dll
NvStreamBase.dll
NvStreamControl.dll
NvStreamServer.dll
NvStreamSrvExt.dll
NvStreamUserAgentPlugin.dll
NvTelemetry64.dll
NvTelemetryAPI32.dll
NvTelemetryAPI64.dll
NvTelemetryBridge32.dll
NvTelemetryBridge64.dll
NvTelemetryExt.dll
NvUI.dll
NvUIR.dll
NvXDCore.dll
NvcDispCorePlugin.dll
NvcDispWatchdog.dll
Nvda.Build.CudaTasks.v11.0.dll
Nvda.Build.CudaTasks.v11.1.dll
Nvda.Build.CudaTasks.v11.2.dll
Nvda.Build.CudaTasks.v11.3.dll
Nvda.Build.CudaTasks.v11.4.dll
Nvda.Build.CudaTasks.v11.5.dll
Nvda.Build.CudaTasks.v11.6.dll
Nvda.Build.CudaTasks.v11.7.dll
Nvda.Build.CudaTasks.v11.8.dll
Nvda.Build.CudaTasks.v12.0.dll
Nvda.Build.CudaTasks.v12.1.dll
Nvda.Build.CudaTasks.v12.2.dll
Nvda.Build.CudaTasks.v12.3.dll
Nvda.Build.CudaTasks.v12.4.dll
Nvda.Build.CudaTasks.v12.5.dll
Nvda.Build.CudaTasks.v12.6.dll
Nvda.Build.CudaTasks.v12.8.dll
Nvda.Vsip.CudaTemplates.dll
Nvda.Vsip.CudaWizards.dll
NxCooking.dll
OSCExt.dll
Ontology64.dll
OptimusUpdateExt.dll
OverClocking.dll
PairAggregatorPlugin.dll
PassThruPairPlugin.dll
PerfStatisticsLogger.dll
PhysX3GpuCHECKED_x86.dll
PhysX3Gpu_x64.dll
PhysX3Gpu_x86.dll
PhysXCooking.dll
PhysXCooking64.dll
PhysXCore.dll
PhysXCore64.dll
PhysXDevice.dll
PhysXDevice64.dll
PhysXLoader.dll
PhysXLoader64.dll
PhysXUpdateLoader.dll
PhysXUpdateLoader64.dll
PhysxExt.dll
PinPairPlugin.dll
Poco.dll
PocoInitializer.dll
ProcessGroupMonitorPlugin.dll
Rise.dll
RtspPlugin.dll
RtspServer.dll
RtspServerMb.dll
SCI.dll
ServerInfoProcessor.dll
ShadowPlayExt.dll
ShareServer.dll
ShieldWirelessControllerPlugin.dll
ShieldWirelessControllerPlugin64.dll
SsauWatchdogPlugin.dll
SteamBpController.dll
SteamManager.dll
StoreCleanupPlugin.dll
StreamServerShared.dll
StreamerController.dll
SystemDataCollectorsContainerPlugin_x64.dll
SystemInfo.dll
TreeLauncherTargetInjection.dll
USBCExt.dll
UnifiedProtocol.dll
UpdateCoreExt.dll
UpdateFrameworkPlugin.dll
WdfCoInstaller01011.dll
WgcWrapper.dll
_DisplayDriverRAS.dll
_NvGSTPlugin.dll
_NvMessageBusBroadcast.dll
_NvMsgBusBroadcast.dll
_OverClockingNvc.dll
_nvngx.dll
_nvppo.dll
_nvspcaps64.dll
_nvspserviceplugin64.dll
_nvtopps.dll
amd_ags_x64.dll
amd_dpfc_sdk.dll
capcore64.dll
checkpoint.dll
chrome_elf.dll
cudnn_infer64_7.dll
cuinj64_110.dll
cuinj64_111.dll
cuinj64_112.dll
cuinj64_113.dll
cuinj64_114.dll
cuinj64_115.dll
cuinj64_116.dll
cuinj64_117.dll
cuinj64_118.dll
cuinj64_120.dll
cuinj64_121.dll
cuinj64_122.dll
cuinj64_123.dll
cuinj64_124.dll
cuinj64_125.dll
cuinj64_126.dll
cuinj64_128.dll
cupti64_2020.1.1.dll
cupti64_2020.2.1.dll
cupti64_2020.3.1.dll
cupti64_2021.1.1.dll
cupti64_2021.2.2.dll
cupti64_2021.3.1.dll
cupti64_2022.1.1.dll
cupti64_2022.2.1.dll
cupti64_2022.3.0.dll
cupti64_2022.4.1.dll
cupti64_2023.1.1.dll
cupti64_2023.2.2.dll
cupti64_2023.3.1.dll
cupti64_2024.1.1.dll
cupti64_2024.2.1.dll
cupti64_2024.3.2.dll
cupti64_2025.1.1.dll
d3dcompiler_43.dll
d3dcompiler_47.dll
d3dcompiler_47_32.dll
d3dcompiler_47_64.dll
ddETWExternal.dll
detoured.dll
dsetup32.dll
eclipse_1603.dll
freeglut.dll
glew64.dll
ipccommon.dll
ipccommon64.dll
libEGL.dll
libGLESv2.dll
libcef.dll
libcrypto-1_1.dll
libcrypto-3-x64.dll
libeay32.dll
libprotobuf.dll
libssl-1_1.dll
nView.dll
nView64.dll
nViewH.dll
nViewH64.dll
nViewPlugin.dll
nViewUIStrings.dll
nv3dappshext.dll
nv3dappshextr.dll
nvShell.dll
nvaidvc.dll
nvaidvcx.dll
nvaihdr.dll
nvaihdrx.dll
nvapi.dll
nvapi64.dll
nvapo32v.dll
nvapo64v.dll
nvaudcap32v.dll
nvaudcap64v.dll
nvcpl.dll
nvcuda32.dll
nvcuda64.dll
nvcuda_loader32.dll
nvcuda_loader64.dll
nvcudadebugger.dll
nvcuvid32.dll
nvcuvid64.dll
nvd3dum.dll
nvd3dumx.dll
nvdecmftmjpeg.dll
nvdecmftmjpegx.dll
nvdevtools.dll
nvdevtoolsr.dll
nvdispco64.dll
nvdispgenco64.dll
nvdisps.dll
nvdispsr.dll
nvdlist.dll
nvdlistx.dll
nvdlppx.dll
nvdxdlkernels.dll
nvdxgdmal32.dll
nvdxgdmal64.dll
nvencmftav1.dll
nvencmftav1x.dll
nvencmfth264.dll
nvencmfth264x.dll
nvencmfthevc.dll
nvencmfthevcx.dll
nvencodeapi.dll
nvencodeapi64.dll
nvfbc.dll
nvfbc64.dll
nvfcapi64.dll
nvfp64.dll
nvgames.dll
nvgamesr.dll
nvgpucomp32.dll
nvgpucomp64.dll
nvhdagenco32.dll
nvhdagenco64.dll
nvhdap32.dll
nvhdap64.dll
nvifr.dll
nvifr64.dll
nvinject.dll
nvldumd.dll
nvldumdx.dll
nvlicensings.dll
nvlicensingsr.dll
nvmemmapstorage.dll
nvmemmapstoragex.dll
nvmf64.dll
nvml.dll
nvml_loader.dll
nvngx.dll
nvngx_dlisr.dll
nvngx_dlss.dll
nvngx_dlssg.dll
nvngxdlss.dll
nvofapi.dll
nvofapi64.dll
nvoglv32.dll
nvoglv64.dll
nvopencl32.dll
nvopencl64.dll
nvoptix.dll
nvperf_host.dll
nvperf_target.dll
nvppcgenco64.dll
nvppe.dll
nvppex.dll
nvpresent64.dll
nvptxjitcompiler32.dll
nvptxjitcompiler64.dll
nvrtum64.dll
nvshext.dll
nvsmartmax.dll
nvsmartmax64.dll
nvspapi.dll
nvspapi64.dll
nvspapix.dll
nvspapix64.dll
nvspcap.dll
nvspcap64.dll
nvsphelperplugin64.dll
nvspscreenshot64.dll
nvsteamsupport.dll
nvsvc64.dll
nvsvcr.dll
nvsvs.dll
nvsvsr.dll
nvtopps.dll
nvui.dll
nvuir.dll
nvvitvs.dll
nvvitvsr.dll
nvvkscv64.dll
nvwdmcpl.dll
nvwgf2um.dll
nvwgf2umx.dll
nvwss.dll
nvwssr.dll
nvxdapix.dll
nvxdbat.dll
nvxdplcy.dll
nvxdsyncplugin.dll
opencl32.dll
opencl64.dll
pcsamplingutil.dll
rxaudio.dll
rxcore.dll
rxdiag.dll
rxgamepadinput.dll
rxgamepadremapping.dll
rxnvgamepad.dll
sanitizer-collection.dll
sanitizer-public.dll
ssleay32.dll
steam_api64.dll
vulkan-1-x64.dll
vulkan-1-x86.dll
wksServicePlugin.dll
wksServicePluginZ.dll

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 24, 2025

/ok to test 38a1d6c

…s from find_nvidia_dynamic_library.py. Add `supported_libs.LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY` and use from `load_nvidia_dynamic_library()`.
@rwgk
Copy link
Collaborator Author

rwgk commented Apr 24, 2025

/ok to test 74d7230

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 24, 2025

/ok to test c1a4983

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 24, 2025

/ok to test 9ff46d8

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 25, 2025

/ok to test cb3ca5a

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 25, 2025

/ok to test 93db730

@rwgk
Copy link
Collaborator Author

rwgk commented Apr 25, 2025

/ok to test b3cd45b

…py to report the absolute paths of the loaded libraries.
@rwgk
Copy link
Collaborator Author

rwgk commented Apr 25, 2025

/ok to test bcac5cd

@rwgk rwgk marked this pull request as ready for review April 25, 2025 15:09
@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Apr 25, 2025

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@rwgk rwgk merged commit 74c9750 into NVIDIA:path_finder_dev Apr 25, 2025
75 checks passed
@rwgk rwgk deleted the path_finder_cont branch April 25, 2025 15:12
leofang pushed a commit that referenced this pull request May 6, 2025
* First version of `cuda.bindings.path_finder` (#447)

* Unmodified copies of:

* https://github.com/NVIDIA/numba-cuda/blob/bf487d78a40eea87f009d636882a5000a7524c95/numba_cuda/numba/cuda/cuda_paths.py

* https://github.com/numba/numba/blob/f0d24824fcd6a454827e3c108882395d00befc04/numba/misc/findlib.py

* Add Forked from URLs.

* Strip down cuda_paths.py to minimum required for `_get_nvvm_path()`

Tested interactively with:
```
import cuda_paths
nvvm_path = cuda_paths._get_nvvm_path()
print(f"{nvvm_path=}")
```

* ruff auto-fixes (NO manual changes)

* Make `get_nvvm_path()` a pubic API (i.e. remove leading underscore).

* Fetch numba-cuda/numba_cuda/numba/cuda/cuda_paths.py from NVIDIA/numba-cuda#155 AS-IS

* ruff format NO MANUAL CHANGES

* Minimal changes to adapt numba-cuda/numba_cuda/numba/cuda/cuda_paths.py from NVIDIA/numba-cuda#155

* Rename ecosystem/cuda_paths.py -> path_finder.py

* Plug cuda.bindings.path_finder into cuda/bindings/_internal/nvvm_linux.pyx

* Plug cuda.bindings.path_finder into cuda/bindings/_internal/nvjitlink_linux.pyx

* Fix `os.path.exists(None)` issue:

```
______________________ ERROR collecting test_nvjitlink.py ______________________
tests/test_nvjitlink.py:62: in <module>
    not check_nvjitlink_usable(), reason="nvJitLink not usable, maybe not installed or too old (<12.3)"
tests/test_nvjitlink.py:58: in check_nvjitlink_usable
    return inner_nvjitlink._inspect_function_pointer("__nvJitLinkVersion") != 0
cuda/bindings/_internal/nvjitlink.pyx:257: in cuda.bindings._internal.nvjitlink._inspect_function_pointer
    ???
cuda/bindings/_internal/nvjitlink.pyx:260: in cuda.bindings._internal.nvjitlink._inspect_function_pointer
    ???
cuda/bindings/_internal/nvjitlink.pyx:208: in cuda.bindings._internal.nvjitlink._inspect_function_pointers
    ???
cuda/bindings/_internal/nvjitlink.pyx:102: in cuda.bindings._internal.nvjitlink._check_or_init_nvjitlink
    ???
cuda/bindings/_internal/nvjitlink.pyx:59: in cuda.bindings._internal.nvjitlink.load_library
    ???
/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/cuda/bindings/path_finder.py:312: in get_cuda_paths
    "nvvm": _get_nvvm_path(),
/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/cuda/bindings/path_finder.py:285: in _get_nvvm_path
    by, path = _get_nvvm_path_decision()
/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/cuda/bindings/path_finder.py:96: in _get_nvvm_path_decision
    if os.path.exists(nvvm_ctk_dir):
<frozen genericpath>:19: in exists
    ???
E   TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
```

* Fix another `os.path.exists(None)` issue:

```
______________________ ERROR collecting test_nvjitlink.py ______________________
tests/test_nvjitlink.py:62: in <module>
    not check_nvjitlink_usable(), reason="nvJitLink not usable, maybe not installed or too old (<12.3)"
tests/test_nvjitlink.py:58: in check_nvjitlink_usable
    return inner_nvjitlink._inspect_function_pointer("__nvJitLinkVersion") != 0
cuda/bindings/_internal/nvjitlink.pyx:257: in cuda.bindings._internal.nvjitlink._inspect_function_pointer
    ???
cuda/bindings/_internal/nvjitlink.pyx:260: in cuda.bindings._internal.nvjitlink._inspect_function_pointer
    ???
cuda/bindings/_internal/nvjitlink.pyx:208: in cuda.bindings._internal.nvjitlink._inspect_function_pointers
    ???
cuda/bindings/_internal/nvjitlink.pyx:102: in cuda.bindings._internal.nvjitlink._check_or_init_nvjitlink
    ???
cuda/bindings/_internal/nvjitlink.pyx:59: in cuda.bindings._internal.nvjitlink.load_library
    ???
/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/cuda/bindings/path_finder.py:313: in get_cuda_paths
    "libdevice": _get_libdevice_paths(),
/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/cuda/bindings/path_finder.py:126: in _get_libdevice_paths
    by, libdir = _get_libdevice_path_decision()
/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/cuda/bindings/path_finder.py:73: in _get_libdevice_path_decision
    if os.path.exists(libdevice_ctk_dir):
<frozen genericpath>:19: in exists
    ???
E   TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
```

* Change "/lib64/" → "/lib/" in nvjitlink_linux.pyx

* nvjitlink_linux.pyx load_library() enhancements, mainly to avoid os.path.join(None, "libnvJitLink.so")

* Add missing f-string f

* Add back get_nvjitlink_dso_version_suffix() call.

* pytest -ra -s -v

* Rewrite nvjitlink_linux.pyx load_library() to produce detailed error messages.

* Attach listdir output to "Unable to load" exception message.

* Guard os.listdir() call with os.path.isdir()

* Fix logic error in nvjitlink_linux.pyx load_library()

* Move path_finder.py to _path_finder_utils/cuda_paths.py, import only public functions from new path_finder.py

* Add find_nvidia_dynamic_library() and use from nvjitlink_linux.pyx, nvvm_linux.pyx

* Fix oversight in _find_using_lib_dir()

* Also look for versioned library in _find_using_nvidia_lib_dirs()

* glob.glob() Python 3.9 compatibility

* Reduce build-and-test.yml to Windows-only, Python 3.12 only.

* Comment out `if: ${{ github.repository_owner == nvidia }}`

* Revert "Comment out `if: ${{ github.repository_owner == nvidia }}`"

This reverts commit b0db24f.

* Add back `linux-64` `host-platform`

* Rewrite load_library() in nvjitlink_windows.pyx to use path_finder.find_nvidia_dynamic_library()

* Revert "Rewrite load_library() in nvjitlink_windows.pyx to use path_finder.find_nvidia_dynamic_library()"

This reverts commit 1bb7151.

* Add _inspect_environment() in find_nvidia_dynamic_library.py, call from nvjitlink_windows.pyx, nvvm_windows.pyx

* Add & use _find_dll_using_nvidia_bin_dirs(), _find_dll_using_cudalib_dir()

* Fix silly oversight: forgot to undo experimental change.

* Also reduce test test-linux matrix.

* Reimplement load_library() functions in nvjitlink_windows.pyx, nvvm_windows.pyx to actively use path_finder.find_nvidia_dynamic_library()

* Factor out load_nvidia_dynamic_library() from _internal/nvjitlink_linux.pyx, nvvm_linux.pyx

* Generalize load_nvidia_dynamic_library.py to also work under Windows.

* Add `void*` return type to load_library() implementations in _internal/nvjitlink_windows.pyx, nvvm_windows.pyx

* Resolve cython error: object handle vs `void*` handle

```
    Error compiling Cython file:
    ------------------------------------------------------------
    ...
            err = (<int (*)(int*) nogil>__cuDriverGetVersion)(&driver_ver)
            if err != 0:
                raise RuntimeError('something went wrong')
            # Load library
            handle = load_library(driver_ver)
                                 ^
    ------------------------------------------------------------
    cuda\bindings\_internal\nvjitlink.pyx:72:29: Cannot convert 'void *' to Python object
```

* Resolve another cython error: `void*` handle vs `intptr_t` handle

```
    Error compiling Cython file:
    ------------------------------------------------------------
    ...
            handle = load_library(driver_ver)

            # Load function
            global __nvJitLinkCreate
            try:
                __nvJitLinkCreate = <void*><intptr_t>win32api.GetProcAddress(handle, 'nvJitLinkCreate')
                                                                             ^
    ------------------------------------------------------------

    cuda\bindings\_internal\nvjitlink.pyx:78:73: Cannot convert 'void *' to Python object
```

* Resolve signed/unsigned runtime error. Use uintptr_t consistently.

https://github.com/NVIDIA/cuda-python/actions/runs/14224673173/job/39861750852?pr=447#logs

```
=================================== ERRORS ====================================
_____________________ ERROR collecting test_nvjitlink.py ______________________
tests\test_nvjitlink.py:62: in <module>
    not check_nvjitlink_usable(), reason="nvJitLink not usable, maybe not installed or too old (<12.3)"
tests\test_nvjitlink.py:58: in check_nvjitlink_usable
    return inner_nvjitlink._inspect_function_pointer("__nvJitLinkVersion") != 0
cuda\\bindings\\_internal\\nvjitlink.pyx:221: in cuda.bindings._internal.nvjitlink._inspect_function_pointer
    ???
cuda\\bindings\\_internal\\nvjitlink.pyx:224: in cuda.bindings._internal.nvjitlink._inspect_function_pointer
    ???
cuda\\bindings\\_internal\\nvjitlink.pyx:172: in cuda.bindings._internal.nvjitlink._inspect_function_pointers
    ???
cuda\\bindings\\_internal\\nvjitlink.pyx:73: in cuda.bindings._internal.nvjitlink._check_or_init_nvjitlink
    ???
cuda\\bindings\\_internal\\nvjitlink.pyx:46: in cuda.bindings._internal.nvjitlink.load_library
    ???
E   OverflowError: can't convert negative value to size_t
```

* Change <void*><uintptr_t>win32api.GetProcAddress` back to `intptr_t`. Changing load_nvidia_dynamic_library() to also use to-`intptr_t` conversion, for compatibility with win32api.GetProcAddress. Document that CDLL behaves differently (it uses to-`uintptr_t`).

* Use win32api.LoadLibrary() instead of ctypes.windll.kernel32.LoadLibraryW(), to be more similar to original (and working) cython code.

Hoping to resolve this kind of error:

```
_ ERROR at setup of test_c_or_v_program_fail_bad_option[txt-compile_program] __

request = <SubRequest 'minimal_nvvmir' for <Function test_c_or_v_program_fail_bad_option[txt-compile_program]>>

    @pytest.fixture(params=MINIMAL_NVVMIR_FIXTURE_PARAMS)
    def minimal_nvvmir(request):
        for pass_counter in range(2):
            nvvmir = MINIMAL_NVVMIR_CACHE.get(request.param, -1)
            if nvvmir != -1:
                if nvvmir is None:
                    pytest.skip(f"UNAVAILABLE: {request.param}")
                return nvvmir
            if pass_counter:
                raise AssertionError("This code path is meant to be unreachable.")
            # Build cache entries, then try again (above).
>           major, minor, debug_major, debug_minor = nvvm.ir_version()

tests\test_nvvm.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cuda\bindings\nvvm.pyx:95: in cuda.bindings.nvvm.ir_version
    cpdef tuple ir_version():
cuda\bindings\nvvm.pyx:113: in cuda.bindings.nvvm.ir_version
    status = nvvmIRVersion(&major_ir, &minor_ir, &major_dbg, &minor_dbg)
cuda\bindings\cynvvm.pyx:19: in cuda.bindings.cynvvm.nvvmIRVersion
    return _nvvm._nvvmIRVersion(majorIR, minorIR, majorDbg, minorDbg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   cuda.bindings._internal.utils.FunctionNotFoundError: function nvvmIRVersion is not found
```

* Remove debug print statements.

* Remove some cruft.

* Trivial renaming of variables. No functional changes.

* Revert debug changes under .github/workflows

* Rename _path_finder_utils → _path_finder

* Remove LD_LIBRARY_PATH in fetch_ctk/action.yml

* Linux: First try using the platform-specific dynamic loader search mechanisms

* Add _windows_load_with_dll_basename()

* Revert "Revert debug changes under .github/workflows"

This reverts commit cc6113c.

* Add debug prints in load_nvidia_dynamic_library()

* Report dlopen error for libnvrtc.so.12

* print("\nLOOOK dlfcn.dlopen('libnvrtc.so.12', dlfcn.RTLD_NOW)", flush=True)

* Revert "Remove LD_LIBRARY_PATH in fetch_ctk/action.yml"

This reverts commit 1b1139c.

* Only remove ${CUDA_PATH}/nvvm/lib64 from LD_LIBRARY_PATH

* Use path_finder.load_nvidia_dynamic_library("nvrtc") from cuda/bindings/_bindings/cynvrtc.pyx.in

* Somewhat ad hoc heuristics for nvidia_cuda_nvrtc wheels.

* Remove LD_LIBRARY_PATH entirely from .github/actions/fetch_ctk/action.yml

* Remove CUDA_PATH\nvvm\bin in .github/workflows/test-wheel-windows.yml

* Revert "Remove LD_LIBRARY_PATH entirely from .github/actions/fetch_ctk/action.yml"

This reverts commit bff8cf0.

* Revert "Somewhat ad hoc heuristics for nvidia_cuda_nvrtc wheels."

This reverts commit 43abec8.

* Restore cuda/bindings/_bindings/cynvrtc.pyx.in as-is on main

* Remove debug print from load_nvidia_dynamic_library.py

* Reapply "Revert debug changes under .github/workflows"

This reverts commit aaa6aff.

* Make `path_finder` work for `"nvrtc"` (#553)

* Revert "Restore cuda/bindings/_bindings/cynvrtc.pyx.in as-is on main"

This reverts commit ba093f5.

* Revert "Reapply "Revert debug changes under .github/workflows""

This reverts commit 8f69f83.

* Also load nvrtc from cuda_bindings/tests/path_finder.py

* Add heuristics for nvidia_cuda_nvrtc Windows wheels.

Also fix a couple bugs discovered by ChatGPT:

* `glob.glob()` in this code return absolute paths.

* stray `error_messages = []`

* Add debug prints, mostly for `os.add_dll_directory(bin_dir)`

* Fix unfortunate silly oversight (import os missing under Windows)

* Use `win32api.LoadLibraryEx()` with suitable `flags`; also update `os.environ["PATH"]`

* Hard-wire WinBase.h constants (they are not exposed by win32con)

* Remove debug prints

* Reapply "Reapply "Revert debug changes under .github/workflows""

This reverts commit b002ff6.

* Add `path_finder.SUPPORTED_LIBNAMES` (#558)

* Revert "Reapply "Revert debug changes under .github/workflows""

This reverts commit 8f69f83.

* Add names of all CTK 12.8.1 x86_64-linux libraries (.so) as `path_finder.SUPPORTED_LIBNAMES`

https://chatgpt.com/share/67f98d0b-148c-8008-9951-9995cf5d860c

* Add `SUPPORTED_WINDOWS_DLLS`

* Add copyright notice

* Move SUPPORTED_LIBNAMES, SUPPORTED_WINDOWS_DLLS to _path_finder/supported_libs.py

* Use SUPPORTED_WINDOWS_DLLS in _windows_load_with_dll_basename()

* Change "Set up mini CTK" to use `method: local`, remove `sub-packages` line.

* Use Jimver/cuda-toolkit@v0.2.21 also under Linux, `method: local`, no `sub-packages`.

* Add more `nvidia-*-cu12` wheels to get as many of the supported shared libraries as possible.

* Revert "Use Jimver/cuda-toolkit@v0.2.21 also under Linux, `method: local`, no `sub-packages`."

This reverts commit d499806.

Problem observed:

```
/usr/bin/docker exec  1b42cd4ea3149ac3f2448eae830190ee62289b7304a73f8001e90cead5005102 sh -c "cat /etc/*release | grep ^ID"
Warning: Failed to restore: Cache service responded with 422
/usr/bin/tar --posix -cf cache.tgz --exclude cache.tgz -P -C /__w/cuda-python/cuda-python --files-from manifest.txt -z
Failed to save: Unable to reserve cache with key cuda_installer-linux-5.15.0-135-generic-x64-12.8.0, another job may be creating this cache. More details: This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP. For more information: https://gh.io/gha-cache-sunset
Warning: Error during installation: Error: Unable to locate executable file: sudo. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
Error: Error: Unable to locate executable file: sudo. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
```

* Change test_path_finder::test_find_and_load() to skip cufile on Windows, and report exceptions as failures, except for cudart

* Add nvidia-cuda-runtime-cu12 to pyproject.toml (for libname cudart)

* test_path_finder.py: before loading cusolver, load nvJitLink, cusparse, cublas (experiment to see if that resolves the only Windows failure)

Test (win-64, Python 3.12, CUDA 12.8.0, Runner default, CTK wheels) / test

```
================================== FAILURES ===================================
________________________ test_find_and_load[cusolver] _________________________

libname = 'cusolver'

    @pytest.mark.parametrize("libname", path_finder.SUPPORTED_LIBNAMES)
    def test_find_and_load(libname):
        if sys.platform == "win32" and libname == "cufile":
            pytest.skip(f'test_find_and_load("{libname}") not supported on this platform')
        print(f'\ntest_find_and_load("{libname}")')
        failures = []
        for algo, func in (
            ("find", path_finder.find_nvidia_dynamic_library),
            ("load", path_finder.load_nvidia_dynamic_library),
        ):
            try:
                out = func(libname)
            except Exception as e:
                out = f"EXCEPTION: {type(e)} {str(e)}"
                failures.append(algo)
            print(out)
        print()
>       assert not failures
E       AssertionError: assert not ['load']

tests\test_path_finder.py:29: AssertionError
```

* test_path_finder.py: load *only* nvJitLink before loading cusolver

* Run each test_find_or_load_nvidia_dynamic_library() subtest in a subprocess

* Add cublasLt to supported_libs.py and load deps for cusolver, cusolverMg, cusparse in test_path_finder.py. Also restrict test_path_finder.py to test load only for now.

* Add supported_libs.DIRECT_DEPENDENCIES

* Remove cufile_rdma from supported libs (comment out).

https://chatgpt.com/share/68033a33-385c-8008-a293-4c8cc3ea23ae

* Split out `PARTIALLY_SUPPORTED_LIBNAMES`. Fix up test code.

* Reduce public API to only load_nvidia_dynamic_library, SUPPORTED_LIBNAMES

* Set CUDA_BINDINGS_PATH_FINDER_TEST_ALL_LIBNAMES=1 to match expected availability of nvidia shared libraries.

* Refactor as `class _find_nvidia_dynamic_library`

* Strict wheel, conda, system rule: try using the platform-specific dynamic loader search mechanisms only last

* Introduce _load_and_report_path_linux(), add supported_libs.EXPECTED_LIB_SYMBOLS

* Plug in ctypes.windll.kernel32.GetModuleFileNameW()

* Keep track of nvrtc-related GitHub comment

* Factor out `_find_dll_under_dir(dirpath, file_wild)` and reuse from `_find_dll_using_nvidia_bin_dirs()`, `_find_dll_using_cudalib_dir()` (to fix loading nvrtc64_120_0.dll from local CTK)

* Minimal "is already loaded" code.

* Add THIS FILE NEEDS TO BE REVIEWED/UPDATED FOR EACH CTK RELEASE comment in _path_finder/supported_libs.py

* Add SUPPORTED_LINUX_SONAMES in _path_finder/supported_libs.py

* Update SUPPORTED_WINDOWS_DLLS in _path_finder/supported_libs.py based on DLLs found in cuda_*win*.exe files.

* Remove `os.add_dll_directory()` and `os.environ["PATH"]` manipulations from find_nvidia_dynamic_library.py. Add `supported_libs.LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY` and use from `load_nvidia_dynamic_library()`.

* Move nvrtc-specific code from find_nvidia_dynamic_library.py to `supported_libs.is_suppressed_dll_file()`

* Introduce dataclass LoadedDL as return type for load_nvidia_dynamic_library()

* Factor out _abs_path_for_dynamic_library_* and use on handle obtained through "is already loaded" checks

* Factor out _load_nvidia_dynamic_library_no_cache() and use for exercising LoadedDL.was_already_loaded_from_elsewhere

* _check_nvjitlink_usable() in test_path_finder.py

* Undo changes in .github/workflows/ and cuda_bindings/pyproject.toml

* Move cuda_bindings/tests/path_finder.py -> toolshed/run_cuda_bindings_path_finder.py

* Add bandit suppressions in test_path_finder.py

* Add pytest info_summary_append fixture and use from test_path_finder.py to report the absolute paths of the loaded libraries.

* Fix tiny accident: a line in pyproject.toml got lost somehow.

* Undo changes under .github (LD_LIBRARY_PATH, PATH manipulations for nvvm).

* 2025-05-01 version of `cuda.bindings.path_finder` (#578)

* Undo changes to the nvJitLink, nvrtc, nvvm bindings

* Undo changes under .github, specific to nvvm, manipulating LD_LIBRARY_PATH or PATH

* PARTIALLY_SUPPORTED_LIBNAMES_LINUX, PARTIALLY_SUPPORTED_LIBNAMES_WINDOWS

* Update EXPECTED_LIB_SYMBOLS for nvJitLink to cleanly support CTK versions 12.0, 12.1, 12.2

* Save result of factoring out load_dl_common.py, load_dl_linux.py, load_dl_windows.py with the help of Cursor.

* Fix an auto-generated docstring

* first round of Cursor refactoring (about 4 iterations until all tests passed), followed by ruff auto-fixes

* Revert "first round of Cursor refactoring (about 4 iterations until all tests passed), followed by ruff auto-fixes"

This reverts commit 001a6a2.

There were many GitHub Actions jobs that failed (all tests with 12.x):

https://github.com/NVIDIA/cuda-python/actions/runs/14677553387

This is not worth spending time debugging.
Especially because

* Cursor has been unresponsive for at least half an hour:
    We're having trouble connecting to the model provider. This might be temporary - please try again in a moment.

* The refactored code does not seem easier to read.

* A couple trivial tweaks

* Prefix the public API (just two items) with underscores for now.

* Add SPDX-License-Identifier to all files under toolshed/ that don't have it already

* Add SPDX-License-Identifier under cuda_bindings/tests/

* Respond to "Do these need to be run as subprocesses?" review question (#578 (comment))

* Respond to "dead code?" review questions (e.g. #578 (comment))

* Respond to "Do we need to implement a cache separately ..." review question (#578 (comment))

* Remove cuDriverGetVersion() function for now.

* Move add_dll_directory() from load_dl_common.py to load_dl_windows.py (response to review question #578 (comment))

* Add SPDX-License-Identifier and # Forked from: URL in cuda_paths.py

* Add Add SPDX-License-Identifier and Original LICENSE in findlib.py

* Very first draft of README.md

* Update README.md, mostly as revised by perplexity, with various manual edits.

* Refork cuda_paths.py AS-IS: https://github.com/NVIDIA/numba-cuda/blob/8c9c9d0cb901c06774a9abea6d12b6a4b0287e5e/numba_cuda/numba/cuda/cuda_paths.py

* ruff format cuda_paths.py (NO manual changes)

* Add back _get_numba_CUDA_INCLUDE_PATH from 2279bda (i.e. cuda_paths.py as it was right before re-forking)

* Remove cuda_paths.py dependency on numba.cuda.cudadrv.runtime

* Add Forked from URLs, two SPDX-License-Identifier, Original Numba LICENSE

* Temporarily restore debug changes under .github/workflows, for expanded path_finder test coverage

* Restore cuda_path.py AS-IT-WAS at commit 2279bda

* Revert "Restore cuda_path.py AS-IT-WAS at commit 2279bda"

This reverts commit 1b88ec2.

* Force compute-sanitizer off unconditionally

* Revert "Force compute-sanitizer off unconditionally"

This reverts commit 2bc7ef6.

* Add timeout=10 seconds to test_path_finder.py subprocess.run() invocations.

* Increase test_path_finder.py subprocess.run() timeout to 30 seconds:

Under Windows, loading cublas or cusolver may exceed the 10 second timeout:

#578 (comment)

* Revert "Temporarily restore debug changes under .github/workflows, for expanded path_finder test coverage"

This reverts commit 47ad79f.

* Force compute-sanitizer off unconditionally

* Add: Note that the search is done on a per-library basis.

* Add Note for CUDA_HOME / CUDA_PATH

* Add 0. **Check if a library was loaded into the process already by some other means.**

* _find_dll_using_nvidia_bin_dirs(): reuse lib_searched_for in place of file_wild

* Systematically replace all relative imports with absolute imports.

* handle: int → ctypes.CDLL fix

* Make load_dl_windows.py abs_path_for_dynamic_library() implementation maximally robust.

* Change argument name → libname for self-consistency

* Systematically replace previously overlooked relative imports with absolute imports.

* Simplify code (also for self-consistency)

* Expand the 3. **System Installations** section with information produced by perplexity

* Pull out `**Environment variables**` into an added section, after manual inspection of cuda_paths.py. Minor additional edits.

* Revert "Force compute-sanitizer off unconditionally"

This reverts commit aeaf4f0.

* Move _path_finder/sys_path_find_sub_dirs.py → find_sub_dirs.py, use find_sub_dirs_all_sitepackages() from find_nvidia_dynamic_library.py

* WIP (search priority updated in README.md but not in code)

* Revert "WIP (search priority updated in README.md but not in code)"

This reverts commit bf9734c.

* WIP (search priority updated in README.md but not in code)

* Completely replace cuda_paths.py to achieve the desired Search Priority (see updated README.md).

* Define `IS_WINDOWS = sys.platform == "win32"` in supported_libs.py

* Use os.path.samefile() to resolve issues with doubled backslashes.

* `load_in_subprocess(): Pass current environment

* Add run_python_code_safely.py as generated by perplexity, plus ruff format, bandit nosec

* Replace subprocess.run with run_python_code_safely

* Factor out `class Worker` to fix pickle issue.

* ChatGPT revisions based on Deep research:

https://chatgpt.com/share/681914ce-f274-8008-9e9f-4538716b4ed7

* Fix race condition in result queue handling by using timeout-based get()

The previous implementation checked result_queue.empty() before calling get(),
which introduces a classic race condition: the queue may become non-empty
immediately after the check, resulting in missed results or misleading errors.

This patch replaces the empty() check with result_queue.get(timeout=1.0),
allowing the parent process to robustly wait for results with a bounded delay.
Also switches from ctx.SimpleQueue() to ctx.Queue() for compatibility with
timeout-based get(), which SimpleQueue does not support on Python ≤3.12.

Note: The race condition was discovered by Gemini 2.5

* Resolve SIM108

* Change to "nppc" as ANCHOR_LIBNAME

* Implement CUDA_PYTHON_CUDA_HOME_PRIORITY first, last, with default first

* Remove retry_with_anchor_abs_path() and make retry_with_cuda_home_priority_last() the default.

* Update README.md to reflect new search priority

* SUPPORTED_LINUX_SONAMES does not need updates for CTK 12.9.0

* The only addition to SUPPORTED_WINDOWS_DLLS for CTK 12.9.0 is nvvm70.dll

* Make OSError in load_dl_windows.py abs_path_for_dynamic_library() more informative.

* run_cuda_bindings_path_finder.py: optionally use args as libnames (to aid debugging)

* Bug fix in load_dl_windows.py: ctypes.windll.kernel32.LoadLibraryW() returns an incompatible `handle`. Use win32api.LoadLibraryEx() instead to ensure self-consistency.

* Remove _find_nvidia_dynamic_library.retry_with_anchor_abs_path() method. Move run_python_code_safely.py to test/ directory.

* Add missing SPDX-License-Identifier
@rwgk rwgk changed the title Add path_finder.SUPPORTED_LIBNAMES [path_finder_dev] Add path_finder.SUPPORTED_LIBNAMES May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module feature New feature or request P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants