Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HybridPro fix on Ubuntu #666

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmake/modules/FindRpr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ elseif(RPR_SDK_PLATFORM STREQUAL "ubuntu18.04")
SET_RPR_VARIABLES(binUbuntu18)
elseif(RPR_SDK_PLATFORM STREQUAL "ubuntu20.04")
SET_RPR_VARIABLES(binUbuntu18)
elseif(RPR_SDK_PLATFORM STREQUAL "ubuntu22.04")
SET_RPR_VARIABLES(binUbuntu18)
else()
SET_RPR_VARIABLES(binCentOS7)
endif()
Expand Down
5 changes: 4 additions & 1 deletion pxr/imaging/plugin/hdRpr/rprApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4116,7 +4116,10 @@ Don't show this message again?
if (!aov) {
HdRprApiAov* newAov = nullptr;
std::function<void(HdRprApiAov*)> aovCustomDestructor;

if (aovName == HdAovTokens->primId && RprUsdIsHybrid(m_rprContextMetadata.pluginType)) {
TF_RUNTIME_ERROR("Failed to create primId AOV: HybridPro does not support this AOV type");
return nullptr;
}
if (aovName == HdAovTokens->color) {
auto rawColorAov = GetAov(HdRprAovTokens->rawColor, width, height, HdFormatFloat32Vec4);
if (!rawColorAov) {
Expand Down
10 changes: 10 additions & 0 deletions pxr/imaging/rprUsd/contextHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ const std::map<RprUsdPluginType, const char*> kPluginLibNames = {
#elif defined __linux__
{kPluginNorthstar, "libNorthstar64.so"},
{kPluginHybrid, "Hybrid.so"},
{kPluginHybridPro, "HybridPro.so"},
#elif defined __APPLE__
{kPluginNorthstar, "libNorthstar64.dylib"},
#endif
Expand Down Expand Up @@ -395,6 +396,12 @@ rpr::Context* RprUsdCreateContext(RprUsdContextMetadata* metadata) {

contextProperties.push_back(nullptr);

#if LINUX
if (metadata->pluginType == kPluginHybridPro){
std::setlocale(LC_NUMERIC, "en_US.UTF-8"); // is needed for HybridPro to correctly compile shaders
}
#endif

rpr::Status status;
rpr::Context* context = rpr::Context::Create(RPR_API_VERSION, &pluginID, 1, creationFlags, contextProperties.data(), cachePath.c_str(), &status);

Expand Down Expand Up @@ -438,6 +445,9 @@ RprUsdDevicesInfo RprUsdGetDevicesInfo(RprUsdPluginType pluginType) {
ret.cpu.numThreads = 0;

if (!RprUsdIsCpuOnly()) {
#if LINUX
std::setlocale(LC_NUMERIC, "en_US.UTF-8"); // is needed for HybridPro to correctly compile shaders
#endif
std::string name = GetGpuName(pluginID, RPR_CREATION_FLAGS_ENABLE_GPU0, RPR_CONTEXT_GPU0_NAME, cachePath.c_str());
if (!name.empty()) {
ret.gpus.push_back({ 0, name });
Expand Down