PyTorch and other programs seem not to recognize laptop's dedicated GPU

I am relatively new to linux and have only been using fedora 40 for a few months. As part of a school project I am using PyTorch to train a semantic segmentation model. I have installed the ROCm version of PyTorch, but whenever I try to run my training program, it always returns an out of memory error.

The laptop I’m using is a ROG Zephyrus G14 GA402RK, which comes with both a Radeon 680M and an AMD Radeon RX 6800S 8 GB. PyTorch is “running out of memory” when it tries to allocate 20 MiB, so it is clearly not using the 8GB GPU. Running lspci | grep -i radeon I get this output:

❯ lspci | grep -i radeon
07:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] (rev c7)
07:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt Radeon High Definition Audio Controller

Which does not contain the Radeon RX 6800S. Running inxi -Fzxx I get this output:

  Kernel: 6.8.10-300.fc40.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.41-37.fc40
  Desktop: KDE Plasma v: 6.0.5 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
    Distro: Fedora Linux 40 (KDE Plasma)
  Type: Laptop System: ASUSTeK product: ROG Zephyrus G14 GA402RK_GA402RK
    v: 1.0 serial: <superuser required>
  Mobo: ASUSTeK model: GA402RK v: 1.0 serial: <superuser required>
    UEFI: American Megatrends LLC. v: GA402RK.318 date: 03/09/2023
  ID-1: BAT0 charge: 36.6 Wh (65.6%) condition: 55.8/76.0 Wh (73.5%)
    volts: 15.9 min: 15.9 model: ASUSTeK ASUS Battery serial: N/A
    status: discharging
  Device-1: hidpp_battery_0 model: Logitech M720 Triathlon Multi-Device
    Mouse serial: <filter> charge: 100% (should be ignored)
    status: discharging
  Info: 8-core model: AMD Ryzen 9 6900HS with Radeon Graphics bits: 64
    type: MT MCP arch: Zen 3+ rev: 1 cache: L1: 512 KiB L2: 4 MiB L3: 16 MiB
  Speed (MHz): avg: 832 high: 1397 min/max: 400/4935 cores: 1: 1372 2: 400
    3: 1397 4: 400 5: 1386 6: 400 7: 400 8: 400 9: 1389 10: 1397 11: 400 12: 400
    13: 1384 14: 400 15: 400 16: 1395 bogomips: 105398
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Device-1: AMD Rembrandt [Radeon 680M] vendor: ASUSTeK driver: amdgpu
    v: kernel arch: RDNA-2 pcie: speed: 16 GT/s lanes: 16 ports: active: eDP-1
    empty: DP-1, DP-2, DP-3, DP-4, DP-5, DP-6, DP-7, DP-8, Writeback-1
    bus-ID: 07:00.0 chip-ID: 1002:1681 temp: 45.0 C
  Device-2: Quanta USB2.0 HD UVC WebCam driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 3-3:3 chip-ID: 0408:30c3
  Display: wayland server: v: 1.20.14 with: Xwayland v: 24.1.0
    compositor: kwin_wayland driver: N/A display-ID: 0
  Monitor-1: eDP-1 res: 2560x1600 size: N/A
  API: EGL v: 1.5 platforms: device: 0 drv: radeonsi device: 1 drv: swrast
    surfaceless: drv: radeonsi wayland: drv: radeonsi x11: drv: radeonsi
    inactive: gbm
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.0.8 glx-v: 1.4
    direct-render: yes renderer: AMD Radeon Graphics (radeonsi rembrandt LLVM
    18.1.1 DRM 3.57 6.8.10-300.fc40.x86_64) device-ID: 1002:1681
    display-ID: :0.0
  API: Vulkan v: 1.3.280 surfaces: xcb,xlib,wayland device: 0
    type: integrated-gpu driver: N/A device-ID: 1002:1681 device: 1 type: cpu
    driver: N/A device-ID: 10005:0000
  Device-1: AMD Rembrandt Radeon High Definition Audio driver: snd_hda_intel
    v: kernel pcie: speed: 16 GT/s lanes: 16 bus-ID: 07:00.1 chip-ID: 1002:1640
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: ASUSTeK
    driver: snd_pci_acp6x v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 07:00.5 chip-ID: 1022:15e2
  Device-3: AMD Family 17h/19h HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 07:00.6 chip-ID: 1022:15e3
  API: ALSA v: k6.8.10-300.fc40.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.0.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
  Device-1: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
    vendor: AzureWave ASUS PCE-AXE59BT driver: mt7921e v: kernel pcie:
    speed: 5 GT/s lanes: 1 bus-ID: 05:00.0 chip-ID: 14c3:7922
  IF: wlp5s0 state: up mac: <filter>
  IF-ID-1: docker0 state: down mac: <filter>
  IF-ID-2: nordlynx state: unknown speed: N/A duplex: N/A mac: N/A
  Device-1: IMC Networks Wireless_Device driver: btusb v: 0.8 type: USB
    rev: 2.1 speed: 480 Mb/s lanes: 1 bus-ID: 5-1:2 chip-ID: 13d3:3568
  Report: btmgmt ID: hci0 rfk-id: 2 state: up address: <filter> bt-v: 5.2
    lmp-v: 11
  Local Storage: total: 953.87 GiB used: 72.71 GiB (7.6%)
  ID-1: /dev/nvme0n1 vendor: Micron model: 2450 MTFDKBA1T0TFK
    size: 953.87 GiB speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 33.9 C
  ID-1: / size: 428.69 GiB used: 72.24 GiB (16.9%) fs: btrfs
    dev: /dev/nvme0n1p5
  ID-2: /boot size: 973.4 MiB used: 403.6 MiB (41.5%) fs: ext4
    dev: /dev/nvme0n1p4
  ID-3: /boot/efi size: 256 MiB used: 78.2 MiB (30.5%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 428.69 GiB used: 72.24 GiB (16.9%) fs: btrfs
    dev: /dev/nvme0n1p5
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
  System Temperatures: cpu: 46.4 C mobo: 40.0 C gpu: amdgpu temp: 45.0 C
  Fan Speeds (rpm): cpu: 0
  Memory: total: 32 GiB note: est. available: 30.57 GiB used: 4.73 GiB (15.5%)
  Processes: 415 Power: uptime: 30m wakeups: 0 Init: systemd v: 255
    target: graphical (5) default: graphical
  Packages: pm: flatpak pkgs: 7 Compilers: clang: 17 gcc: 14.1.1 Shell: Zsh
    v: 5.9 running-in: konsole inxi: 3.3.34

Which also does not feature the Radeon RX 6800S anywhere.

Is there some driver I need to install or some command I need to run to fix this? What can I do to get fedora to recognize the other graphics card?