HON95 2 lat temu
rodzic
commit
0b3d444c8b
5 zmienionych plików z 67 dodań i 9 usunięć
  1. 10 3
      general/linux-general.md
  2. 5 5
      hpc/cuda.md
  3. 6 1
      hpc/rocm.md
  4. 41 0
      se/clang-llvm.md
  5. 5 0
      se/gcc.md

+ 10 - 3
general/linux-general.md

@@ -190,9 +190,15 @@ breadcrumbs:
 
 #### APT (Debian)
 
-- Dependencies:
-    - Find packages which this package depends on: `apt depends <package>`
-    - Find packages which depend on this package: `apt rdepends [--installed] <package>`
+- Basics:
+    - Update database: `apt update`
+    - Install package: `apt install <package>`
+    - Normal upgrade: `apt upgrade`
+    - Full upgrade (may remove packages): `apt full-upgrade`
+    - Show available versions: `apt list -a <package>`
+    - Show dependencies: `apt depends <package>`
+    - Show reverse dependencies: `apt rdepends [--installed] <package>`
+    - Lock package version: `apt-mark hold <package>`
 - Add repo (simple, not recommended):
     1. Add key: Download and run `apt-key add <key-file>`.
     1. Add repo: `add-apt-repository <repo-line>`
@@ -211,6 +217,7 @@ breadcrumbs:
         - The 8-digit hex key ID may either be found on `pub` line or as the last 8 hex digits on the continuation line.
 - Preferences:
     - Used to override package priorities, to control which package version or origin is used (or not).
+    - Show policy for package: `apt-cache policy <package>`
     - Preferences are stored in `/etc/apt/preferences` and `/etc/apt/preferences.d/<name>`.
 - Log:
     - See `/var/log/dpkg.log`.

+ 5 - 5
hpc/cuda.md

@@ -21,16 +21,16 @@ Introduced by NVIDIA in 2006. While GPU compute was hackishly possible before CU
 
 ## Resources
 
-- [CUDA GPUs (NVIDIA)](https://developer.nvidia.com/cuda-gpus)
-- [CUDA Programming Guide (NVIDIA)](https://docs.nvidia.com/cuda/cuda-c-programming-guide/)
+- [NVIDIA: CUDA GPUs](https://developer.nvidia.com/cuda-gpus)
+- [NVIDIA: CUDA Programming Guide](https://docs.nvidia.com/cuda/cuda-c-programming-guide/)
 
 ## Setup
 
 ### Resources
 
-- [NVIDIA CUDA Installation Guide for Linux (NVIDIA)](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)
-- [NVIDIA CUDA Installation Guide for Windows (NVIDIA)](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html)
-- [CUDA Toolkit Download (NVIDIA)](https://developer.nvidia.com/cuda-downloads)
+- [NVIDIA: CUDA Installation Guide for Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)
+- [NVIDIA: CUDA Installation Guide for Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html)
+- [NVIDIA: CUDA Toolkit Download](https://developer.nvidia.com/cuda-downloads)
 
 ### Linux Installation
 

+ 6 - 1
hpc/rocm.md

@@ -12,6 +12,7 @@ It uses the runtime API and kernel language HIP, which is compilable for both AM
 {:.no_toc}
 
 - [HIP](../hip/)
+- [Clang/LLVM](/se/clang-llvm/)
 
 ## Resources
 
@@ -51,6 +52,10 @@ Updated for ROCm 5.0.
 
 ## Usage and Tools
 
-- Show GPU info: `rocm-smi`
+### AMD GPUs
+
+- Show GPU stats: `rocm-smi`
+- Show CPU/GPU detauls: `rocminfo`
+- Get GPU arch: `rocminfo | grep gfx` (the shortest one)
 
 {% include footer.md %}

+ 41 - 0
se/clang-llvm.md

@@ -0,0 +1,41 @@
+---
+title: Clang/LLVM
+breadcrumbs:
+- title: Software Engineering
+---
+{% include header.md %}
+
+LLVM is an extensive compiler platform and toolchain. It's typically used as the compiler backend, with Clang as the frontend.
+
+### Related Pages
+{:.no_toc}
+
+- [GCC](../gcc/)
+
+## Usage
+
+- **TODO** Compilation (C++): `g++ ${CPPFLAGS} ${CXXFLAGS} -c -o file1.o file1.cpp`
+- **TODO** Linking (C++): `g++ ${LDFLAGS} ${LDLIBS} -o app file1.o file2.o`
+- Show supported targets
+
+## Options
+
+### Platform
+
+- Specify target CPU platform: `-target <platform>`
+    - E.g. `-target x86_64-unknown-linux-gnu`.
+    - This is generally needed only if cross-compiling, the default will be a target fitting the local computer.
+    - Use `llc --version` to show supported platforms.
+- Specify target OpenMP GPU platform/arch: `-fopenmp -fopenmp-targets=<platform> -Xopenmp-targets=<platform> -march <arch>`
+    - Requires an LLVM-based compiler with proper OpenMP offloading support, like AMD ROCm's LLVM.
+    - E.g. `-fopenmp -target x86_64-pc-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx1030` (AMD RX 6800 XT).
+    - E.g. `-fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target=nvptx64-nvidia-cuda -march=sm_60` (NVIDIA V100)
+
+## Hardware Offloading
+
+### NVIDIA GPUs (CUDA/NVPTX)
+
+- See: [LLVM: User Guide for NVPTX Back-end](https://llvm.org/docs/NVPTXUsage.html)
+- Target triple: `nvptx64-nvidia-cuda` (64-bit)
+
+{% include footer.md %}

+ 5 - 0
se/gcc.md

@@ -9,6 +9,11 @@ An optimizing compiler for C, C++ etc.
 
 The notes below mainly apply to C/C++, unless otherwise stated.
 
+### Related Pages
+{:.no_toc}
+
+- [Clang/LLVM](../clang-llvm/)
+
 ## Usage
 
 - Compilation (C++): `g++ ${CPPFLAGS} ${CXXFLAGS} -c -o file1.o file1.cpp`