Compile issue with DRM headers
Hi Jianxin,
I met a compile error with recent version of rdma-core on my server with Ubuntu 14.04:
./pyverbs/dmabuf_alloc.c:16:24: fatal error: amdgpu_drm.h: No such file or directory
#include <amdgpu_drm.h>
^compilation terminated.
I found it is related with dma-buf based commits. And the commit 3788aa843b4b ("configure: Add check for DRM headers") adds a check for libdrm headers. I have installed it but my version(2.4.67-1ubuntu0.14.04.2) isn't new enough, there is no 'amdgpu_drm.h' in DRM_INCLUDE_DIRS(/usr/include/drm).
So I think we may need some check for the the version of libdrm in CMakeList.txt or something else :) Could you please give me some suggestions?
Thanks
Weihang
Quoted 21 lines
-----Original Message-----
From: liweihang <[email protected]>
Sent: Friday, March 19, 2021 1:44 AM
To: Xiong, Jianxin <[email protected]>; [email protected]
Cc: Jason Gunthorpe <[email protected]>; Leon Romanovsky <[email protected]>; Linuxarm <[email protected]>
Subject: [rdma-core] Compile issue with DRM headersHi Jianxin,
I met a compile error with recent version of rdma-core on my server with Ubuntu 14.04:
../pyverbs/dmabuf_alloc.c:16:24: fatal error:amdgpu_drm.h: No such file or directory #include <amdgpu_drm.h>^compilation terminated.
I found it is related with dma-buf based commits. And the commit
3788aa843b4b
("configure: Add check for DRM headers") adds a check for libdrm headers. I have installed it but my version(2.4.67-1ubuntu0.14.04.2) isn't new enough, there is no 'amdgpu_drm.h' inDRM_INCLUDE_DIRS(/usr/include/drm).
Quoted 5 lines
So I think we may need some check for the the version of libdrm in CMakeList.txt or something else :) Could you please give me some suggestions?
Thanks
Weihang
Hi Weihang,
The simplest way is to replace the check of "drm.h" with "amdgpu_drm.h". This is reasonable since dma-buf based MR won't work with old kernel anyway.
Alternatively, we can add a check for "amdgpu_drm.h" in CMakeLists.txt and add some #ifdef's to dmabuf_alloc.c around the code related to amdgpu.
-Jianxin
Quoted 27 lines · Jianxin
Quoted 21 lines
-----Original Message-----
From: liweihang <[email protected]>
Sent: Friday, March 19, 2021 1:44 AM
To: Xiong, Jianxin <[email protected]>; [email protected]
Cc: Jason Gunthorpe <[email protected]>; Leon Romanovsky <[email protected]>; Linuxarm <[email protected]>
Subject: [rdma-core] Compile issue with DRM headersHi Jianxin,
I met a compile error with recent version of rdma-core on my server with Ubuntu 14.04:
../pyverbs/dmabuf_alloc.c:16:24: fatal error:amdgpu_drm.h: No such file or directory #include <amdgpu_drm.h>^compilation terminated.
I found it is related with dma-buf based commits. And the commit
3788aa843b4b
("configure: Add check for DRM headers") adds a check for libdrm headers. I have installed it but my version(2.4.67-1ubuntu0.14.04.2) isn't new enough, there is no 'amdgpu_drm.h' inDRM_INCLUDE_DIRS(/usr/include/drm).Quoted 5 lines
So I think we may need some check for the the version of libdrm in CMakeList.txt or something else :) Could you please give me some suggestions?
Thanks
Weihang
Quoted 7 lines
Hi Weihang,
The simplest way is to replace the check of "
drm.h" with "amdgpu_drm.h". This is reasonable since dma-buf based MR won't work with old kernel anyway.Alternatively, we can add a check for "
amdgpu_drm.h" in CMakeLists.txt and add some #ifdef's todmabuf_alloc.caround the code related to amdgpu.
Let's add compilation test that checks all those files at the same time:
14 #include <drm.h>
15 #include <i915_drm.h>
16 #include <amdgpu_drm.h>
17 #include <radeon_drm.h>
Thanks
Quoted 3 lines
-Jianxin
Quoted 32 lines · Leon Romanovsky
Quoted 31 lines · Jianxin
Quoted 20 lines
From: liweihang <[email protected]>
Sent: Friday, March 19, 2021 1:44 AM
To: Xiong, Jianxin <[email protected]>; [email protected]
Cc: Jason Gunthorpe <[email protected]>; Leon Romanovsky <[email protected]>; Linuxarm <[email protected]>
Subject: [rdma-core] Compile issue with DRM headersHi Jianxin,
I met a compile error with recent version of rdma-core on my server with Ubuntu 14.04:
../pyverbs/dmabuf_alloc.c:16:24: fatal error:amdgpu_drm.h: No such file or directory #include <amdgpu_drm.h>^compilation terminated.
I found it is related with dma-buf based commits. And the commit
3788aa843b4b
("configure: Add check for DRM headers") adds a check for libdrm headers. I have installed it but my version(2.4.67-1ubuntu0.14.04.2) isn't new enough, there is no 'amdgpu_drm.h' inDRM_INCLUDE_DIRS(/usr/include/drm).Quoted 5 lines
So I think we may need some check for the the version of libdrm in CMakeList.txt or something else :) Could you please give me some suggestions?
Thanks
WeihangHi Weihang,
The simplest way is to replace the check of "
drm.h" with "amdgpu_drm.h". This is reasonable since dma-buf based MR won't work with old kernel anyway.
Quoted 8 lines
Quoted 2 lines
Alternatively, we can add a check for "
amdgpu_drm.h" in CMakeLists.txt and add some #ifdef's todmabuf_alloc.caround the code related to amdgpu.Let's add compilation test that checks all those files at the same time:
14 #include <drm.h> 15 #include <i915_drm.h> 16 #include <amdgpu_drm.h> 17 #include <radeon_drm.h>
Yes please
Jason
Quoted 10 lines
-----Original Message-----
From: Jason Gunthorpe <[email protected]>
Sent: Sunday, March 21, 2021 8:53 AM
To: Leon Romanovsky <[email protected]>
Cc: Xiong, Jianxin <[email protected]>; liweihang <[email protected]>; [email protected]; Linuxarm <[email protected]>
Subject: Re: [rdma-core] Compile issue with DRM headersQuoted 1 line · Leon Romanovsky
On Fri, Mar 19, 2021 at 04:50:53PM +0000, Xiong, Jianxin wrote:
....
Quoted 10 lines
Quoted 6 lines
Let's add compilation test that checks all those files at the same time:
14 #include <drm.h> 15 #include <i915_drm.h> 16 #include <amdgpu_drm.h> 17 #include <radeon_drm.h>Yes please
Jason
I will work on this.
Thanks,
Jianxin
Quoted 21 lines · Jianxin
Quoted 10 lines
-----Original Message-----
From: Jason Gunthorpe <[email protected]>
Sent: Sunday, March 21, 2021 8:53 AM
To: Leon Romanovsky <[email protected]>
Cc: Xiong, Jianxin <[email protected]>; liweihang <[email protected]>; [email protected]; Linuxarm <[email protected]>
Subject: Re: [rdma-core] Compile issue with DRM headersQuoted 1 line · Leon Romanovsky
On Fri, Mar 19, 2021 at 04:50:53PM +0000, Xiong, Jianxin wrote:
....
Quoted 9 lines
Quoted 6 lines
Let's add compilation test that checks all those files at the same time:
14 #include <drm.h> 15 #include <i915_drm.h> 16 #include <amdgpu_drm.h> 17 #include <radeon_drm.h>Yes please
Quoted 8 lines
Quoted 1 line
Jason
I will work on this.
Thanks,
Jianxin
Thank you. I will help test on my server after your work is done :)
Weihang