The point of this thread is to ask for advice on what I can do with my available hardware.
I can’t believe I didn’t think of this before.
My old system:
- CPU: Ryzen 5800X3D
- GPU: Sapphire Radeon RX Vega 64, 8 GB HBM2
- GPU driver: amdgpu, using Mesa RADV/Vulkan
- RAM: 64GB DDR4 at 2133 MT/s (I seem to recall it being 2666 at some point…)
- Motherboard: x470 aorus gaming wifi 7
- bios version F65
- Storage: 500 GB WD Black NVMe SSD
Running ubuntu server 24.04
And the GPU is nicely working at x16, Pcie3:
$ sudo lspci -vv -s 0c:00.0 | grep -E 'LnkCap:|LnkSta:'
LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
LnkSta: Speed 8GT/s, Width x16
After asking some instructions, I got llama.cpp set up and getting results like this:
~/llama.cpp$ ~/llama.cpp/build/bin/llama-cli -hf bartowski/Qwen2.5-Coder-3B-Instruct-GGUF:Q4_K_M -ngl 99 -c 4096 -p "Write a Bash script that prints the 10 largest files in my home directory." -n 256
Loading model...
▄▄ ▄▄
██ ██
██ ██ ▀▀█▄ ███▄███▄ ▀▀█▄ ▄████ ████▄ ████▄
██ ██ ▄█▀██ ██ ██ ██ ▄█▀██ ██ ██ ██ ██ ██
██ ██ ▀█▄██ ██ ██ ██ ▀█▄██ ██ ▀████ ████▀ ████▀
██ ██
▀▀ ▀▀
build : b11639-a0e6dc738
model : bartowski/Qwen2.5-Coder-3B-Instruct-GGUF:Q4_K_M
ftype : Q4_K - Medium
modalities : text
available commands:
/exit or Ctrl+C stop or exit
/regen regenerate the last response
/clear clear the chat history
/read <file> add a text file
/glob <pattern> add text files using globbing pattern
> Write a Bash script that prints the 10 largest files in my home directory.
Certainly! Below is a Bash script that prints the 10 largest files in your home directory. This script uses the `ls`, `sort`, and `head` commands to achieve the desired output.
```bash
#!/bin/bash
# Get the home directory of the current user
home_dir="$HOME"
# Find all files in the home directory and sort them by size in descending order
# Use 'head' to get the top 10 files
find "$home_dir" -type f -print0 | xargs -0 du -h | sort -rh | head -n 10
```
### How the Script Works:
1. **`find` Command**:
- `find "$home_dir" -type f -print0` searches for all files (`-type f`) in the specified home directory (`"$HOME"`). The `-print0` option ensures that filenames with spaces or special characters are handled correctly.
2. **`xargs` Command**:
- `xargs -0 du -h` calculates the size of each file found by `find`. The `-0` option tells `xargs` to expect input files separated by null characters, which is the default output format for `find -print
[ Prompt: 415.0 t/s | Generation: 109.1 t/s ]
And for a larger model:
~/llama.cpp$ ~/llama.cpp/build/bin/llama-cli \
-hf Jackrong/Qwopus3.6-27B-Coder-GGUF:Q4_K_M \
-ngl 16 \
-c 4096 \
-p "Write a Bash script that finds the 10 largest files in my home directory. Explain each part of the script." \
-n 512
Downloading mmproj-F32.gguf ──────────────────────────────────────── 100%
Downloading Qwopus3.6-27B-Coder-Q4_K_M.gguf ──────────────────────── 100%
Loading model...
▄▄ ▄▄
██ ██
██ ██ ▀▀█▄ ███▄███▄ ▀▀█▄ ▄████ ████▄ ████▄
██ ██ ▄█▀██ ██ ██ ██ ▄█▀██ ██ ██ ██ ██ ██
██ ██ ▀█▄██ ██ ██ ██ ▀█▄██ ██ ▀████ ████▀ ████▀
██ ██
▀▀ ▀▀
build : b11639-a0e6dc738
model : Jackrong/Qwopus3.6-27B-Coder-GGUF:Q4_K_M
ftype : Q4_K - Medium
modalities : text, vision, video
available commands:
/exit or Ctrl+C stop or exit
/regen regenerate the last response
/clear clear the chat history
/read <file> add a text file
/glob <pattern> add text files using globbing pattern
/image <file> add an image file
/video <file> add a video file
> Write a Bash script that finds the 10 largest files in my home directory. Explain each part of the script.
[Start thinking]
1. **Understand the Goal:** The user wants a Bash script to find the 10 largest files within their home directory and an explanation of how the script works.
2. **Identify the Core Command:** The `find` command is the standard Unix tool for locating files. To sort by size and take the top 10, we need to combine it with `sort` and `head`.
* *Find files:* `find ~`
* *Only files, not directories:* `-type f`
* *Print with size in a readable format (or bytes):* `-printf '%s %p\n'` (where `%s` is size in bytes, `%p` is the file path). *Alternative:* `ls -lhS` is often used but has issues with filenames containing spaces and doesn't recurse as cleanly as `find`. Let's stick to `find` for robustness, or `find ... -exec ls -lh {} + | sort ...`. Actually, the most robust and standard way is `find ~ -type f -exec ls -lh {} + | sort -k5 -rh | head -n 10`.
* *Wait, let's evaluate the `find -printf` vs `find + ls` approach:*
* `find ~ -type f -printf '%s %p\n' | sort -rn | head -n 10` -> This is very efficient. It prints the size in bytes, then the path. Then sort numerically in reverse, then take the top 10.
* However, showing the size in *bytes* might not be user-friendly (e.g., 1073741824 bytes).
* Let's use `find ~ -type f -exec ls -lhS {} + | sort -k5 -rh | head -n 10`. Wait, `ls -lhS` sorts by size already, but sorting across multiple files from different directories can be tricky with `ls` because `ls` sorts within its arguments, but `find` passes batches. Actually, `find ~ -type f -exec ls -lh {} + | sort -k5 -rh | head -n 10` works perfectly.
* Let's check the sorting column for `ls -lh`: The 5th column is size. `-rh`
[ Prompt: 14.0 t/s | Generation: 2.2 t/s ]
This seems awesome. Self-hosted LLM and it’s working pretty decent. Who would have thought this old Vega64 would still be useful for something.
Cloned llama.cpp and compiled locally.
Compile commands used:
cmake -B build -DGGML_VULKAN=1 -DLLAMA_OPENSSL=ON
cmake --build build --config Release -j2
Although it seems I compiled against the latest commit on the master branch, a0e6dc7 …
But, I’m pretty new to this. I’m wondering what the recommended tools there are to use. Things to enhance the experience, maybe have a local gui, quality of life things, etc…
Or maybe realize how limited I am?
Any advice is appreciated.
I’m told this is important information:
~$ env -u DISPLAY -u WAYLAND_DISPLAY vulkaninfo --summary
'DISPLAY' environment variable not set... skipping surface info
==========
VULKANINFO
==========
Vulkan Instance Version: 1.3.275
Instance Extensions: count = 24
-------------------------------
VK_EXT_acquire_drm_display : extension revision 1
VK_EXT_acquire_xlib_display : extension revision 1
VK_EXT_debug_report : extension revision 10
VK_EXT_debug_utils : extension revision 2
VK_EXT_direct_mode_display : extension revision 1
VK_EXT_display_surface_counter : extension revision 1
VK_EXT_headless_surface : extension revision 1
VK_EXT_surface_maintenance1 : extension revision 1
VK_EXT_swapchain_colorspace : extension revision 5
VK_KHR_device_group_creation : extension revision 1
VK_KHR_display : extension revision 23
VK_KHR_external_fence_capabilities : extension revision 1
VK_KHR_external_memory_capabilities : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2 : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2 : extension revision 1
VK_KHR_portability_enumeration : extension revision 1
VK_KHR_surface : extension revision 25
VK_KHR_surface_protected_capabilities : extension revision 1
VK_KHR_wayland_surface : extension revision 6
VK_KHR_xcb_surface : extension revision 6
VK_KHR_xlib_surface : extension revision 6
VK_LUNARG_direct_driver_loading : extension revision 1
Instance Layers: count = 3
--------------------------
VK_LAYER_INTEL_nullhw INTEL NULL HW 1.1.73 version 1
VK_LAYER_MESA_device_select Linux device selection layer 1.4.303 version 1
VK_LAYER_MESA_overlay Mesa Overlay layer 1.4.303 version 1
Devices:
========
GPU0:
apiVersion = 1.4.318
driverVersion = 25.2.8
vendorID = 0x1002
deviceID = 0x687f
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
deviceName = AMD Radeon RX Vega (RADV VEGA10)
driverID = DRIVER_ID_MESA_RADV
driverName = radv
driverInfo = Mesa 25.2.8-0ubuntu0.24.04.4
conformanceVersion = 1.4.0.0
deviceUUID = 00000000-0c00-0000-0000-000000000000
driverUUID = 414d442d-4d45-5341-2d44-525600000000
GPU1:
apiVersion = 1.4.318
driverVersion = 25.2.8
vendorID = 0x10005
deviceID = 0x0000
deviceType = PHYSICAL_DEVICE_TYPE_CPU
deviceName = llvmpipe (LLVM 20.1.2, 256 bits)
driverID = DRIVER_ID_MESA_LLVMPIPE
driverName = llvmpipe
driverInfo = Mesa 25.2.8-0ubuntu0.24.04.4 (LLVM 20.1.2)
conformanceVersion = 1.3.1.1
deviceUUID = 6d657361-3235-2e32-2e38-2d3075627500
driverUUID = 6c6c766d-7069-7065-5555-494400000000
And this:
~/llama.cpp$ ./build/bin/llama-cli --list-devices
Available devices:
Vulkan0: AMD Radeon RX Vega (RADV VEGA10) (8192 MiB, 8180 MiB free)