Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Intel graphics, iris, mesa, gallium3d, vaapi.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 679

PostPosted: Sat Mar 21, 2020 9:06 pm    Post subject: Intel graphics, iris, mesa, gallium3d, vaapi. Reply with quote

As some of you may be aware, Intel has been busy over the past year or so rewriting their driver stack to use mesa's gallium3d layers. Unfortunately, this support isn't well documented in Gentoo-land. As near as I can tell, this is how to get up and running with this driver stack in Gentoo:
  • Update to at least `media-libs/mesa-20`, `media-libs/gmmlib-19.4.1`, `x11-libs/libva-2.6.1`. Some of these are `~arch`.
  • In `/etc/portage/make.conf`, set `VIDEO_CARDS=""`.
  • Set USE="-classic gallium d3d9 vaapi"
  • In /etc/portage/package.use, set `media-libs/mesa video_cards_iris`,`x11-libs/libdrm video_cards_intel`, `x11-base/xorg-server -minimal`
  • If you want to build `xorg-server` with `USE=minimal`, set `x11-base/xorg-drivers video_cards_i965`. But ideally, you should be using the modesetting driver built into xorg-server. YMMV.
  • `emerge x11-libs/libva-intel-media-driver`. Currently, the version in portage is out of date. Copy the 18.4.1 ebuild to 19.4.0r in your local portage repo. It will work fine.
  • create `/etc/env.d/50vaapi`, and in it, put `LIBVA_DRIVER_NAME=iHD`
I am 99% sure nothing else will need `video_cards_intel` or `video_cards_i965`, but I'm not positive.

Kernel, opengl, vulkan configurations mostly follow what's documented on the wiki.

I do not know if/how to get opencl running under iris.


Last edited by pigeon768 on Sun Mar 22, 2020 6:56 pm; edited 2 times in total
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2836
Location: Canada

PostPosted: Sun Mar 22, 2020 3:47 am    Post subject: Re: Intel graphics, iris, mesa, gallium3d, vaapi. Reply with quote

pigeon768 wrote:
As some of you may be aware, Intel has been busy over the past year or so rewriting their driver stack to use mesa's gallium3d layers. Unfortunately, this support isn't well documented in Gentoo-land. As near as I can tell, this is how to get up and running with this driver stack in Gentoo:

  • In `/etc/portage/make.conf`, set `VIDEO_CARDS=""`.
  • Set USE="-classic gallium d3d9 vaapi"
  • In /etc/portage/package.use, set `media-libs/mesa video_cards_iris` and `x11-libs/libdrm video_cards_intel`
  • `emerge x11-libs/libva-intel-media-driver`. Currently, the version in portage is out of date. Copy the 18.4.1 ebuild to 19.4.0r in your local portage repo. It will work fine.
  • create `/etc/env.d/50vaapi`, and in it, put `LIBVA_DRIVER_NAME=iHD`
I am 99% sure nothing else will need `video_cards_intel` or `video_cards_i965`, but I'm not positive.

Kernel, opengl, vulkan configurations mostly follow what's documented on the wiki.

I do not know if/how to get opencl running under iris.


What intel chipsets will this work on ?
Back to top
View user's profile Send private message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 679

PostPosted: Sun Mar 22, 2020 4:25 am    Post subject: Reply with quote

Gen8 (Broadwell) or later. Basically, everything that has been released since 2014. The last new release of a GPU not supported by the Iris driver was in 2013.

Obviously i965+classic will need to be kept around indefinitely, but iris+classic should be the default.
Back to top
View user's profile Send private message
grumblebear
Apprentice
Apprentice


Joined: 26 Feb 2008
Posts: 183

PostPosted: Sun Mar 22, 2020 9:58 am    Post subject: Reply with quote

I have done basically the same.
Set VIDEO_CARDS="intel iris" because intel is needed for some other packages.
In package.use put
Code:
media-libs/mesa -classic -video_cards_intel

... and
Code:
x11-base/xorg-drivers video_cards_i965
to get rid of the no longer needed xf86-video-intel driver.
I have commented on this issue in this closed bug but got no attention so far.

For best results use Mesa 20. Since then upstream has selected iris as the new default driver for supported Intel hardware.
Back to top
View user's profile Send private message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 679

PostPosted: Sun Mar 22, 2020 6:52 pm    Post subject: Reply with quote

Good note on mesa-20. I updated my post.

Note that you don't need any `xf86-video-*` drivers for intel. The modesetting driver is the recommended option. xorg-server includes the modesetting driver unless you have USE=minimal set. I'll have to update my post again.

Which packages need VIDEO_CARDS=intel besides libdrm? We should sort all this out, then put it up on the wiki.
Back to top
View user's profile Send private message
grumblebear
Apprentice
Apprentice


Joined: 26 Feb 2008
Posts: 183

PostPosted: Sun Mar 22, 2020 7:55 pm    Post subject: Reply with quote

pigeon768 wrote:
Note that you don't need any `xf86-video-*` drivers for intel. The modesetting driver is the recommended option. xorg-server includes the modesetting driver unless you have USE=minimal set. I'll have to update my post again.

That's why you should install xorg-drivers with video_cards_i965. If you look at the mentioned bug report, you will see that this flag just prevents pulling of xf86-video-intel.

pigeon768 wrote:
Which packages need VIDEO_CARDS=intel besides libdrm? We should sort all this out, then put it up on the wiki.

You can get a list of all packages with
Code:
quse video_cards_intel
or
Code:
quse -I video_cards_intel
for just the installed packages.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2836
Location: Canada

PostPosted: Mon Mar 23, 2020 12:05 am    Post subject: Re: Intel graphics, iris, mesa, gallium3d, vaapi. Reply with quote

pigeon768 wrote:

[*] If you want to build `xorg-server` with `USE=minimal`, set `x11-base/xorg-drivers video_cards_i965`. But ideally, you should be using the modesetting driver built into xorg-server. YMMV.


video_cards_i965 is using modesetting driver
Back to top
View user's profile Send private message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 679

PostPosted: Mon Mar 23, 2020 2:02 am    Post subject: Reply with quote

Oof, you're right.

This configuration is not ideal. This is a problem, because every new computer of the past 7 years needs to pretzel themselves to have a correct configuration.

What should this look like? Maybe replace i915 with intel_g3, replace i965 with intel_g4, and iris with intel_g8? Are generation 2 and below supported?
Back to top
View user's profile Send private message
grumblebear
Apprentice
Apprentice


Joined: 26 Feb 2008
Posts: 183

PostPosted: Mon Mar 23, 2020 10:18 am    Post subject: Reply with quote

I think it would be best to just set VIDEO_CARDS="intel iris" for "newer" hardware as I have done and state that clearly in the wiki. That means leaving everything as it is with the second flag mainly for (and matching what is used in) mesa and the "intel" flag for everything else.

The meta package xorg-drivers should be changed to pull xf86-video-intel only for i915 as I have proposed in my last comment.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2836
Location: Canada

PostPosted: Tue Mar 24, 2020 7:00 pm    Post subject: Reply with quote

grumblebear wrote:
I think it would be best to just set VIDEO_CARDS="intel iris" for "newer" hardware as I have done and state that clearly in the wiki. That means leaving everything as it is with the second flag mainly for (and matching what is used in) mesa and the "intel" flag for everything else.

The meta package xorg-drivers should be changed to pull xf86-video-intel only for i915 as I have proposed in my last comment.


Well, maybe in future, currently 'iris' will not overwrite 'intel' ( as 'i965' does ) your combination will pull xf86-video-intel. And it is strange to pull intel driver for i915 but not for 'intel' itself.
Basically, you want to depreciate classical, non-modesetting driver for all but the old cards ? That is a bit drastic.
Back to top
View user's profile Send private message
setun-90
n00b
n00b


Joined: 29 Oct 2018
Posts: 2

PostPosted: Fri Jun 26, 2020 10:30 pm    Post subject: Reply with quote

Great work getting this started, pigeon768. I would never have known about the Iris driver without this post.

That said, I would like to give a heads-up: after switching to the Iris driver, I get a weird GPU page fault at the end of the day that freezes sway and forces me to pkill it and restart it. Given that it happens once at the end of the day, I don't know whether this is even a bug and not some misconfig on my part; I have dmesg logs nevertheless. I have HD Graphics 620 on an i7-8565U.

Keep up the good work nevertheless.
Back to top
View user's profile Send private message
mu0n
n00b
n00b


Joined: 20 Aug 2015
Posts: 19

PostPosted: Sat Aug 15, 2020 10:32 pm    Post subject: Getting Intel UHD Graphics to Work Reply with quote

Thanks for this discussion! :-)

I've an Intel Corporation UHD Graphics 620 (rev 07) on a DELL XPS 13 9370 (i.e., architecture Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz) running kernel v5.8.0 and this is what I did to get the UHD graphics to work on it with OpenGL, Vulkan, and OpenCL.

In /etc/portage/make.conf ensure:

  • It is okay for any/all of these USE flags to be set globally:
    Code:
    wayland gles2 vaapi opengl vulkan

  • It is NOT okay for the opencl USE flag to be set globally. Why? media-libs/mesa fails to build with opencl set as it insists on libclc which requires AMD or NVIDIA, and, globally the opencl USE flag also pulls in libclc which requires an AMD or NVIDIA GPU.
  • Set VIDEO_CARDS to be
    Code:
    ""
    or the more accurate,
    Code:
    "iris"
    . Subsequent settings below will ensure all is okay, i.e., omitting intel and i965.

Note that I have these packages in my world file. Some of these might be otherwise pulled in (I've not sorted such out yet):

  • dev-libs/intel-neo
  • x11-libs/libva-intel-media-driver
  • x11-apps/igt-gpu-tools
  • dev-util/vulkan-tools
  • media-libs/vulkan-loader

I summarized the earlier posts in this thread to be a single file with settings in /etc/portage/package.use/intel:
Code:
x11-libs/libva X drm opengl utils vdpau

# Per https://forums.gentoo.org/viewtopic-t-1110144-start-0.html
media-libs/mesa video_cards_iris -video_cards_intel -video_cards_i965 -classic gallium d3d9
x11-libs/libdrm video_cards_intel
x11-base/xorg-server -minimal

# Ensure xf86-video-intel does not get pulled in...
#x11-base/xorg-drivers video_cards_i965 -video_cards_intel
x11-base/xorg-drivers -video_cards_intel

# NOTE: quse -I video_cards_intel | awk -F: '{ print $1 }' | uniq
sys-power/pm-utils video_cards_intel
x11-apps/igt-gpu-tools video_cards_intel overlay
x11-libs/libdrm video_cards_intel

# NOTE: quse -I video_cards_i965 | awk -F: '{ print $1 }' | uniq

# USE opencl-related...
dev-libs/intel-neo l0
dev-util/spirv-llvm-translator tools
# RUN: quse -I opencl | awk -F: '{ P="" ; if ($1 ~ /mesa/) P="-"; print $1" "P"opencl"; }' | uniq
media-gfx/blender opencl cycles
media-gfx/imagemagick opencl
media-libs/mesa -opencl
media-libs/opencv opencl
media-libs/x264 opencl
media-video/ffmpeg opencl

#
# NOTE:
#   mesa v20.1.5 with opencl requires:
#     dev-libs/libclc-0.2.0_pre20191024
#   which results in mesa outputting:
#     >>> Running pre-merge checks for media-libs/mesa-20.1.5
#      * Ignoring USE=opencl     since VIDEO_CARDS does not contain r600 or radeonsi
#      * Ignoring USE=vaapi      since VIDEO_CARDS does not contain r600, radeonsi, or nouveau
#   AND it fails to build, thus, -opencl is required.
#

# USE vulkan-related...
media-libs/vulkan-loader layers
dev-util/vulkan-tools cube -wayland

Do adjust your settings for the entries immediately following the NOTE and RUN commands as required for your system.

Ensure that iHD graphics is selected with for libva:
Code:
echo "LIBVA_DRIVER_NAME=iHD" >/etc/env.d/50vaapi
env-update

and set /etc/X11/xorg.conf.d/20-intel.conf to use the modesetting driver:
Code:
Section "Device"
    Identifier  "modesetting"
    Driver      "modesetting"
EndSection

Update the required packages:
Code:
emerge -uDNav @world

Ensure that these packages are also installed, if not, emerge them directly:

  • dev-libs/intel-neo
  • x11-libs/libva-intel-media-driver
  • x11-apps/igt-gpu-tools
  • dev-util/vulkan-tools
  • media-libs/vulkan-loader

Optional: "clean house" and re-emerge world to ensure all is good.
Code:
emerge -av --depclean
emerge -uDNav @world

e.g., x11-drivers/xf86-video-intel will be removed (if not remove it: it is no longer needed)

Reboot and then test things, e.g. run:

  • vkcube
  • vkcubepp
  • vulkaninfo
  • emerge -av x11-apps/mesa-progs # if needed
  • glxgears


Hopefully this works for others and helps bring more sanity to Intel UHD users! :-)
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1888

PostPosted: Tue Sep 15, 2020 7:43 pm    Post subject: Reply with quote

@muon: Nice sum up :D
I"m almost there, except for
Code:
dev-util/intel-graphics-compiler-1.0.4111
which fails at link step:
Code:
FAILED: IGC/Gentoo/libigc.so.1.0.1

Additionally log file shows:
Code:
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at IGC/CMakeLists.txt:41 (cmake_policy):
  The OLD behavior for policy CMP0043 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at IGC/CMakeLists.txt:43 (cmake_policy):
  The OLD behavior for policy CMP0054 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Warning at IGC/CMakeLists.txt:1910 (message):
  CMAKE_BUILD_TYPE: Unknown build configuration.  The following
  configurations are available: Debug;Release.

  The "Release" configuration will be used.

  This value has meaning only for single-configuration generators (like
  Make).  It will be ignored for MSVC/XCode.


CMake Warning at IGC/CMakeLists.txt:1970 (message):
  IGC_OPTION__ARCHITECTURE_TARGET: Target architecture is not specified.
  Trying to deduce it from context.


-- ================================ IGC Project ================================
-- Build type:  Gentoo (single-configuration generator)
-- Build tools: OFF
-- LLVM dir:   
--
-- Output directory:
--    "/var/tmp/portage/dev-util/intel-graphics-compiler-1.0.4111/work/intel-graphics-compiler-1.0.4111_build-abi_x86_64.amd64/IGC/Gentoo"
-- Install root directory:
--    "/usr"
-- Architecture:
--  - target: Linux64    (detected: Linux64)
--  - host:   Linux64    (detected: Linux64)
--
-- Cross-compilation needed: NO
-- Cross-compilation set:    FALSE
--
-- Advanced:
--  - Link BiF resources:              ON
--  - Building Windows Universal:     
-- =============================================================================
-- [IGC] LLVM targets are not defined. Searching for LLVM.
-- [IGC] Using system LLVM 10.0.1
-- [IGC] Link against found LLVM dylib /usr/lib/llvm/10/lib64/libLLVM-10.so
Use InstCombiner from LLVM
-- [IGC\BiFModule] : opencl-clang will be taken from system
-- [IGC\BiFModule] Found clang-10 executable: /usr/lib/llvm/10/bin/clang-10
-- Configuring Intel Gen Assembler (IGA) Component
--  - GED_BRANCH:           GED_external
--  - CMAKE_CXX_COMPILER:   /usr/bin/x86_64-pc-linux-gnu-g++
fatal: not a git repository (or any parent up to mount point /var/tmp)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /var/tmp)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
GIT_DIRTY = 128
--  - IGA_VERSION_SUFFIX:   
-- Found BISON: /usr/bin/bison (found version "3.7.1")
-- Found FLEX: /usr/bin/flex (found version "2.6.4")
[check-igc] LIT tests disabled. Missing igc_opt target.
CMake Warning (dev) at CMakeLists.txt:11 (set):
  Cannot set "IGC__IGC_TARGETS": current scope has no parent.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:12 (set):
  Cannot set "IGC_LIBRARY_NAME": current scope has no parent.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:13 (set):
  Cannot set "FCL_LIBRARY_NAME": current scope has no parent.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- <<< Gentoo configuration >>>
Build type      Gentoo
Install path    /usr
Compiler flags:
C               -march=native -mtune=native   -O2             -pipe
C++             -march=native -mtune=native   -O2             -pipe
Linker flags:
Executable      -Wl,-O1 -Wl,--as-needed
Module          -Wl,-O1 -Wl,--as-needed
Shared          -Wl,-O1 -Wl,--as-needed

-- Configuring done
Which clang did you used? (clang:10 here).
Did tou succeeded building at first shot?
[Edit] Vanilla ld seems used here... Maybe lld is required? ld-gold?
Maybe you have a idea what's missing here?

Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
mu0n
n00b
n00b


Joined: 20 Aug 2015
Posts: 19

PostPosted: Tue Sep 15, 2020 8:38 pm    Post subject: Reply with quote

I am running ~amd64 (i.e., testing) --but my gcc-config -l shows I have GCC 9.3.0 as the default (not GCC 10.2.0-r1 as such is not amd64 "stable" yet).

I used Clang 10.0.1 (i.e., latest in slot 10).
Everything worked the first time.
Vanilla ld (/usr/x86_64-pc-linux-gnu/binutils-bin/2.34/ld).

I had zero issues building such. If using the gold linker, try switching to vanilla.
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1888

PostPosted: Tue Sep 15, 2020 11:38 pm    Post subject: Reply with quote

Thks 4 replying,
I've just succeeded, HD tmpfs & ld-gold here...
I think I didn't have enough RAM.
Currently building intel-neo.
Will rebuild forthcoming version with vanilla ld.
My apolologizes, I should have fixed that prior to posting.
I first came back to that post to remove my post :lol:

I take this opportunity for a few questions:
- intel-neo: l0 USE flag, any practical interest?
- intel-neo: vaapi USE flag activated, any technical issue?
- x11-drivers/xf86-video-intel here, any technical issue?

Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
mu0n
n00b
n00b


Joined: 20 Aug 2015
Posts: 19

PostPosted: Wed Sep 16, 2020 1:37 am    Post subject: Reply with quote

For intel-neo both USE="l0 vaapi" are set.

I've not played with any settings --my goal was to take the discussion, get it to work, and then summarize such on this forum.

Things appear to work very well for me. I am using the laptop + two DisplayPort monitors with the Intel card from the DELL XPS 13 and performance is excellent. Programs like Blender compile with the OpenCL flag (set on the package itself) and it appears to run properly as well. :-)

If you've specific USE flags and tests in mind, please detail / discuss such incl. what should be expected as a test result.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum