使用JustAResearcher/gpu-unlock-ada
安装nvcc:
1
| sudo apt install nvidia-cuda-toolkit
|
安装依赖:
1 2
| sudo apt install build-essential dkms linux-headers-$(uname -r) \ python3 zstd dpkg-dev debhelper devscripts fakeroot pciutils
|
安装:
测量改动前基线:
1 2 3
| mkdir -p build/matched-bench python3 tools/read_sm_rates.py --expect-uuid GPU-cf1051bd-7a48-1081-bba9-0845dec6dedb > stock-rates.json build/matched-bench/mma_bench 20000 5 > stock-mma.txt
|
获取显卡 PCI 地址:
1 2 3
| (base) aaa@aaa:~/project/gpu-unlock-ada$ python3 tools/print_boot_option.py RTX 4090 at 0000:01:00.0 [10de:2684]: gpu_unlock.targets=0000:01:00.0
|
编辑 /etc/default/grub,把参数加进已有引号内:
1
| GRUB_CMDLINE_LINUX_DEFAULT="gpu_unlock.targets=0000:01:00.0"
|
1 2 3 4 5 6 7 8 9 10
| (base) aaa@aaa:~$ journalctl -k -b --no-pager | grep -E 'gpu_unlock: unlocked|unlock failed|post-FLR SEC2' Oct 25 10:52:26 aaa kernel: pci 0000:01:00.0: post-FLR SEC2 reset released, GSP halted, BME=0 pending=0 WPR2=1ffffe00:00000000 SS0=88888888 SS1=00000008 Oct 25 10:52:26 aaa kernel: pci 0000:01:00.0: gpu_unlock: unlocked (base) aaa@aaa:~$ nvidia-smi -L GPU 0: NVIDIA GeForce RTX 4090 (UUID: GPU-cf1051bd-7a48-1081-bba9-0845dec6dedb) (base) aaa@aaa:~/gpu-unlock-ada$ python3 tools/read_sm_rates.py --expect-uuid GPU-cf1051bd-7a48-1081-bba9-0845dec6dedb {"gpu": "GPU-cf1051bd-7a48-1081-bba9-0845dec6dedb, NVIDIA GeForce RTX 4090, 00000000:01:00.0, 580.178.04, 450.00, 210, 405", "command": "0x20801230", "rates": {"imla0": 0, "fmla16": 0, "dp": 0, "fmla32": 0, "ffma": 0, "imla1": 0, "imla2": 0, "imla3": 0, "imla4": 0}, "meaning": "0=full; 1=half; 2=quarter; higher values are further reductions", "hardware_changes": false} (base) aaa@aaa:~/gpu-unlock-ada$ uname -r; cat /proc/cmdline 6.8.0-147-generic BOOT_IMAGE=/boot/vmlinuz-6.8.0-147-generic root=UUID=f88f7507-7df5-4506-a673-af3191a943d2 ro crashkernel=128M gpu_unlock.targets=0000:01:00.0
|
比对结果:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| == SM issue-rate selectors (0=full, 1=half) == fmla32 1 -> 0 fmla16 0 -> 0 imla2 1 -> 0 imla4 1 -> 0 dp 0 -> 0 [PASS] RM getter changed fmla32 1->0: half -> full
== mma_bench (register-resident issue rate) == mode stock unlocked ratio note f16/f32 170.0 338.8 1.993 expected ~2x bf16/f32 169.8 338.6 1.994 expected ~2x f16/f16 340.5 340.1 0.999 expected ~1x s8/s32 679.7 676.1 0.995 expected ~1x dp4a - - - ffma - - -
|