Skip to content

Conversation

@risemeup1
Copy link
Contributor

@risemeup1 risemeup1 commented Jan 16, 2024

PR types

Others

PR changes

Others

Description

  • 功能:
    支持用户在linux系统,x86_64平台下安装paddle,本地不需要装cuda和cudnn

  • 收益:
    1 whl包体积缩小180M
    2 用户安装体验提升

Pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Jan 16, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot
Copy link

paddle-bot bot commented Jan 16, 2024

✅ This PR's description meets the template requirements!
Please wait for other CI results.

@risemeup1 risemeup1 changed the title fix bug Update paddle install Jan 16, 2024
Comment on lines 309 to 320
#if defined(__linux__) && defined(PADDLE_WITH_CUDA)
if (CUDA_VERSION >= 11000 && CUDA_VERSION < 12000) {
return GetDsoHandleFromSearchPath(FLAGS_cublas_dir, "libcublasLt.so.11");
} else if (CUDA_VERSION >= 12000 && CUDA_VERSION <= 12030) {
return GetDsoHandleFromSearchPath(FLAGS_cublas_dir, "libcublasLt.so.12");
} else {
std::string warning_msg(
"Your CUDA_VERSION is less than 11 or greater than 12, paddle "
"temporarily no longer supports");
return nullptr;
}
#elif defined(PADDLE_WITH_CUDA) && CUDA_VERSION >= 10010
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段逻辑会和下面的这个 elif 分支冲突吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的

#else
return GetDsoHandleFromSearchPath(
FLAGS_cudnn_dir, "libcudnn.so", false, {cuda_lib_path});
FLAGS_cudnn_dir, "libcudnn.so.8", false, {cuda_lib_path});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么一定是 .8 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为nvidia提供的包没有libcudnn.so,止呕libcudnn.so.8

#else
return GetDsoHandleFromSearchPath(
FLAGS_cupti_dir, "libcupti.so", false, {cupti_lib_path});
FLAGS_cupti_dir, "libcupti.so.11.7", false, {cupti_lib_path});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上,为什么一定是 .11.7

return GetDsoHandleFromSearchPath(FLAGS_rocm_dir, "libhiprand.so");
#else
return GetDsoHandleFromSearchPath(FLAGS_cuda_dir, "libcurand.so");
return GetDsoHandleFromSearchPath(FLAGS_curand_dir, "libcurand.so.10");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

commands = ["patchelf --set-rpath '$ORIGIN/../libs/' ${PADDLE_BINARY_DIR}/python/paddle/base/${FLUID_CORE_NAME}" + '.so']
commands.append("patchelf --set-rpath '$ORIGIN' ${PADDLE_BINARY_DIR}/python/paddle/libs/${COMMON_NAME}")
commands = ["patchelf --set-rpath '$ORIGIN/../libs/:$ORIGIN/../../nvidia/cuda_runtime/lib' ${PADDLE_BINARY_DIR}/python/paddle/base/${FLUID_CORE_NAME}" + '.so']
#commands.append("patchelf --set-rpath '$ORIGIN' ${PADDLE_BINARY_DIR}/python/paddle/libs/${COMMON_NAME}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

YuanRisheng
YuanRisheng previously approved these changes Jan 22, 2024
commands = ["patchelf --set-rpath '$ORIGIN/../libs/' ${PADDLE_BINARY_DIR}/python/paddle/base/${FLUID_CORE_NAME}" + '.so']
commands.append("patchelf --set-rpath '$ORIGIN' ${PADDLE_BINARY_DIR}/python/paddle/libs/${COMMON_NAME}")
commands = ["patchelf --set-rpath '$ORIGIN/../libs/:$ORIGIN/../../nvidia/cuda_runtime/lib' ${PADDLE_BINARY_DIR}/python/paddle/base/${FLUID_CORE_NAME}" + '.so']
#commands.append("patchelf --set-rpath '$ORIGIN' ${PADDLE_BINARY_DIR}/python/paddle/libs/${COMMON_NAME}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释代码不需要删掉吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

@risemeup1 risemeup1 force-pushed the install_paddle_upgrade branch from 5b98ce0 to c110115 Compare January 24, 2024 03:40
@risemeup1 risemeup1 changed the title Update paddle install Installing paddle does not depend on local cuda and cudnn Jan 25, 2024
@risemeup1 risemeup1 force-pushed the install_paddle_upgrade branch from 493fb59 to a0a19f1 Compare January 25, 2024 12:24
Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@zyfncg zyfncg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for setup.py.in

Copy link
Contributor

@lanxianghit lanxianghit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for flags

Copy link
Contributor

@zhangbo9674 zhangbo9674 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@risemeup1 risemeup1 merged commit fe3897f into PaddlePaddle:develop Jan 26, 2024
eee4017 pushed a commit to eee4017/Paddle that referenced this pull request Jan 30, 2024
…le#60841)

* fix bug

* fix bug

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants