Tuesday, May 17, 2022

GPU, HPC, etc info and resources


Linux Graphics Stack

  • Nice overview
    • https://www.reddit.com/r/archlinux/comments/6la6n5/trying_to_understand_drm_dri_mesa_radeon_gallium/
  • X
    • https://wiki.archlinux.org/title/Xorg

Radeon / AMDGPU Driver

  • https://wiki.gentoo.org/wiki/Radeon
  • https://wiki.gentoo.org/wiki/AMDGPU
  • https://wiki.gentoo.org/wiki/AMDVLK
  • https://www.x.org/wiki/RadeonFeature/
  • https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#power-dpm-force-performance-level
  • https://www.x.org/wiki/RadeonFeature/#Decoder_ring_for_engineering_vs_marketing_names
  • https://kernel.org/doc/html/latest/gpu/amdgpu/display/display-manager.html

Ubuntu Certification for 20.04 LTS
  • https://ubuntu.com/certified/component/754

Intel Driver

  • https://linuxreviews.org/Intel_Iris
  • https://linuxreviews.org/Intel_graphics

NVidia GPU modules

  • https://github.com/NVIDIA/open-gpu-kernel-modules

GPU

  • https://wiki.gentoo.org/wiki/AMDGPU#Identifying_which_graphics_card_is_in_use
  • https://help.ubuntu.com/community/AMDGPU-Driver
  • lspci | grep -i VGA 
00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630] (rev 02)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Oland [Radeon HD 8570 / R5 430 OEM / R7 240/340 / Radeon 520 OEM] (rev 87)

A confusing aspect of this is that "Oland" is indicated as part of the Southern Islands family but some sites show other information which seems to conflict. This is especially true when you try to look up the individual models listed. The HD 8570 is indicated generally as a rebranded HD 7000 series. The "Southern Islands" family has a codename alias of "Sea Islands" [according to Wikipedia].   

  • Radeon HD 8570
    • https://www.techpowerup.com/gpu-specs/radeon-hd-8570-oem.c1974
      • Oland Sea Islands, Release 2013
    • https://en.wikipedia.org/wiki/Radeon_HD_8000_series
  • Radeon R7 240
    • https://www.techpowerup.com/gpu-specs/radeon-r7-240.c2463
      • Oland Volcanic Islands, Release 2013
    • https://en.wikipedia.org/wiki/Radeon_200_series
  • Radeon R7 340
    • Oland XT, Release 2015
    • https://en.wikipedia.org/wiki/Radeon_300_series
  • Radeon R5 430 OEM
    • https://www.techpowerup.com/gpu-specs/radeon-r5-430-oem.c2893
      • Oland Artic Islands, Release 2016
    • https://en.wikipedia.org/wiki/Radeon_400_series
  • Radeon 520 OEM
    • https://www.techpowerup.com/gpu-specs/radeon-520-oem.c4061
      • Oland Polaris, Release 2017

GPU docs

  • http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/SI_3D_registers.pdf
  • http://developer.amd.com/wordpress/media/2013/10/si_programming_guide_v2.pdf
  • http://developer.amd.com/wordpress/media/2013/07/AMD_Sea_Islands_Instruction_Set_Architecture.pdf
  • http://developer.amd.com/wordpress/media/2012/12/AMD_Southern_Islands_Instruction_Set_Architecture.pdf

GPU Firmware

  • https://wiki.gentoo.org/wiki/AMDGPU#Identifying_which_graphics_card_is_in_use
  • ls /lib/firmware/amdgpu/oland_{ce,mc,me,pfp,rlc,smc}
OLAND
radeon/{oland_{ce,mc,me,pfp,rlc,smc}

Debugging / Info

  • https://wiki.gentoo.org/wiki/Radeon
  • https://wiki.gentoo.org/wiki/AMDGPU#Identifying_which_graphics_card_is_in_use
  • DRI_PRIME=1   ; prefix for commands where gpu is secondary
  • amoeba
  • clinfo
  • dmidecode
  • drm_info
  • glmark2
  • glxdemo
  • glxinfo
  • glxgears
  • glxheads
  • GLZ
  • hardinfo
  • lsgpu
  • lshw
  • lsmod | grep -E  "amd|radeon|i915|vesa" 
  • lspci
  • rocminfo
  • sensors
  • vainfo
  • vdpauinfo
  • vkcube
  • vkvia
  • vulkaninfo
  • xrandr
  • xdriinfo

Intel i915 tweak

  • sudo sysctl dev.i915.perf_stream_paranoid=0

VDPAU - Video Decode and Presentation API for Unix

  • https://wiki.gentoo.org/wiki/VDPAU
  • grep -i vdpau /var/log/Xorg.0.log
[    94.821] (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
[    98.102] (II) modeset(G0): [DRI2]   VDPAU driver: va_gl

  • export VDPAU_DRIVER=radeonsi
  • DRI_PRIME=1   ; prefix for commands when gpu is secondary
  • vdpauinfo

VAAI - Video Acceleration API)

  • https://wiki.gentoo.org/wiki/VAAPI
  • DRI_PRIME=1   ; prefix for commands when gpu is secondary
  • LIBVA_DRIVER_NAME=
    • radeonsi ; For amd/ati
    • i965 ; For libva-intel-driver
    • iHD  ; For libva-intel-media-driver
  • vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Mesa Gallium driver 22.2.0-devel for OLAND (oland, LLVM 14.0.0, DRM 3.44, 5.17.6-051706-generic)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointEncSlice
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointEncSlice
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileNone : VAEntrypointVideoProc

Vulcan

  • https://wiki.gentoo.org/wiki/Vulkan
  • https://vulkan.gpuinfo.org/
  • https://www.phoronix.com/scan.php?page=news_item&px=RADV-LBVH-Lands
  • vulkaninfo

OPENGL 

  • glxinfo | grep "OpenGL renderer" 
OpenGL renderer string: OLAND (oland, LLVM 14.0.0, DRM 3.44, 5.17.6-051706-generic)

OpenCL

  • https://wiki.gentoo.org/wiki/OpenCL#AMD
  • https://dri.freedesktop.org/wiki/GalliumCompute/
  • https://packages.gentoo.org/packages/dev-libs/intel-compute-runtime
  • https://packages.gentoo.org/packages/dev-util/intel-ocl-sdk
  • https://packages.gentoo.org/packages/dev-libs/ocl-icd
  • https://packages.gentoo.org/packages/dev-libs/rocr-runtime
  • https://packages.gentoo.org/packages/virtual/opencl
  • See ROCm below.
  • clinfo

ROCm OpenCL/HIP/MPI

  • https://en.wikipedia.org/wiki/ROCm
  • https://packages.gentoo.org/packages/dev-libs/rocm-opencl-runtime
  • https://github.com/RadeonOpenCompute/ROCm
  • https://packages.gentoo.org/packages/dev-libs/rocr-runtime
  • rocminfo
    • [update 2022/07/08] This finally doesn't segfault!!! To get to this point I ended up on Linux Kernel 5.18.10-051810-generic and Ubuntu 22.10 Kinetic Kudu along with lots of time messing with installs. Just use the amdgpu that comes with the kernel - don't try to get some external version. The DKMS pain was very high, time consuming and finally I gave up on that and found the bundled-with-kernel pieces worked fine.  I am able to use all 3 of my monitors with my desktop again.
ROCk module is loaded
=====================    
HSA System Attributes    
=====================    
Runtime Version:         1.1
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:  18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model:           LARGE                              
System Endianness:       LITTLE                             

SYCL

  • https://www.khronos.org/sycl/
  • https://www.khronos.org/sycl/resources
Checking for available devices:
sycl-ls

[opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz OpenCL 3.0 (Build 0) [2024.18.7.0.11_160000]

Running a slightly modified version of the Intel OneAPI "vector-add-buffers" C++/sycl sample produces:

Platform: Intel(R) FPGA Emulation Platform for OpenCL(TM)
  Device: Intel(R) FPGA Emulation Device
Platform: Intel(R) OpenCL
  Device: Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
Platform: SYCL host platform
  Device: SYCL host device
Cannot select a GPU
No device of requested type available. Please check https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.html -1 (CL_DEVICE_NOT_FOUND)
Using a CPU device
Running on device: Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
Vector size: 10000
[0]: 0 + 0 = 0
[1]: 1 + 1 = 2
[2]: 2 + 2 = 4
...
[9999]: 9999 + 9999 = 19998
Vector add successfully completed on device.

OpenMPI

  • https://www.open-mpi.org/
  • https://www.open-mpi.org/software/ompi/v4.1/
  • https://en.wikipedia.org/wiki/MPICH

./mpi_hello_world
Hello world from processor scott-z1, rank 0 out of 1 processors

OpenMP

  • https://www.openmp.org/wp-content/uploads/HybridPP_Slides.pdf
  • http://pawangh.blogspot.com/2014/05/mpi-vs-openmp.html

OMP_NUM_THREADS=3 ./hello

Hello World... from thread = 0
Hello World... from thread = 1
Hello World... from thread = 2

X-Windows

  • xdriinfo 
    • usages:
      • xdriinfo
      • xdriinfo options i915
      • xdriinfo options amdgpu
      • xdriinfo options radeon
  • xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x52 cap: 0x9, Source Output, Sink Offload crtcs: 2 outputs: 2 associated providers: 1 name:Unknown AMD Radeon GPU @ pci:0000:01:00.0
Provider 1: id: 0xa9 cap: 0x6, Sink Output, Source Offload crtcs: 3 outputs: 5 associated providers: 1 name:modesetting

Snapshot of GLZ info



Misc Links

  • https://www.anandtech.com/show/16775/amd-moves-gcn-1-2-3based-gpus-and-apus-to-legacy-also-drops-win7-support
  • https://gpuopen.com/learn/amdgcn-assembly/
  • https://kernel.org/doc/html/latest/gpu/amdgpu/display/display-manager.html
  • https://wiki.archlinux.org/title/Kernel_mode_setting
  • https://askubuntu.com/questions/1279420/amd-kernel-modesetting
  • https://ubuntu-mate.community/t/vgacon-disables-amdgpu-kernel-modesetting-amdgpu-init/23001/4
  • https://wiki.archlinux.org/title/AMDGPU
  • https://wiki.archlinux.org/title/ATI
  • https://wiki.debian.org/KernelModesetting
  • https://askubuntu.com/questions/1166054/disables-amd-gpu-kernel
  • https://unix.stackexchange.com/questions/730113/how-does-linux-set-older-gpus-to-use-modsetting-drivers-in-x-server
  • https://wiki.gentoo.org/wiki/AMDVLK
  • https://wiki.archlinux.org/title/Xorg
  • https://man.archlinux.org/man/extra/xorg-server/modesetting.4.en
  • https://dri.freedesktop.org/wiki/ConfigurationInfrastructure/
  • https://dri.freedesktop.org/wiki/DriConf/