09-24-2024, 10:38 PM
Hashcat 6.2.5 will generate the following error messages during a particular error condition:
Failed to initialize NVIDIA RTC library.
CUDA SDK Toolkit not installed or incorrectly installed.
CUDA SDK Toolkit required for proper device support and utilization.
The specific error condition is "Hashcat is unable to load or initialize the NVIDIA RTC library" (libnvrtc.so, libnvrtc.so.1, nvrtc.dylib, or nvrtc.dll, depending on the platform), but I don't think the error message makes that clear, especially because it can genuinely be tricky to get the combination of NVIDIA Linux driver and CUDA toolkit installed and working correctly.
I was still getting those errors on a new Debian install even after successfully building and running the sample code for the CUDA toolkit to verify that it really was installed correctly. I figured out what was really going by grepping through the Hashcat source code, but I think it would be much more helpful to change the message to something like:
"Hashcat was unable to find the NVIDIA RTC library (<filename>). Please verify that the file is present on your system, and in a location within the search path for shared libraries."
...that way, it would be much more obvious that the fix is to add something like this to .bashrc:
export LD_LIBRARY_PATH=/usr/local/cuda-12.5/targets/x86_64-linux/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
I realize that this would be slightly tricky, because the code that prints the existing error doesn't have access to the specific filename that couldn't be loaded, but I think it would make a really significant difference for users.
Failed to initialize NVIDIA RTC library.
CUDA SDK Toolkit not installed or incorrectly installed.
CUDA SDK Toolkit required for proper device support and utilization.
The specific error condition is "Hashcat is unable to load or initialize the NVIDIA RTC library" (libnvrtc.so, libnvrtc.so.1, nvrtc.dylib, or nvrtc.dll, depending on the platform), but I don't think the error message makes that clear, especially because it can genuinely be tricky to get the combination of NVIDIA Linux driver and CUDA toolkit installed and working correctly.
I was still getting those errors on a new Debian install even after successfully building and running the sample code for the CUDA toolkit to verify that it really was installed correctly. I figured out what was really going by grepping through the Hashcat source code, but I think it would be much more helpful to change the message to something like:
"Hashcat was unable to find the NVIDIA RTC library (<filename>). Please verify that the file is present on your system, and in a location within the search path for shared libraries."
...that way, it would be much more obvious that the fix is to add something like this to .bashrc:
export LD_LIBRARY_PATH=/usr/local/cuda-12.5/targets/x86_64-linux/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
I realize that this would be slightly tricky, because the code that prints the existing error doesn't have access to the specific filename that couldn't be loaded, but I think it would make a really significant difference for users.