hashcat Forum
Feature request: better error message when the NVIDIA RTC library can't be loaded - Printable Version

+- hashcat Forum (https://hashcat.net/forum)
+-- Forum: Support (https://hashcat.net/forum/forum-3.html)
+--- Forum: hashcat (https://hashcat.net/forum/forum-45.html)
+--- Thread: Feature request: better error message when the NVIDIA RTC library can't be loaded (/thread-12171.html)



Feature request: better error message when the NVIDIA RTC library can't be loaded - blincoln - 09-24-2024

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.


RE: Feature request: better error message when the NVIDIA RTC library can't be loaded - Chick3nman - 09-25-2024

The error message could probably use an update, I agree, but I think it's important to point out that adding those paths is part of properly installing the CUDA Toolkit. If you do so using the Nvidia debs/runfiles, which I would strongly recommend over using any of the repos, it will tell you to add two paths to your env vars explicitly after the installer finishes running. It's also listed in the installation instructions here: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions

Handling of these and some similar errors should have gotten a few tweaks already actually, but likely will need a few more. You are running a version of hashcat from 11/2021 and some of those changes may have happened in 6.2.6 (09/2022) or perhaps after and thus would only be available in the beta builds/master branch. Best to update to the release version or perhaps beta to see if the behavior has changed at all or if it's still an issue.