Need help to set up prime-run %command% for steam games

I have been trying to set up prime-run %command% for Deus Ex and other games on steam (like recommended in various threads here) instead of running prime-run steam.

Short search on the web gives decent tutorials which have not worked so far for me (which means I am doing something wrong).

On steam support I followed

1 Right clicked the game and went into "Properties"
2 Clicked on SET LAUNCH OPTIONS (I had no launchers there to begin with) and did prime-run Deus. Rebooted and then tried the terminal prime-run Deus, prime-run %Deus%. I have also changed the SET LAUNCH OPTIONS to prime-run %Deus%, rebooted and tried the terminal like before which did not work.
3. Followed this guide (but only the last part, I DID NOT SET UP BUMBLEBEE

1) Add the OPTIMUS_PREFIX variable to your environment

sudo sh -c 'echo OPTIMUS_PREFIX="primusrun" >> /etc/environment'

2) Logout and login from you session

Seriously. Desktop session, not Steam session. Steam is closed.

3) Configure each game you want

For each game you want to launch using you high powered nVidia card do:

  1. Select a game from the Library page of the Steam client, right-click, and
    select Properties.
  2. Click the SET LAUNCH OPTIONS button and specify $OPTIMUS_PREFIX %command%
    for the command line.
  3. Save your changes.

So far none of this has worked for me.
I have ALL of my games located on an external HDD, don't know if that is relevant.

inxi -Fxxxza -no-host
~ >>> inxi -Fxxxza -no-host                                                 [1]
  Host: HP Kernel: 5.7.14-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.1.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.7-x86_64 
  root=UUID=9a466d45-9706-4f31-8e9b-737ed449768e rw quiet apparmor=1 
  security=apparmor udev.log_priority=3 
  Desktop: GNOME 3.36.4 tk: GTK 3.24.21 wm: gnome-shell dm: GDM 3.34.1 
  Distro: Manjaro Linux 
  Type: Laptop System: HP product: HP Pavilion Gaming Laptop 15-cx0xxx 
  v: Type1ProductConfigId serial: <filter> Chassis: type: 10 
  serial: <filter> 
  Mobo: HP model: 8478 v: 70.57 serial: <filter> UEFI: Insyde v: F.22 
  date: 04/21/2020 
  ID-1: BAT1 charge: 36.9 Wh condition: 36.9/52.8 Wh (70%) volts: 12.8/11.6 
  model: Hewlett-Packard PABAS0241231 type: Li-ion serial: <filter> 
  status: Full 
  Topology: Quad Core model: Intel Core i5-8300H bits: 64 type: MT MCP 
  arch: Kaby Lake family: 6 model-id: 9E (158) stepping: A (10) 
  microcode: D6 L2 cache: 8192 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 36812 
  Speed: 800 MHz min/max: 800/4000 MHz Core speeds (MHz): 1: 800 2: 800 
  3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 
  Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds mitigation: Microcode 
  Type: tsx_async_abort status: Not affected 
  Device-1: Intel UHD Graphics 630 vendor: Hewlett-Packard driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:3e9b 
  Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] vendor: Hewlett-Packard 
  driver: nvidia v: 440.100 alternate: nouveau,nvidia_drm bus ID: 01:00.0 
  chip ID: 10de:1c8d 
  Device-3: Cheng Uei Precision Industry (Foxlink) HP Wide Vision HD 
  Integrated Webcam 
  type: USB driver: uvcvideo bus ID: 1-5:5 chip ID: 05c8:03bc 
  Display: x11 server: 1.20.8 compositor: gnome-shell 
  driver: modesetting,nvidia resolution: <xdpyinfo missing> 
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.1.5 
  direct render: Yes 
  Device-1: Intel Cannon Lake PCH cAVS vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel alternate: snd_soc_skl,snd_sof_pci 
  bus ID: 00:1f.3 chip ID: 8086:a348 
  Sound Server: ALSA v: k5.7.14-1-MANJARO 
  Device-1: Realtek RTL8822BE 802.11a/b/g/n/ac WiFi adapter 
  vendor: Hewlett-Packard driver: rtw_pci v: N/A modules: rtwpci port: 4000 
  bus ID: 02:00.0 chip ID: 10ec:b822 
  IF: wlo1 state: up mac: <filter> 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Hewlett-Packard driver: r8169 v: kernel port: 3000 bus ID: 05:00.0 
  chip ID: 10ec:8168 
  IF: eno1 state: down mac: <filter> 
  Local Storage: total: 1.60 TiB used: 653.15 GiB (39.9%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLW256HEHP-000H1 
  size: 238.47 GiB block size: physical: 512 B logical: 512 B 
  speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: CXB73H1Q scheme: GPT 
  ID-2: /dev/sda type: USB vendor: Western Digital 
  model: WD My Passport 0740 size: 465.73 GiB block size: physical: 512 B 
  logical: 512 B serial: <filter> rev: 1007 scheme: MBR 
  ID-3: /dev/sdb type: USB vendor: Toshiba model: External USB 3.0 
  size: 931.51 GiB block size: physical: 512 B logical: 512 B 
  serial: <filter> rev: 5438 scheme: MBR 
  ID-1: / raw size: 238.17 GiB size: 233.43 GiB (98.01%) 
  used: 98.08 GiB (42.0%) fs: ext4 dev: /dev/nvme0n1p2 
  Alert: No Swap data was found. 
  Message: No unmounted partitions found. 
  System Temperatures: cpu: 48.0 C mobo: 29.8 C 
  Fan Speeds (RPM): N/A 
  Processes: 290 Uptime: 42m Memory: 15.53 GiB used: 1.96 GiB (12.6%) 
  Init: systemd v: 246 Compilers: gcc: 10.1.0 alt: 8/9 Packages: 1316 
  pacman: 1307 lib: 361 flatpak: 0 snap: 9 Shell: Zsh v: 5.8 
  running in: gnome-terminal inxi: 3.1.05 

I know I am doing something wrong, just can't see what it is, so any help with that would be very appreciated.


prime-run %command%

For each game, assuming you have no other options.
(yes..we mean literally '%command%')

( Note - I kinda stopped reading part way through realizing this is your mistake .. but it seems you might have done a bunch of other things to try and make this work in your confusion. If any of those are hanging around you should probably undo them, like the example of what you added to /etc/environment )

1 Like

if you have hybri optimus drivers, and want to use nvidia for gaming.

Select a game from the Library page of the Steam client, right-click, and
select Properties.
for the command line.
Save your changes.
~ >>> prime-run %command%                                                   [1]
/usr/bin/prime-run: line 2: fg: no job control

And this is after I have reverted that /etc/environment, and changed the SET LAUNCH OPTIONS to __NV_PRIME_RENDER_OFFLOAD=1


This is NOT this difficult, I guess this is just "my moment" :laughing:

Of course the main confusion was the %command% because I thought I could specify the what to use (which is not uncommon).

Still no.
Copy/paste exactly this into your options:

prime-run %command%
1 Like

LOL :laughing:

and then I can launch it from terminal by using?? or does this enable the Nvidia card just by regular launching the game?

Because I thought I was supposed to run this command from terminal

just launch your game. thats it.

If you want to check via terminal (or instructive for other applications)

glxinfo | grep 'renderer string'
prime-run glxinfo | grep 'renderer string'

LOLS there is the biggest confusion, I had this in my head that the prime-run %command% was something I should use in terminal. Simple misunderstanding, hope it made someone smile :smiley:

Oh, I could see it, and it was funny. But nothing to be ashamed of. Cheers :slight_smile:

Adding to the list of useful commands


shows what processes are currently using your GPU, along with other stuff about the card

I knew about nvidia-smi and have used that, it was just the confusion about setting nvidia-prime %command% into game launchers instead of using terminal.
But thank you for the hint.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by