vk_raytrace
vk_raytrace copied to clipboard
Cant link with nvml.lib(nvml.dll) with VS2022
Hello,
During compilation with VS2022 of vk_raytrace.exe I ended with an error I can't fix.
\vk_raytrace\out\build\x64-Debug\nvml.lib(nvml.dll) : error LNK2001: symbole externe non résolu __delayLoadHelper2
I tried to add
C:\Program Files\NVIDIA Corporation\NVSMI\nvml.dll
C:\Program Files\NVIDIA Corporation\NVSMI\nvml.lib
I have installed latest CUDA 12.2 https://developer.nvidia.com/gpu-deployment-kit says : The GPU Deployment Kit is part of the CUDA Toolkit, in versions 8 and later, and is no longer available as a separate download.
I do not know how to proceed
Hi, there is something unusual in your log, the nvml.lib shouldn't show up in the build directory. Maybe you could try re-running CMake.
- Clear the out\build directory
- cd to the vk_raytrace
- mkdir build
- cd build
- cmake ..
Open the solution and try compiling again.
Note: The nvml DLL is part of the driver and will be store in a path similar to this:
C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_46b941c49f6a5e3e\nvml.dll
Hi @mklefrancois ,
Thanks for your message and your help proposal I tried to clean buil, rebuild etc.. but nothing worked
I find out that delayimp.lib hold the missing __delayLoadHelper2 symbol So I tried to add these two lines but without any success
target_link_libraries(${PROJNAME} debug "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/lib/x64/delayimp.lib")
target_link_libraries(${PROJNAME} optimized "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/lib/x64/delayimp.lib")
Is there any way to get the vk_raytrace exe directly and use it from command line ?
@pcarret Not sure where you tried to add target_link_libraries
mentioned but for me this works fine:
diff --git a/CMakeLists.txt b/CMakeLists.txt index cd662c6..7684636 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,7 @@ _add_project_definitions(${PROJNAME}) # For NVML, the DLL is loaded by the application if(MSVC) set_target_properties(${PROJNAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:nvml.dll") + target_link_libraries(${PROJNAME} "delayimp.lib") endif() #--------------------------------------------------------------------------------------------------