Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

vulkan doesn't seem to be working...

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
KShots
l33t
l33t
User avatar
Posts: 615
Joined: Thu Oct 09, 2003 1:29 pm
Location: Florida
Contact:
Contact KShots
Website

vulkan doesn't seem to be working...

  • Quote

Post by KShots » Fri Apr 01, 2022 5:42 pm

Got a new laptop, fired it up with gentoo, got steam installed... and BAM, no games using wine worked with it. Found a workaround by disabling Vulkan via an environment variable, all the steam stuff works...

Tried to do some unreal engine dev work, BAM - it crashes on startup. Another vulkan issue...

emerged vulkan-tools and tried the 'vkcube' app:

Code: Select all

rich@incubus:~ $ vkcube
Selected GPU 0: NVIDIA GeForce RTX 3080 Laptop GPU, type: 2
Could not find both graphics and present queues
... ok, for one it's not using the correct GPU. Looked at its help:

Code: Select all

rich@incubus:~ $ vkcube --help
Usage:
  vkcube	[--use_staging] [--validate] [--validate-checks-disabled]
	[--break] [--c <framecount>] [--suppress_popups]
	[--incremental_present] [--display_timing]
	[--gpu_number <index of physical device>]
	[--present_mode <present mode enum>]
	[--width <width>] [--height <height>]
	<present_mode_enum>
		VK_PRESENT_MODE_IMMEDIATE_KHR = 0
		VK_PRESENT_MODE_MAILBOX_KHR = 1
		VK_PRESENT_MODE_FIFO_KHR = 2
		VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3
... looks like I can switch GPU index with --gpu_number:

Code: Select all

rich@incubus:~ $ vkcube --gpu_number 1
Selected GPU 1: NVIDIA GeForce RTX 2080 Ti, type: 2
Works fine now... so apparently my default vulkan GPU is not correctly set. How do I set this system-wide so other bits like steam and the unreal engine can pick up on it?
Life without passion is death in disguise
Top
KShots
l33t
l33t
User avatar
Posts: 615
Joined: Thu Oct 09, 2003 1:29 pm
Location: Florida
Contact:
Contact KShots
Website

  • Quote

Post by KShots » Fri Apr 01, 2022 6:16 pm

After a bit of digging... it seems vulkan doesn't support selecting a GPU system-wide. Luckily, I'm not the only one bit by this short-sightedness. Found a github project that writes a "device chooser layer" into the vulkan API that lets you set an environment variable to do this. It's as easy as:

Code: Select all

ENABLE_DEVICE_CHOOSER_LAYER=1 VULKAN_DEVICE_INDEX=1 MyApp
... with this, I got the unreal engine working as well. Now I just need to set those environment variables system-wide and I should be good to go!

EDIT: Hmm... not sure where to put these environment variables so they work system-wide... ${HOME}/.bashrc doesn't do it for gnome. Any suggestions on where to put it?
Life without passion is death in disguise
Top
ali3nx
l33t
l33t
User avatar
Posts: 732
Joined: Sun Sep 21, 2003 4:28 am
Location: Winnipeg, Canada
Contact:
Contact ali3nx
Website

  • Quote

Post by ali3nx » Fri Apr 01, 2022 7:31 pm

There's an undocumented gentoo system configuration "trick" that at least I've been using and recommending others use for several years to ensure support for vulkan with nvidia drivers.

The VIDEO_CARDS config variable if used too literally enforces video processing api restrictions that omit video processing api support at compile time unless certain video card models are included such as

Code: Select all

VIDEO_CARDS="nvidia intel i915 i965"


instead of purely

Code: Select all

VIDEO_CARDS="nvidia"


will permit mesa to be built with vulkan use flag support globally.

Generally the implied gentoo config methodology would be to set the video cards variable literally as specific as possible however due to how the mesa ebuild has been configured for many years that implied methodology in practice has functionality limitations.

Utilizing the vulkan with an "unsupported" gpu userland configuration also fixes lutris moaning about missing vulkan libraries.

If you find yourself looking at this thinking "Hey i don't have an intel gpu.... what gives?"

Whether your pc actually has the graphics hardware configured by the VIDEO_CARDS config variable is mostly irrelevant if the added software feature will provide a benefit.

The mesa and xorg package ebuilds implying conditional restrictions was not a thing until perhaps 2019. Until then anyone was able to include whichever gpu video api's they desired to without being limited by userland gpu configurations.
Compiling Gentoo since version 1.4
Thousands of Gentoo Installs Completed
Emerged on every continent but Antarctica
Compile long and Prosper!
Top
KShots
l33t
l33t
User avatar
Posts: 615
Joined: Thu Oct 09, 2003 1:29 pm
Location: Florida
Contact:
Contact KShots
Website

  • Quote

Post by KShots » Sat Apr 02, 2022 1:08 am

Don't think that's what's going on here - I have a similar VIDEO_CARDS line:

Code: Select all

rich@incubus:~ $ grep VIDEO_CARDS /etc/portage/make.conf
VIDEO_CARDS="intel i965 nvidia nouveau"
Again, vulkan appears to work just fine when the correct card is selected, but vulkan doesn't seem smart enough to auto-select a card that is capable of presenting, and can't normally be told specifically which card to use (at least not without the above hack). I've found I have to start steam itself with the above environment variables - setting them in the launcher properties does not work.
Life without passion is death in disguise
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3530
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Apr 02, 2022 5:13 pm

KShots wrote:Don't think that's what's going on here - I have a similar VIDEO_CARDS line:

Code: Select all

rich@incubus:~ $ grep VIDEO_CARDS /etc/portage/make.conf
VIDEO_CARDS="intel i965 nvidia nouveau"
Again, vulkan appears to work just fine when the correct card is selected, but vulkan doesn't seem smart enough to auto-select a card that is capable of presenting, and can't normally be told specifically which card to use (at least not without the above hack). I've found I have to start steam itself with the above environment variables - setting them in the launcher properties does not work.
I presume your new laptop is a recent one. As such, nouveau can do nothing for newer nvidia cards, so you don't need it. I don't know, but this might contribute to your issue.

Regards,
Georgi
Top
KShots
l33t
l33t
User avatar
Posts: 615
Joined: Thu Oct 09, 2003 1:29 pm
Location: Florida
Contact:
Contact KShots
Website

  • Quote

Post by KShots » Sat Apr 02, 2022 8:28 pm

Not likely an issue - I have it blacklisted via kernel command line (modprobe.blacklist=nouveau), just compiled support in case I want to mess with it later.
Life without passion is death in disguise
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3530
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Apr 02, 2022 8:32 pm

KShots wrote:Not likely an issue - I have it blacklisted via kernel command line (modprobe.blacklist=nouveau), just compiled support in case I want to mess with it later.
It can currently only power up the GPU, nothing else, your Intel card will perform better as it will use hardware acceleration. My point is if the vulkan driver has no choice it would be forced to choose the right driver, wouldn't it?
Top
KShots
l33t
l33t
User avatar
Posts: 615
Joined: Thu Oct 09, 2003 1:29 pm
Location: Florida
Contact:
Contact KShots
Website

  • Quote

Post by KShots » Sat Apr 02, 2022 8:35 pm

It correctly chooses the nvidia driver, but there are two cards that use that driver - and it selects the wrong one.
Life without passion is death in disguise
Top
jmbreuer
n00b
n00b
Posts: 26
Joined: Wed Sep 07, 2011 9:22 am
Contact:
Contact jmbreuer
Website

  • Quote

Post by jmbreuer » Sat Apr 20, 2024 11:23 am

KShots wrote: EDIT: Hmm... not sure where to put these environment variables so they work system-wide... ${HOME}/.bashrc doesn't do it for gnome. Any suggestions on where to put it?
I guess/hope you'll have found it by now. Such things can go into /etc/env.d/99chooseGraphics (or whatever filename you like, they'll be applied in lexicographic order). After creating that file and putting e.g.

Code: Select all

ENABLE_DEVICE_CHOOSER_LAYER=1
VULKAN_DEVICE_INDEX=1
into it, run env-update and re-login.

(Anyone know a better way to get any of the graphical environments to re-read their profile? The equivalent of "source /etc/profile" in a textual shell?)
Top
Post Reply

9 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic