Bug 5745 - [Anolis23][x86_64][epao]cuda-samples 的FilterBorderControlNPP用例缺少FreeImage.h头文件导致用例运行失败
Summary: [Anolis23][x86_64][epao]cuda-samples 的FilterBorderControlNPP用例缺少FreeImage.h头文...
Status: NEW
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: BaseOS Packages (show other bugs) BaseOS Packages
Version: 23.0
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: xuchunmei
QA Contact: bolong_tbl
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-06 10:51 UTC by yunmeng365524
Modified: 2023-07-07 11:10 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yunmeng365524 2023-07-06 10:51:57 UTC
Description of problem:
cuda-samples 的FilterBorderControlNPP用例缺少FreeImage.h头文件导致用例运行失败

Version-Release number of selected component (if applicable):
[root@iZbp1eypdp3hunewckvjqvZ FilterBorderControlNPP]# cat /etc/os-release
NAME="Anolis OS"
VERSION="23"
ID="anolis"
VERSION_ID="23"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"

[root@iZbp1eypdp3hunewckvjqvZ FilterBorderControlNPP]# yum repoinfo
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 2:26:24 ago on Thu Jul  6 08:19:23 2023.
Repo-id            : AppStream-AI
Repo-name          : AnolisOS- - AppStream-AI
Repo-revision      : 1688384045
Repo-updated       : Mon Jul  3 19:34:05 2023
Repo-pkgs          : 669
Repo-available-pkgs: 669
Repo-size          : 10 G
Repo-baseurl       : https://mirrors.openanolis.cn/epao/23/x86_64/
Repo-expire        : 172800 second(s) (last: Thu Jul  6 08:19:23 2023)
Repo-filename      : /etc/yum.repos.d/ai.repo

Repo-id            : AppStream-AI-Source
Repo-name          : AnolisOS- - AppStream-AI-Source
Repo-revision      : 1688384055
Repo-updated       : Mon Jul  3 19:34:15 2023
Repo-pkgs          : 114
Repo-available-pkgs: 114
Repo-size          : 19 G
Repo-baseurl       : https://mirrors.openanolis.cn/epao/23/source/
Repo-expire        : 172800 second(s) (last: Thu Jul  6 08:19:23 2023)
Repo-filename      : /etc/yum.repos.d/ai.repo

Repo-id            : AppStream-Test
Repo-name          : AnolisOS-23 - AppStream-Test
Repo-revision      : 1688057505
Repo-updated       : Fri Jun 30 00:51:44 2023
Repo-pkgs          : 12604
Repo-available-pkgs: 12604
Repo-size          : 13 G
Repo-baseurl       : http://mirrors.openanolis.cn/anolis/23/Nightly/AppStream/x86_64/os
Repo-expire        : 172800 second(s) (last: Thu Jul  6 08:19:23 2023)
Repo-filename      : /etc/yum.repos.d/AnolisOS-Test.repo

Repo-id            : AppStream-debuginfo
Repo-name          : AnolisOS-23 - AppStream Debuginfo
Repo-revision      : 1684909010
Repo-updated       : Wed May 24 14:16:50 2023
Repo-pkgs          : 1866
Repo-available-pkgs: 1866
Repo-size          : 9.4 G
Repo-baseurl       : http://mirrors.cloud.aliyuncs.com/anolis/23/AppStream/x86_64/debug
Repo-expire        : 172800 second(s) (last: Thu Jul  6 08:19:22 2023)
Repo-filename      : /etc/yum.repos.d/AnolisOS-Debuginfo.repo

Repo-id            : BaseOS-Test
Repo-name          : AnolisOS-23 - BaseOS-Test
Repo-revision      : 1688057352
Repo-updated       : Fri Jun 30 00:49:11 2023
Repo-pkgs          : 946
Repo-available-pkgs: 946
Repo-size          : 1.0 G
Repo-baseurl       : http://mirrors.openanolis.cn/anolis/23/Nightly/BaseOS/x86_64/os
Repo-expire        : 172800 second(s) (last: Thu Jul  6 08:19:23 2023)
Repo-filename      : /etc/yum.repos.d/AnolisOS-Test.repo

Repo-id            : BaseOS-debuginfo
Repo-name          : AnolisOS-23 - BaseOS Debuginfo
Repo-revision      : 1685324515
Repo-updated       : Mon May 29 09:41:55 2023
Repo-pkgs          : 2615
Repo-available-pkgs: 2615
Repo-size          : 12 G
Repo-baseurl       : http://mirrors.cloud.aliyuncs.com/anolis/23/BaseOS/x86_64/debug
Repo-expire        : 172800 second(s) (last: Thu Jul  6 08:19:23 2023)
Repo-filename      : /etc/yum.repos.d/AnolisOS-Debuginfo.repo

How reproducible:
1、 git clone https://github.com/NVIDIA/cuda-samples.git
2、 进入case目录,如
/tmp/tone/run/cuda-samples/Samples/4_CUDA_Libraries/FilterBorderControlNPP
3、 make
[root@iZbp1eypdp3hunewckvjqvZ FilterBorderControlNPP]# make
test.c:1:10: fatal error: FreeImage.h: No such file or directory
    1 | #include "FreeImage.h"
      |          ^~~~~~~~~~~~~
compilation terminated.
>>> WARNING - FreeImage is not set up correctly. Please ensure FreeImage is set up correctly. <<<

Steps to Reproduce:
如上

Actual results:
编译成功

Expected results:
缺少FreeImage.h 头文件

Additional info:
FreeImage is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications. 

请确认是否需要引入FreeImage
Comment 1 yunmeng365524 2023-07-07 11:10:04 UTC
ubuntu 有对应的包,安装后case可以测试
root@iZbp14gj0szjqpkn0bb9m2Z:~/cuda-samples/Samples/4_CUDA_Libraries/FilterBorderControlNPP# apt-get install libfreeimage-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libfreeimage3 libilmbase25 libjxr0 liblcms2-2 libopenexr25 libopenjp2-7 libraw20 libwebpmux3
Suggested packages:
  liblcms2-utils
The following NEW packages will be installed:
  libfreeimage-dev libfreeimage3 libilmbase25 libjxr0 liblcms2-2 libopenexr25 libopenjp2-7 libraw20 libwebpmux3
0 upgraded, 9 newly installed, 0 to remove and 3 not upgraded.
Need to get 2,472 kB of archives.
After this operation, 10.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

。。。。。。
root@iZbp14gj0szjqpkn0bb9m2Z:~/cuda-samples/Samples/4_CUDA_Libraries/FilterBorderControlNPP# make
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../../Common -I../../../Common/UtilNPP -m64 --threads 0 --std=c++11 -gencode arch=compute_50,code=compute_50 -o FilterBorderControlNPP.o -c FilterBorderControlNPP.cpp
/usr/local/cuda/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_50,code=compute_50 -o FilterBorderControlNPP FilterBorderControlNPP.o -lnppisu_static -lnppif_static -lnppitc_static -lnppidei_static -lnppial_static -lnppc_static -lculibos -lfreeimage
mkdir -p ../../../bin/x86_64/linux/release
cp FilterBorderControlNPP ../../../bin/x86_64/linux/release
root@iZbp14gj0szjqpkn0bb9m2Z:~/cuda-samples/Samples/4_CUDA_Libraries/FilterBorderControlNPP# ll
total 10560
drwxr-xr-x  4 root root     4096 Jul  7 11:07 ./
drwxr-xr-x 41 root root     4096 Jul  6 21:09 ../
drwxr-xr-x  2 root root     4096 Jul  6 21:08 data/
-rwxr-xr-x  1 root root 10548448 Jul  7 11:07 FilterBorderControlNPP*
-rw-r--r--  1 root root    22067 Jul  6 21:08 FilterBorderControlNPP.cpp
-rw-r--r--  1 root root   158960 Jul  7 11:07 FilterBorderControlNPP.o
-rw-r--r--  1 root root      873 Jul  6 21:08 FilterBorderControlNPP_vs2017.sln
-rw-r--r--  1 root root     5592 Jul  6 21:08 FilterBorderControlNPP_vs2017.vcxproj
-rw-r--r--  1 root root      873 Jul  6 21:08 FilterBorderControlNPP_vs2019.sln
-rw-r--r--  1 root root     5177 Jul  6 21:08 FilterBorderControlNPP_vs2019.vcxproj
-rw-r--r--  1 root root      873 Jul  6 21:08 FilterBorderControlNPP_vs2022.sln
-rw-r--r--  1 root root     5177 Jul  6 21:08 FilterBorderControlNPP_vs2022.vcxproj
-rw-r--r--  1 root root    13617 Jul  6 21:08 Makefile
-rw-r--r--  1 root root     3223 Jul  6 21:08 NsightEclipse.xml
-rw-r--r--  1 root root     4041 Jul  6 21:08 README.md
drwxr-xr-x  2 root root     4096 Jul  6 21:08 .vscode/
root@iZbp14gj0szjqpkn0bb9m2Z:~/cuda-samples/Samples/4_CUDA_Libraries/FilterBorderControlNPP# ./FilterBorderControlNPP
./FilterBorderControlNPP Starting...

GPU Device 0: "Pascal" with compute capability 6.0

cudaSetDevice GPU0 = Tesla P100-PCIE-16GB
NPP Library Version 12.1.1
  CUDA Driver  Version: 12.2
  CUDA Runtime Version: 12.2
  Device 0: <          Pascal >, Compute SM 6.0 detected
gradientFilterBorderNPP opened <./data/teapot512.pgm> successfully!
Saved image: ././data/teapot512.pgm_gradientVectorPrewittBorderX_Vertical.pgm
Saved image: ./data/teapot512_gradientVectorPrewittBorderY_Horizontal.pgm
Saved image: ./data/teapot512_gradientVectorPrewittBorderX_Vertical_WithNoSourceBorders.pgm
Saved image: ./data/teapot512_gradientVectorPrewittBorderY_Horizontal_WithNoSourceBorders.pgm
Saved image: ./data/teapot512_gradientVectorPrewittBorderX_Vertical_BorderDiffs.pgm
Saved image: ./data/teapot512_gradientVectorPrewittBorderY_Horizontal_BorderDiffs.pgm
Saved image: ./data/teapot512_gradientVectorPrewittBorderX_Vertical_WithMixedBorders.pgm
Saved image: ./data/teapot512_gradientVectorPrewittBorderY_Horizontal_WithMixedBorders.pgm
Saved image: ./data/teapot512_gradientVectorPrewittBorderX_Vertical_MixedBorderDiffs.pgm
Saved image: ./data/teapot512_gradientVectorPrewittBorderY_Horizontal_MixedBorderDiffs.pgm
root@iZbp14gj0szjqpkn0bb9m2Z:~/cuda-samples/Samples/4_CUDA_Libraries/FilterBorderControlNPP# echo $?
0