{"id":1817,"date":"2023-04-19T13:30:02","date_gmt":"2023-04-19T17:30:02","guid":{"rendered":"https:\/\/www.unliterate.net\/?p=1817"},"modified":"2023-04-19T13:30:48","modified_gmt":"2023-04-19T17:30:48","slug":"jack-and-coke-how-about-john-and-cuda-w-rocky-8-7-live","status":"publish","type":"post","link":"https:\/\/www.unliterate.net\/index.php\/2023\/04\/19\/jack-and-coke-how-about-john-and-cuda-w-rocky-8-7-live\/","title":{"rendered":"Jack and Coke? How about John and CUDA (w\/ Rocky 8.7 Live)"},"content":{"rendered":"\n<p>In previous writeups such as <a rel=\"noreferrer noopener\" href=\"\/index.php\/2022\/03\/19\/xmrig-with-cuda-for-rocky-linux-8-5\/\" target=\"_blank\">xmrig with cuda for Rocky Linux 8.5<\/a> and <a href=\"\/index.php\/2022\/03\/19\/nvidia-cuda-with-the-wrong-video-card\/\" target=\"_blank\" rel=\"noreferrer noopener\">nVidia CUDA with the wrong video card<\/a> I&#8217;ve navigated Rocky Linux and Cuda. It&#8217;s now time to see if we can get <a rel=\"noreferrer noopener\" href=\"https:\/\/www.openwall.com\/john\/\" target=\"_blank\">John the Ripper<\/a> CUDA&#8217;s components running on a <a rel=\"noreferrer noopener\" href=\"https:\/\/download.rockylinux.org\/pub\/rocky\/8.7\/live\/x86_64\/\" target=\"_blank\">Rocky 8.7 Live Workstation USB<\/a> install.<\/p>\n\n\n\n<p>Personally, I love projects like this. I started this on 1 8GB USB stick and quickly realized that not only the space required wasn&#8217;t enough but I&#8217;d need more to do what I needed. I ended up getting <a href=\"https:\/\/amazon.com\/dp\/B08HSS37H7\" target=\"_blank\" rel=\"noreferrer noopener\">3 SanDisk 32GB Ultra USB 3.0 Flash Drives from Amazon for $16.96<\/a>.<\/p>\n\n\n\n<p>The biggest help with the Live USB install is using <a rel=\"noreferrer noopener\" href=\"https:\/\/www.balena.io\/etcher\" target=\"_blank\">balenaEtcher<\/a> to get the 2.1GB ISO to an 32GB USB stick. Once that&#8217;s done we can boot directly to the Live OS and start our installs.<\/p>\n\n\n\n<p>I did have some derps with balenaEtcher failing to burn the ISO due to a failure of <em>diskpart<\/em> not returning a positive result to the <em>clean<\/em> operation. To resolve this I had to use <a rel=\"noreferrer noopener\" href=\"https:\/\/www.poweriso.com\/download.htm\" target=\"_blank\">PowerISO<\/a> to <em>clean<\/em> the USB volume before windows would properly do it&#8217;s clean operation. Minor note to PowerISO is that it contains bloatware during the install and a wrongly-clicked click can give you headaches.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Live Stuff<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Booted up Rocky 8.7 Workstation Live Workstation from a USB to <em>install<\/em> Rocky 8.7 Workstation on a separate USB stick.<\/li>\n\n\n\n<li>Root with password, user with password<\/li>\n\n\n\n<li>rebooted into USB bootable<\/li>\n\n\n\n<li>#win<\/li>\n<\/ul>\n\n\n\n<p>Now onto the necessities to get to our final goal<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Downloads and Installs<\/h2>\n\n\n\n<p>Fresh install and first boot leaves up with a bit of free space, albeit many of the nVidia and CUDA installs are hefty we might have to do some space-shifting to make sure this all works.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;user@johncuda ~]$ df -h\nFilesystem                           Size  Used Avail Use% Mounted on\ndevtmpfs                             3.9G     0  3.9G   0% \/dev\ntmpfs                                3.9G     0  3.9G   0% \/dev\/shm\ntmpfs                                3.9G  9.5M  3.9G   1% \/run\ntmpfs                                3.9G     0  3.9G   0% \/sys\/fs\/cgroup\n\/dev\/mapper\/rl_localhost--live-root   25G  5.4G   20G  22% \/\ntmpfs                                3.9G   60K  3.9G   1% \/tmp\n\/dev\/sdb1                           1014M  264M  751M  26% \/boot\ntmpfs                                789M   24K  789M   1% \/run\/user\/1000<\/code><\/pre>\n\n\n\n<p>There&#8217;s a ton of typical set up for something like this, such as updating everything. On an Intel(R) Core(TM)2 Quad CPU Q9650 @ 3.00GHz system running off a USB stick this takes quite a period of time.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo yum install epel-release\n$ sudo dnf config-manager --set-enabled powertools\n$ sudo \/usr\/bin\/crb enable\n$ sudo time dnf install kernel-devel-$(uname -r)\n...\n34.76user 11.92system 1:24.75elapsed 55%CPU (0avgtext+0avgdata 191272maxresident)k\n24992inputs+578976outputs (5major+1733808minor)pagefaults 0swaps<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Installing CUDA Toolkit<\/h2>\n\n\n\n<p>Downloading the <a href=\"https:\/\/developer.nvidia.com\/cuda-downloads?target_os=Linux&amp;target_arch=x86_64&amp;Distribution=Rocky&amp;target_version=8&amp;target_type=rpm_local\">nVidia CUDA Tooklit for Rocky 8<\/a> was a breeze. Installing it, however, took it&#8217;s sweet time<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ time sudo rpm -i cuda-repo-rhel8-12-1-local-12.1.0_530.30.02-1.x86_64.rpm\nwarning: cuda-repo-rhel8-12-1-local-12.1.0_530.30.02-1.x86_64.rpm: Header V4 RSA\/SHA512 Signature, key ID 1dcc03d4: NOKEY\n\nreal\t46m55.862s\nuser\t0m48.051s\nsys\t0m7.276s\n<\/code><\/pre>\n\n\n\n<p>Ran all the commands, rebooted, and cuda was installed but it seems that nvidia-driver:latest-dkms didn&#8217;t complete. Testing nvidia-smi resulted in the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;user@johncuda ~]$ nvidia-smi\nNVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">nVidia Driver<\/h2>\n\n\n\n<p>Per <a rel=\"noreferrer noopener\" href=\"\/index.php\/2022\/03\/19\/nvidia-cuda-with-the-wrong-video-card\/\" target=\"_blank\">nVidia CUDA with the wrong video card<\/a> we get to install the latest nVidia driver. Instead of downloading the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.nvidia.com\/Download\/driverResults.aspx\/186016\/en-us\/\" target=\"_blank\">470.103.01 (Jan 31, 2022) driver<\/a> from the previous post I&#8217;m gonna get the latest <a rel=\"noreferrer noopener\" href=\"https:\/\/www.nvidia.com\/Download\/driverResults.aspx\/200634\/en-us\/\" target=\"_blank\">470.182.03 (Mar 30, 2023) driver<\/a> for our Geforce GT630.<\/p>\n\n\n\n<p>The installer needed specific steps, such as &#8220;Continue&#8221; and &#8220;No&#8221; before it began to build new Kernel Modules. Clicked an awesome &#8220;No&#8221; for compatibility library installation. Received an error about libglvnd, which I don&#8217;t need. Finished with the nvidia-xconfig run and things finalized without an issue. Rebooted one more time to make sure I&#8217;m in the green and it completely failed.<\/p>\n\n\n\n<p>As a minor note it&#8217;s best to install all this stuff while X is not running. Quickly going to runlevel 4 and rerunning the driver install made it much easier and quicker things to finally work once kicking back on X.<\/p>\n\n\n\n<p>Prior to figuring all this out there were more weird steps. Rocky 8.7 workstation comes with the nouveau driver, an open-sourced nVidia driver, and this installation <a rel=\"noreferrer noopener\" href=\"https:\/\/support.huawei.com\/enterprise\/en\/doc\/EDOC1100165479\/93fe5683\/how-to-disable-the-nouveau-driver-for-different-linux-systems\" target=\"_blank\">required that it be disabled<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ nvidia-smi\nTue Apr 18 11:59:12 2023       \n+-----------------------------------------------------------------------------+\n| NVIDIA-SMI 470.182.03   Driver Version: 470.182.03   CUDA Version: 11.4     |\n|-------------------------------+----------------------+----------------------+\n| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |\n| Fan  Temp  Perf  Pwr:Usage\/Cap|         Memory-Usage | GPU-Util  Compute M. |\n|                               |                      |               MIG M. |\n|===============================+======================+======================|\n|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 N\/A |                  N\/A |\n| N\/A   35C    P8    N\/A \/  N\/A |    192MiB \/   981MiB |     N\/A      Default |\n|                               |                      |                  N\/A |\n+-------------------------------+----------------------+----------------------+\n                                                                               \n+-----------------------------------------------------------------------------+\n| Processes:                                                                  |\n|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |\n|        ID   ID                                                   Usage      |\n|=============================================================================|\n|  No running processes found                                                 |\n+-----------------------------------------------------------------------------+\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">John &amp; CUDA<\/h2>\n\n\n\n<p>A quick link out to <a rel=\"noreferrer noopener\" href=\"https:\/\/www.openwall.com\/john\/\" target=\"_blank\">John the Ripper<\/a> we get 1.9.0 jumbo downloaded.<\/p>\n\n\n\n<p>.\/configure led us to needing openssl-dev and opencl-headers. Compiling was quick and easy. Checking our built executable and the necessary support:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;user@johncuda run]$ .\/john --list=opencl-devices\nPlatform #0 name: NVIDIA CUDA, version: OpenCL 3.0 CUDA 11.4.364\n    Device #0 (1) name:     NVIDIA GeForce GT 630\n    Device vendor:          NVIDIA Corporation\n    Device type:            GPU (LE)\n    Device version:         OpenCL 3.0 CUDA\n    Driver version:         470.182.03 &#91;recommended]\n    Native vector widths:   char 1, short 1, int 1, long 1\n    Preferred vector width: char 1, short 1, int 1, long 1\n    Global Memory:          981 MB\n    Global Memory Cache:    32 KB\n    Local Memory:           48 KB (Local)\n    Constant Buffer size:   64 KB\n    Max memory alloc. size: 245 MB\n    Max clock (MHz):        901\n    Profiling timer res.:   1000 ns\n    Max Work Group Size:    1024\n    Parallel compute cores: 2\n    CUDA cores:             384  (2 x 192)\n    Speed index:            345984\n    Warp size:              32\n    Max. GPRs\/work-group:   65536\n    Compute capability:     3.5 (sm_35)\n    Kernel exec. timeout:   yes\n    NVML id:                0\n    PCI device topology:    01:00.0\n    Temperature:            38\u00b0C\n    Utilization:            n\/a\n<\/code><\/pre>\n\n\n\n<p>Now we&#8217;re good to go!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In previous writeups such as xmrig with cuda for Rocky Linux 8.5 and nVidia CUDA with the wrong video card I&#8217;ve navigated Rocky Linux and Cuda. It&#8217;s now time to see if we can get John the Ripper CUDA&#8217;s components running on a Rocky 8.7 Live Workstation USB install. Personally, I love projects like this. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,17],"tags":[],"class_list":["post-1817","post","type-post","status-publish","format-standard","hentry","category-geek-instructions","category-linux"],"_links":{"self":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/1817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/comments?post=1817"}],"version-history":[{"count":16,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/1817\/revisions"}],"predecessor-version":[{"id":1833,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/1817\/revisions\/1833"}],"wp:attachment":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/media?parent=1817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/categories?post=1817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/tags?post=1817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}