Error initializing NvEncoder

I got the Error 8 feed back when initializing CudaNvEncoder (as I am running in Ubuntu) with H264/HEVC encoding, but it works well with avi encoding. My Graphic card is 4080 and can run the SDK package to perform avi encoding, but when change to H264 or HEVC, it error when I call the initialize encoder.