GPUOpen-Drivers / AMDVLK

AMD Open Source Driver For Vulkan
MIT License
1.69k stars 160 forks source link

Globally setting DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1 and pointing VK_ICD_FILENAMES to RADV .json files does not seem to work. #330

Closed sniperking0619 closed 1 month ago

sniperking0619 commented 1 year ago

I have both AMDVLK and RADV implementations of Vulkan installed globally, and in my /etc/environment file, I have set

DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json

and via env | grep -e 'DISABLE' -e 'ICD', I can see

VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json
DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1

With vulkaninfo --summary, I correctly see

Devices:
========
GPU0:
    apiVersion         = 1.3.238
    driverVersion      = 23.0.4
    vendorID           = 0x1002
    deviceID           = 0x73ff
    deviceType         = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
    deviceName         = AMD Radeon RX 6600 (RADV NAVI23)
    driverID           = DRIVER_ID_MESA_RADV
    driverName         = radv
    driverInfo         = Mesa 23.0.4
    conformanceVersion = 1.3.0.0
    deviceUUID         = 00000000-0c00-0000-0000-000000000000
    driverUUID         = 414d442d-4d45-5341-2d44-525600000000`

and I can see a moving 3D cube with VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json vkcube

However, most, if not all, games will seem to crash, presumably because they are running with AMDVLK despite setting those two environment variables in order to default to RADV. Removing those two variables and globally setting AMD_VULKAN_ICD=RADV seems to resolve the issue and games will run successfully with RADV upon rebooting, but I would like to use the RADV standard to load AMDVLK on a per-application basis via the VK_ICD_FILENAMES variable, and DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1 does not seem to enable the ability to do that despite it being the expected functionality.

Results of inxi -Fxz

System:
  Kernel: 6.1.31-2-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
    Desktop: GNOME v: 44.1 Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop System: Gigabyte product: B450M DS3H WIFI v: N/A
    serial: <superuser required>
  Mobo: Gigabyte model: B450M DS3H WIFI-CF serial: <superuser required>
    UEFI: American Megatrends LLC. v: F65a date: 02/09/2023
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard
    charge: 55% (should be ignored) status: discharging
  Device-2: sony_controller_battery_dc:af:68:d9:12:8a model: N/A charge: N/A
    status: discharging
CPU:
  Info: 6-core model: AMD Ryzen 5 3600 bits: 64 type: MT MCP arch: Zen 2
    rev: 0 cache: L1: 384 KiB L2: 3 MiB L3: 32 MiB
  Speed (MHz): avg: 2207 high: 2502 min/max: 2200/4208 boost: enabled cores:
    1: 2196 2: 2159 3: 2093 4: 2200 5: 2200 6: 2200 7: 2502 8: 2200 9: 2149
    10: 2194 11: 2195 12: 2200 bogomips: 86287
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Navi 23 [Radeon RX 6600/6600 XT/6600M] vendor: ASRock
    driver: amdgpu v: kernel arch: RDNA-2 bus-ID: 0c:00.0
  Device-2: Focusrite-Novation Scarlett 2i2 Camera
    driver: snd-usb-audio,usb-storage type: USB bus-ID: 1-5:2
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.1
    compositor: gnome-shell driver: X: loaded: amdgpu,modesetting,radeon
    dri: radeonsi gpu: amdgpu,evdi resolution: 1: 1920x1200~60Hz
    2: 1920x1200~60Hz
  API: OpenGL v: 4.6 Mesa 23.0.4 renderer: AMD Radeon RX 6600 (navi23 LLVM
    15.0.7 DRM 3.49 6.1.31-2-MANJARO) direct-render: Yes
Audio:
  Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel
    bus-ID: 0c:00.1
  Device-2: AMD Starship/Matisse HD Audio vendor: Gigabyte
    driver: snd_hda_intel v: kernel bus-ID: 0e:00.4
  Device-3: Focusrite-Novation Scarlett 2i2 Camera
    driver: snd-usb-audio,usb-storage type: USB bus-ID: 1-5:2
  Device-4: USB MIDI Interface driver: snd-usb-audio type: USB bus-ID: 1-6:3
  Device-5: DisplayLink Dell D3100 Docking Station driver: usbfs type: USB
    bus-ID: 4-4.1:3
  Device-6: DisplayLink Dell D3100 Docking Station
    driver: cdc_ncm,snd-usb-audio,usbfs type: USB bus-ID: 4-4.3:5
  API: ALSA v: k6.1.31-2-MANJARO status: kernel-api
  Server-1: PipeWire v: 0.3.70 status: active
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Gigabyte driver: r8168 v: 8.050.03-NAPI port: f000 bus-ID: 05:00.0
  IF: enp5s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi
    v: kernel bus-ID: 07:00.0
  IF: wlp7s0 state: down mac: <filter>
  IF-ID-1: enp14s0f3u4u3i5 state: down mac: <filter>
Bluetooth:
  Device-1: ASUSTek Broadcom BCM20702A0 Bluetooth driver: btusb v: 0.8
    type: USB bus-ID: 1-10:6
  Report: hciconfig ID: hci1 rfk-id: 1 state: up address: <filter> bt-v: 2.1
    lmp-v: 4.0
  Device-2: Intel Wireless-AC 3168 Bluetooth driver: btusb v: 0.8 type: USB
    bus-ID: 1-7:4
  Report: ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: <filter>
Drives:
  Local Storage: total: 3.64 TiB used: 1.87 TiB (51.3%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WDS100T3X0C-00SJG0
    size: 931.51 GiB temp: 43.9 C
  ID-2: /dev/sda vendor: Western Digital model: WDS200T2B0A-00SM50
    size: 1.82 TiB
  ID-3: /dev/sdb vendor: Western Digital model: WD10EZEX-08WN4A0
    size: 931.51 GiB
  ID-4: /dev/sdc model: Scarlett Welcome Disk size: 192 KiB type: USB
Partition:
  ID-1: / size: 195.8 GiB used: 58.82 GiB (30.0%) fs: ext4 dev: /dev/nvme0n1p2
  ID-2: /boot/efi size: 518.9 MiB used: 288 KiB (0.1%) fs: vfat
    dev: /dev/nvme0n1p4
  ID-3: /home size: 915.82 GiB used: 472.89 GiB (51.6%) fs: ext4
    dev: /dev/sdb1
Swap:
  ID-1: swap-1 type: partition size: 16.02 GiB used: 0 KiB (0.0%)
    dev: /dev/nvme0n1p1
Sensors:
  System Temperatures: cpu: 48.8 C mobo: 35.0 C gpu: amdgpu temp: 44.0 C
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 1272
Info:
  Processes: 385 Uptime: 23m Memory: available: 15.54 GiB
  used: 4.13 GiB (26.6%) Init: systemd Compilers: gcc: 13.1.1 clang: 15.0.7
  Packages: 1965 Shell: Zsh v: 5.9 inxi: 3.3.27