hashcat Forum
KaliLinux CUDA NVRTC_ERROR_INVALID_OPTION - 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: KaliLinux CUDA NVRTC_ERROR_INVALID_OPTION (/thread-11983.html)



KaliLinux CUDA NVRTC_ERROR_INVALID_OPTION - hillfias - 05-16-2024

Hello Smile

I'm on the latest The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali) Linux (brand new install).

Code:
─$ cat /proc/version
Linux version 6.6.15-amd64 (devel@The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali).org) (gcc-13 (Debian 13.2.0-13) 13.2.0, GNU ld (GNU Binutils for Debian) 2.42) #1 SMP PREEMPT_DYNAMIC The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali) 6.6.15-2kali1 (2024-04-09)

I have an old GPU, so I installed "legacy nvidia driver", the latest one, which supports my GPU, and still receives updates.
Code:
─$ hashcat -I                                                 
hashcat (v6.2.6) starting in backend information mode

CUDA Info:
==========

CUDA.Version.: 11.4

Backend Device ID #1
  Name...........: NVIDIA GeForce GTX 870M
  Processor(s)...: 7
  Clock..........: 967
  Memory.Total...: 3018 MB
  Memory.Free....: 2299 MB
  Local.Memory...: 48 KB
  PCI.Addr.BDFe..: 0000:01:00.0

OpenCL Info:
============

OpenCL Platform ID #1
  Vendor..: The pocl project
  Name....: Portable Computing Language
  Version.: OpenCL 3.0 PoCL 5.0+debian  Linux, None+Asserts, RELOC, SPIR, LLVM 16.0.6, SLEEF, DISTRO, POCL_DEBUG

  Backend Device ID #2
    Type...........: CPU
    Vendor.ID......: 128
    Vendor.........: GenuineIntel
    Name...........: cpu-haswell-Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz
    Version........: OpenCL 3.0 PoCL HSTR: cpu-x86_64-pc-linux-gnu-haswell
    Processor(s)...: 8
    Clock..........: 3500
    Memory.Total...: 13866 MB (limited to 2048 MB allocatable in one block)
    Memory.Free....: 6901 MB
    Local.Memory...: 256 KB
    OpenCL.Version.: OpenCL C 1.2 PoCL
    Driver.Version.: 5.0+debian



Code:
─$ nvidia-smi
Thu May 16 11:30:38 2024     
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.239.06  Driver Version: 470.239.06  CUDA Version: 11.4    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|        Memory-Usage | GPU-Util  Compute M. |
|                              |                      |              MIG M. |
|===============================+======================+======================|
|  0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 N/A |                  N/A |
| N/A  63C    P5    N/A /  N/A |    704MiB /  3018MiB |    N/A      Default |
|                              |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                             
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU  GI  CI        PID  Type  Process name                  GPU Memory |
|        ID  ID                                                  Usage      |
|=============================================================================|
|  No running processes found                                                |
+-----------------------------------------------------------------------------+

The compatible CUDA version is indicated to be 11.4 (not only as the output of nvidia-smi but also in the official documentation).

When I run hashcat to use CUDA, I unfortunately run into the following issue:

Code:
─$ hashcat -m 0 -a 0 hash.txt /usr/share/wordlists/fasttrack.txt
hashcat (v6.2.6) starting

* Device #1: This hardware has outdated CUDA compute capability (3.0).
            For modern OpenCL performance, upgrade to hardware that supports
            CUDA compute capability version 5.0 (Maxwell) or higher.
* Device #1: WARNING! Kernel exec timeout is not disabled.
            This may cause "CL_OUT_OF_RESOURCES" or related errors.
            To disable the timeout, see: https://hashcat.net/q/timeoutpatch
nvmlDeviceGetCurrPcieLinkWidth(): Not Supported

nvmlDeviceGetClockInfo(): Not Supported

nvmlDeviceGetFanSpeed(): Not Supported

nvmlDeviceGetClockInfo(): Not Supported

nvmlDeviceGetTemperatureThreshold(): Not Supported

nvmlDeviceGetTemperatureThreshold(): Not Supported

nvmlDeviceGetUtilizationRates(): Not Supported

CUDA API (CUDA 11.4)
====================
* Device #1: NVIDIA GeForce GTX 870M, 2280/3018 MB, 7MCU

OpenCL API (OpenCL 3.0 PoCL 5.0+debian  Linux, None+Asserts, RELOC, SPIR, LLVM 16.0.6, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
==================================================================================================================================================
* Device #2: cpu-haswell-Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz, 6901/13866 MB (2048 MB allocatable), 8MCU

Minimum password length supported by kernel: 0
Maximum password length supported by kernel: 256

Hashes: 1 digests; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Rules: 1

Optimizers applied:
* Zero-Byte
* Early-Skip
* Not-Salted
* Not-Iterated
* Single-Hash
* Single-Salt
* Raw-Hash

ATTENTION! Pure (unoptimized) backend kernels selected.
Pure kernels can crack longer passwords, but drastically reduce performance.
If you want to switch to optimized kernels, append -O to your commandline.
See the above message to find out about the exact limits.

Watchdog: Temperature abort trigger set to 90c

nvrtcCompileProgram(): NVRTC_ERROR_INVALID_OPTION

nvrtc: error: invalid value for --gpu-architecture (-arch)

* Device #1: Kernel /usr/share/hashcat/OpenCL/shared.cl build failed.

* Device #1: Kernel /usr/share/hashcat/OpenCL/shared.cl build failed.

Started: Thu May 16 11:30:31 2024
Stopped: Thu May 16 11:30:31 2024

What did I do wrong?

Is there any information you need that I haven't provided? Please don't hesitate Smile
Thank you very much for your help!


RE: KaliLinux CUDA NVRTC_ERROR_INVALID_OPTION - penguinkeeper - 05-16-2024

This is a common error. Try using `--backend-ignore-cuda` and it should work, it's just because your hardware is very old that nvrtc isn't very happy and neither is k ali


RE: KaliLinux CUDA NVRTC_ERROR_INVALID_OPTION - hillfias - 05-16-2024

Maybe I can add:
Code:
─$ nvcc -V 
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Wed_Jun__2_19:15:15_PDT_2021
Cuda compilation tools, release 11.4, V11.4.48
Build cuda_11.4.r11.4/compiler.30033411_0

And:
Code:
─$ echo $PATH && echo $LD_LIBRARY_PATH
/usr/local/cuda-11.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
/usr/local/cuda-11.4/lib64:

Also, the exact packages:
Code:
─$ apt list --installed | grep nvidia

firmware-nvidia-gsp/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 525.147.05-10 amd64 [installed,auto-removable]
glx-alternative-nvidia/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 1.2.2 amd64 [installed,automatic]
libegl-nvidia-tesla-470-0/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libgl1-nvidia-tesla-470-glvnd-glx/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libgles-nvidia-tesla-470-1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libgles-nvidia-tesla-470-2/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libglx-nvidia-tesla-470-0/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-compiler/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 525.147.05-10 amd64 [installed,auto-removable]
libnvidia-egl-wayland1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 1:1.1.13-1 amd64 [installed,automatic]
libnvidia-nvvm4/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 525.147.05-10 amd64 [installed,auto-removable]
libnvidia-ptxjitcompiler1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 525.147.05-10 amd64 [installed,auto-removable]
libnvidia-tesla-470-cbl/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-cfg1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-cuda1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-eglcore/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-encode1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-glcore/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-glvkspirv/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-ml1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-nvcuvid1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-ptxjitcompiler1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
libnvidia-tesla-470-rtcore/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-egl-common/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 525.147.05-10 amd64 [installed,automatic]
nvidia-installer-cleanup/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 20240109+1 amd64 [installed,automatic]
nvidia-kernel-common/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 20240109+1 amd64 [installed,automatic]
nvidia-modprobe/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 535.161.07-1 amd64 [installed,automatic]
nvidia-persistenced/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 525.147.05-1 amd64 [installed,automatic]
nvidia-settings-tesla-470/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.161.03-1 amd64 [installed,automatic]
nvidia-support/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 20240109+1 amd64 [installed,automatic]
nvidia-tesla-470-alternative/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-tesla-470-driver-bin/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-tesla-470-driver-libs/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-tesla-470-driver/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed]
nvidia-tesla-470-egl-icd/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-tesla-470-kernel-dkms/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-tesla-470-kernel-support/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-tesla-470-smi/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-tesla-470-vdpau-driver/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-tesla-470-vulkan-icd/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
nvidia-vulkan-common/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 525.147.05-10 amd64 [installed,automatic]
xserver-xorg-video-nvidia-tesla-470/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]
                                                                                                                                                                                                  ─$ apt list --installed | grep cuda 

libcudart12/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 12.0.146~12.0.1-4 amd64 [installed,auto-removable]
libnvidia-tesla-470-cuda1/The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali)-rolling,now 470.239.06-1 amd64 [installed,automatic]


I installed via nvidia-tesla-470 package for my legacy GPU and executed the runfile for CUDA 11.4
When installing CUDA via the runfile, multiple packages can be installed (of which, a driver that goes with CUDA 11.4).
I did not install the driver shipped with the runfile, only the CUDA toolkit.


RE: KaliLinux CUDA NVRTC_ERROR_INVALID_OPTION - hillfias - 05-16-2024

Hello @penguinkeeper,

Sorry, I missed your post while supplementing additional data.
Thanks for your response!

I'm aware that I can run hashcat on my CPU. However, I hope it will be faster on my GPU, albeit nothing comparable to a modern GPU (or CPU for that matter).

Is there a way to make nvrtc happy with my old hardware?


RE: KaliLinux CUDA NVRTC_ERROR_INVALID_OPTION - penguinkeeper - 05-16-2024

(05-16-2024, 12:30 PM)hillfias Wrote: Hello @penguinkeeper,

Sorry, I missed your post while supplementing additional data.
Thanks for your response!

I'm aware that I can run hashcat on my CPU. However, I hope it will be faster on my GPU, albeit nothing comparable to a modern GPU (or CPU for that matter).

Is there a way to make nvrtc happy with my old hardware?

Oh that's interesting that you don't have an OpenCL interface for your GPU, I didn't notice. That's incredibly rare. You may have to install OpenCL separately but as the forum has picked up on, The-Distribution-Which-Does-Not-Handle-OpenCL-Well (Kali) doesn't handle OpenCL at all well so if you can, it may just be easier to switch to a different distro or to Windows. It is possible to fix your error but would mean you'd have to edit code and I can't promise it'll be stable or accurate after the relatively brief modification


RE: KaliLinux CUDA NVRTC_ERROR_INVALID_OPTION - hillfias - 05-16-2024

That seems completely off, no?
I'm looking here and I see the API is OpenCL https://compubench.com/device.jsp?benchmark=compu15d&testgroup=compute&os=Windows&api=cl&D=NVIDIA+GeForce+GTX+870M
(well, it says Windows, but still)

I'm also pretty sure I've used this GPU, with this old laptop in the past both on windows and ubuntu, to perform some GPU CUDA tasks on hashcat...

It seems unnatural to me that the distribution made for pentesting has the most difficulty with harnessing GPU for password cracking haha

What can I do to make sure I haven't messed up anything related to the configuration/drivers?
What version of OpenCL should I install?

If you can shine some light on that matter Smile
Thanks!


RE: KaliLinux CUDA NVRTC_ERROR_INVALID_OPTION - Chick3nman - 05-16-2024

(05-16-2024, 01:44 PM)hillfias Wrote: It seems unnatural to me that the distribution made for pentesting has the most difficulty with harnessing GPU for password cracking haha

Yeah, welcome to the state of security tooling in general.