<SOLVED>Minecraft: Unable to use dedicated AMD Graphics

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
al_javier
Level 1
Level 1
Posts: 3
Joined: Mon Jul 26, 2021 3:57 am

<SOLVED>Minecraft: Unable to use dedicated AMD Graphics

Post by al_javier »

Summary:
I'm not entirely new to Linux Mint but I managed to find myself stumped with trying to run Minecraft's Java runtime with my dedicated AMD graphics. I tried various solutions including using an open-source launcher called MultiMC, creating a bash script to attempt to set environment variables to Java, and even edited the desktop launcher file of Minecraft itself.

MultiMC had some issues with Java versions and I saw that this was another deep rabbit hole that I needed to go through and decided it was probably best to avoid this route for now. Besides, even with wrapper commands it still can't detect my dedicated GPU.

The bash script just ends up hanging the launcher and I'd have to use xkill to stop it.

Editing the desktop launcher does absolutely nothing.

All three of the solutions mentioned above attempt to set the environment variable:

Code: Select all

DRI_PRIME=1
I'm going to be honest, I don't know if this works on Radeon GPUs.

Additional Background:
I did manage to make Minecraft use the dedicated AMD graphics on Windows 10. But ever since I made the complete jump to Linux, I wanted to make this feel more like home. All of my Steam games use the command:

Code: Select all

DXVK_FILTER_DEVICE_NAME=POLARIS11
Which allows games to take advantage of the dedicated graphics. Minecraft does not have this feature, at least not in its new launcher. Plus Minecraft uses OpenGL and not Vulkan, so the aforementioned commands won't work anyway.

I tried sifting through the laptop BIOS but I couldn't find anything remotely related to graphics in there. It's pretty limited and old-school looking as well. Maybe there's some way to manually set which GPU to use like those found on Nvidia? I've used Linux Mint on an Nvidia desktop before and it was pretty easy to set it up for gaming.

Other Information:
Device Type: Laptop
Manufacturer: Acer
Model: AN515-42 R8HN (Nitro 5)
Model Year: 2018
CPU: AMD Ryzen 5 2500U
Dedicated Graphics: Radeon RX560X (and a bunch of other names like Polaris 11)

System Info:

Code: Select all

System:
  Kernel: 5.4.0-80-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 
  Desktop: Cinnamon 4.8.6 wm: muffin 4.8.1 dm: LightDM 1.30.0 
  Distro: Linux Mint 20.1 Ulyssa base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop System: Acer product: Nitro AN515-42 v: V1.18 
  serial: <filter> 
  Mobo: RR model: Freed_RRS v: V1.18 serial: <filter> UEFI: Insyde v: 1.18 
  date: 06/18/2020 
Battery:
  ID-1: BAT1 charge: 35.0 Wh condition: 35.1/48.9 Wh (72%) volts: 16.3/15.2 
  model: LG 0x41,0x43,0x31,0x34,0x42,0x38,0x00EB type: Li-ion 
  serial: <filter> status: Unknown 
CPU:
  Topology: Quad Core model: AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx 
  bits: 64 type: MT MCP arch: Zen L2 cache: 2048 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 31941 
  Speed: 1423 MHz min/max: 1600/2000 MHz boost: enabled Core speeds (MHz): 
  1: 1473 2: 1458 3: 1425 4: 1396 5: 1378 6: 1372 7: 1369 8: 1373 
Graphics:
  Device-1: AMD Baffin [Radeon RX 460/560D / Pro 
  450/455/460/555/555X/560/560X] 
  vendor: Acer Incorporated ALI driver: amdgpu v: kernel bus ID: 01:00.0 
  chip ID: 1002:67ef 
  Device-2: AMD Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 
  vendor: Acer Incorporated ALI driver: amdgpu v: kernel bus ID: 04:00.0 
  chip ID: 1002:15dd 
  Display: x11 server: X.Org 1.20.9 driver: amdgpu,ati 
  unloaded: fbdev,modesetting,vesa resolution: 1920x1080~60Hz 
  OpenGL: renderer: AMD RAVEN (DRM 3.35.0 5.4.0-80-generic LLVM 11.0.0) 
  v: 4.6 Mesa 20.2.6 direct render: Yes 
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio 
  vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel 
  bus ID: 04:00.1 chip ID: 1002:15de 
  Device-2: AMD Family 17h HD Audio vendor: Acer Incorporated ALI 
  driver: snd_hda_intel v: kernel bus ID: 04:00.6 chip ID: 1022:15e3 
  Sound Server: ALSA v: k5.4.0-80-generic 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Acer Incorporated ALI driver: r8169 v: kernel port: 2000 
  bus ID: 02:00.1 chip ID: 10ec:8168 
  IF: enp2s0f1 state: down mac: <filter> 
  Device-2: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter 
  vendor: Lite-On driver: ath10k_pci v: kernel port: 2000 bus ID: 03:00.0 
  chip ID: 168c:003e 
  IF: wlp3s0 state: up mac: <filter> 
  IF-ID-1: docker0 state: down mac: <filter> 
Drives:
  Local Storage: total: 1.13 TiB used: 234.12 GiB (20.3%) 
  ID-1: /dev/sda vendor: Toshiba model: MQ04ABF100 size: 931.51 GiB 
  speed: 6.0 Gb/s rotation: 5400 rpm serial: <filter> rev: 1J scheme: GPT 
  ID-2: /dev/sdb vendor: Kingston model: SA400M8240G size: 223.57 GiB 
  speed: 6.0 Gb/s serial: <filter> rev: 61E1 scheme: GPT 
Partition:
  ID-1: / size: 218.57 GiB used: 82.74 GiB (37.9%) fs: ext4 dev: /dev/sdb2 
Sensors:
  System Temperatures: cpu: 46.2 C mobo: N/A 
  Fan Speeds (RPM): N/A 
  GPU: device: amdgpu temp: 51 C device: amdgpu temp: 46 C 
Repos:
  No active apt repos in: /etc/apt/sources.list 
  Active apt repos in: /etc/apt/sources.list.d/docker.list 
  1: deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
  1: deb http://packages.linuxmint.com ulyssa main upstream import backport #id:linuxmint_main
  2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
  3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
  4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
  5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
  6: deb http://archive.canonical.com/ubuntu/ focal partner
  Active apt repos in: /etc/apt/sources.list.d/spotify.list 
  1: deb http://repository.spotify.com stable non-free
  Active apt repos in: /etc/apt/sources.list.d/vscode.list 
  1: deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main
Info:
  Processes: 293 Uptime: 17m Memory: 18.53 GiB used: 2.83 GiB (15.2%) 
  Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Shell: bash 
  v: 5.0.17 running in: gnome-terminal inxi: 3.0.38 

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
cretsiah
Level 5
Level 5
Posts: 503
Joined: Wed Jul 22, 2020 5:44 am

Re: Minecraft: Unable to use dedicated AMD Graphics

Post by cretsiah »

well as a starting point, based on these 2 pages you look kinda screwed as there is no mention of opengl support

https://www.amd.com/en/products/apu/amd-ryzen-5-2500u

https://www.amd.com/en/products/graphics/radeon-rx-560x

as for multi mc it wont do minecraft 1.17 only upto 1.16.2 and thats if you make sure to install the right java as minecraft 1.17 doesnt work on anything lower than the latest.

as for using the graphics cards im not so sure, ive always found java edition to be cpu heavy not gpu heavy

sorry if that bums you out.... you may have wanted the bedrock edition
https://www.addictivetips.com/ubuntu-li ... -on-linux/
User avatar
SMG
Level 25
Level 25
Posts: 31971
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Minecraft: Unable to use dedicated AMD Graphics

Post by SMG »

al_javier wrote: Mon Jul 26, 2021 4:34 amAll three of the solutions mentioned above attempt to set the environment variable:

Code: Select all

DRI_PRIME=1
I'm going to be honest, I don't know if this works on Radeon GPUs.
It's my understanding it does as indicated in this thread Switchable Graphics on a Laptop, however, I am not familiar with the specific game you are wanting to run so I do not know if that will help you. You could take a Timeshift snapshot prior to making that change and test the change.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
al_javier
Level 1
Level 1
Posts: 3
Joined: Mon Jul 26, 2021 3:57 am

Re: Minecraft: Unable to use dedicated AMD Graphics

Post by al_javier »

cretsiah wrote: Mon Jul 26, 2021 5:49 am well as a starting point, based on these 2 pages you look kinda screwed as there is no mention of opengl support

https://www.amd.com/en/products/apu/amd-ryzen-5-2500u

https://www.amd.com/en/products/graphics/radeon-rx-560x

as for multi mc it wont do minecraft 1.17 only upto 1.16.2 and thats if you make sure to install the right java as minecraft 1.17 doesnt work on anything lower than the latest.

as for using the graphics cards im not so sure, ive always found java edition to be cpu heavy not gpu heavy

sorry if that bums you out.... you may have wanted the bedrock edition
https://www.addictivetips.com/ubuntu-li ... -on-linux/
Hi! Thanks for the reply.

I feel kind of silly and forgot to say that I have gotten the game running properly, it's just using integrated graphics. While the performance is respectable, it can be better.
SMG wrote: Mon Jul 26, 2021 10:37 am
al_javier wrote: Mon Jul 26, 2021 4:34 amAll three of the solutions mentioned above attempt to set the environment variable:

Code: Select all

DRI_PRIME=1
I'm going to be honest, I don't know if this works on Radeon GPUs.
It's my understanding it does as indicated in this thread Switchable Graphics on a Laptop, however, I am not familiar with the specific game you are wanting to run so I do not know if that will help you. You could take a Timeshift snapshot prior to making that change and test the change.
Hmm, I've tried adding the environment variable to some of my daily use apps via their respective .desktop files, they do work. Tried it on glxgears as well, it does work. I'm using Radeon Profile to monitor the GPU activity.

I'll try to keep researching on my free time on how to get Minecraft's Java Runtime to accept this environment variable.

Update:
I managed to make Minecraft run with the dedicated GPU. I took the time to write a how-to guide for everyone else to follow just in case they have the same issue as I did.

The guide is right here.
Locked

Return to “Graphics Cards & Monitors”